Quick Links To be completed (links are not active yet)
- Request CPU
- Request GPU
- Start Matlab
- Start Jupyter Notebook
- Submit a batch job
- SLURM cheatsheet
- List of GPUs
- List of CPUs
- Conda
- Docker / Singularity
- Tensorboard
- How to do Data Transfer
- PHI data and e2
- Develop directly on e2 with VS Code
Most links in this tutorial require BCH VPN access. Make sure you are logged in via Pulse Secure.
Use this page as a beginner guide. Use Research Computing wiki for advanced info (link).
Login to e2 cluster from your CRL machine:
ssh <username>@e2.tch.harvard.edu- Password-less login instructions
Your e2 root directory has the following structure:
/home/<username>- the directory upon which you land when connecting to e2 is deceptively named in the same way as your home directory on CRL filesystem- however this is a totally independent directory, which has no access to your CRL filesystem at all
- this root directory has 50 Gb file limit
/temp_work/<username>- has 5TB file limit for each user. However, each file that is untouched for >30days will be automatically deleted. more info
- the e2 login node (i.e. the place where you land via
ssh <username>@e2.tch.harvard.edu) should not be used to start any compute jobs - you must request a CPU/GPU machines via SLURM algorithm
- SLURM algorithm is a fair share queueing system that distributes resources to users
- in other words it performs the
ssh <machine>command for you by considering the current demand on resources from all users - if no compute nodes are available it will queue your request and execute your job as soon as resources become available
- all BCH researchers have access to e2 cluster
- login to e2 via
ssh <username>@e2.tch.harvard.edu - run
srun -A bch -p bch-interactive --pty /bin/bash - is equivalent to
ssh <machine>in SLURM - if resources are available, you will immediately be logged into a new machine
- this new machine will have access to the same data as your e2 login node (e.g.
/home/<username>andtemp_work/<username>)
- research computing staff had pre-installed many different software packages on e2 for us
- the list can be found here
- to load any of these software you write the following command after you logged into CPU/GPU node:
load module <name> - e.g.
module load matlab,module load anaconda,module load singularity - to request new software to be installed you must write to
research-computing@childrens.harvard.edu - alternatively, if you know how to use Docker, how can deploy Docker images via
singularitysoftware (more info below) - alternatively, if you use anaconda, you can also deploy preinstalled binaries via
conda install <binary>command (more info below)
- SLURM's batch mode will execute scripts for you automatically
- to start SLURM in batch mode, use
sbatchcommand instead ofsruncommand - e.g.
sbatch /home/<username>/your_sample_script.sh - there are multiple benefits to running SLURM in batch mode:
- you do not have to wait for resources to become available to launch your job. SLURM will queue your request and automatically start your job for you
- SLURM will send you emails when your job starts, stops or throws an error
- You can queue multiple tasks in the same script, which will be executed in sequence
- You can run many jobs in parallel by starting multiple
sbatchrequests
- If you prefer to use GUI (e.g. for matlab) you can start SLURM with
salloccommand - Instructions are here
- e.g.
srun -A bch -p bch-interactive --ntasks=4 --mem=2G -t 24:00:00 --pty /bin/bash -A bchaccount name (always the same)-p bch-gpupartition name. Usebch-compute/bch-largemem/bch-interactivefor CPU andbch-gpufor GPU. More info--ntasks=4number of CPU cores required--mem=2Gamount of RAM required. If you need very large RAM, use-p bch-largememoption also.-t 24:00:00time allocation. Maximum allowed is 24hours. You can specify less time (there are many benefits to it).--pty /bin/bashstart an interactive bash prompt.
- You can specify options for
sbatchin the same as was forsrun. - However, it is much more convenient add them to your bash (.sh) script
- that way you only neede to run
sbatch /home/<username>/your_sample_script.sh - e.g. example of running MATLAB script with the same options as above:
#!/bin/bash
# Sample batchscript to run a simple MATLAB job on HPC
#SBATCH --partition=bch-compute # partitition to be used (same as "-p bch-compute")
#SBATCH --time=24:00:00 # Running time (in hours-minutes-seconds) (same as "-t 00:05:00)
#SBATCH --ntasks=4 # Number of CPU cores required
#SBATCH --mem=2G # Memory required in Gb
module load matlab
matlab -nodisplay -nosplash -nodesktop -r "run('your_sample_matlab_script.m');exit;"
- more advanced version (with FULL options):
#!/bin/bash
# Sample batchscript to run a simple MATLAB job on HPC
#SBATCH --partition=bch-compute # partition to be used
#SBATCH --time=00:05:00 # Running time (in hours-minutes-seconds)
#SBATCH --job-name=test-matlab # Job name
#SBATCH --mail-type=BEGIN,END, FAIL # send and email when the job begins, ends or fails
#SBATCH --mail-user=<your_email_address> # Email address to send the job status
#SBATCH --output=output_%j.txt # The output from the script will be written here instead of the terminal
#SBATCH --nodes=1 # Number of cpu nodes (i.e. how many machines you want)
#SBATCH --ntasks=4 # Number of cpu cores per node (i.e. how many cores per machine)
#SBATCH --mem=10G # Memory required in Gb
module load matlab
matlab -nodisplay -nosplash -nodesktop -r "run('your_sample_matlab_script.m');exit;"
- you can use exactly the same principles as above for instantiating GPU, with few changes required
- you must use
--partitiion=bch-gpuor-p bch-gpuflag - you must specify the GPU type to be used with
--gres=gpu:Quadro_RTX:1 - where
Quadro_RTXrefers to GPU type and1refers to number of GPUs (per node) required - (unless you want to execute on multiple GPUs) you must make sure that you execute
export CUDA_AVAILABLE_DEVICES=0before running your deep tensorflow / pytorch script - the number in the CUDA_AVAILABLE_DEVICES refers to the same number as in
--grescommand - [optional] you can specify the number of CPU cores via
ntasksand CPU RAM viamemas well - you must run
module load anaconda3followed by a)source activate tf-gpufor tensorflow access b)source activate pytorch-gpufor pytorch access - example script:
#!/bin/bash
# Sample batchscript to run a tensorflow job on HPC
#SBATCH --partition=bch-gpu
#SBATCH --time=00:05:00
#SBATCH --job-name=test-gpu
#SBATCH --mail-type=BEGIN,END,FAIL
#SBATCH --mail-user=<username>@tch.harvard.edu
#SBATCH --output=output_%j.txt
#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --mem=8G # NB this refers to CPU RAM, not GPU RAM
#SBATCH --gres=gpu:Tesla_T:1
export CUDA_VISIBLE_DEVICES=0
module load anaconda3
source activate tf-gpu
python test.py
squeue -u <username>
scancel <jobid>(get jobid fromsqueuecommand)
- more help on
srun - more examples of
sbatch - extensive list of quenstions and answers on SLURM is here
- usage guidelines
- As of this this month there are ~41 GPU cores on the e2 cluster
- At least a dozen of them have 24Gb of RAM
- These GPUs are of type: Tesla_K, Tesla_T, Titan_RTX, Quadro_RTX
- There is a limit of 4 GPUs per person at any one time
- full list
- Info
- Please ask Alex for more help on CPUs (I mostly just use GPUs)
- Docker requires sudo access, which is unavailable on e2
- Use singularity instead, which can build and run docker images without sudo
- Instructions on building singularity images are here
- Login to e2 root node
- Get interactive CPU/GPU instance via
sruncommand - Load anaconda/conda
module load anaconda3 - Activate environment via
source activate <environment>(to list available<environment>runconda env list) - Start Jupyter
jupyter lab --ip=$(hostname -i) --port=8888 --no-browser - Note the output of the above command. e.g.
http://192.168.45.23:8888/?token=1cf2e1b601987535cf302a1b98649c2a36a4ea40fe2a5af6 - Open a Terminal on your CRL machine / home computer and enter:
ssh -N -f -L 8888:<host_ip>:8888 <username>@rayan, where <host_ip> corresponds to192.168.45.23in the output above (6.) - Open browser on your CRL machine / home computer and navigate to:
http://<host_ip>:8888 - The browser will request token. Enter
<token>, where token corresponds to1cf2e1b601987535cf302a1b98649c2a36a4ea40fe2a5af6in the output above (6.)
- More info here
- start tensorboard on e2 via
tensorboard --logdir <path_to_training_location> - perform steps 7 and 8 as in "Jupyter Lab/Notebook" instructions above. Substitute port 8888 with port given by tensorboard (typically it is 6006). You can also try sub <host_ip> with
localhostif no host_ip given by tensorboard.
- If you use VS Code, did you know that you can DIRECTLY access files on remote server via Remote Development pack?
- It is a super convenient way to work in a fully integrated IDE with DIRECT access to your files on CRL filesystem / E2 filesystem
- If want to learn more - please ask me (Serge) - perhaps we can organize another CRL JC on it
- Additional GPU and CPU are available via MGH's MGHHPCCC cluster
- Instructions are here
- e2 'node' (machine) does not have direct access to CRL filesystem. e.g. /fileserver/motion/, /fileserver/projects/, /fileserver/abd
- it also does not have direct access to your local crl home folder /home/ch215616/ either
- you cannot mount any custom CRL filesystems on e2
- there are tools that you can use to copy data between the CRL filesystem (or your local computer) and e2
- These tools are: rsync, any SFTP software, /lab-share/Rad-Warfield-e2, BCH Google Drive
- IMPORTANT: all data copied to e2 must be NON-PHI
rsyncis a linux command that allows you to copy files between a linux filesystem and any external file storage system- rsync is installed by default on e2.
- It should be installed on all CRL machines. If this isn't the case for your machine, please email Sean/Simon
rsync -e ssh -auz /fileserver/fastscratch/README.txt <username>@e2.tch.harvard.edu:/home/<username>/- copies file (folder) from CRL to e2rsync -e ssh -auz <full_path_to_your_home_computer_folder> <username>@e2.tch.harvard.edu:/home/<username>/- copies file (folder) from your home computer to e2rsync -e ssh -auz <username>@e2.tch.harvard.edu:/home/<username>/<folder> <full_path_to_your_home_computer_folder>- copies file (folder) from e2 to your home computer- note that you must use
sshand-auzin your command - to speed up the copying process you can use [parallel file transfer] http://websvc4.tch.harvard.edu:8090/display/RCK/Parallel+file+transfer+with+rsync)
- this method is valuable for those who prefer to use Finder/Nautilus/Explorer over Terminal to navigate the filesystem instead of Linux Terminal
- this method can be used to transfer data between your home computer and e2, or your home computer and CRL filesystem
- you could in theory use SFTP to transfer files between e2 and CRL filesystem, as long as you install on your CRL machine
- The example given here is based on FILEZILLA software
- you can use any other SFTP software, e.g. winscp, or cyberduck
- Install Filezilla on your home computer
- Open Filezilla and type the following in the top bar:
HOST: sftp://e2.tch.harvard.edu Username: <username> Password: <password> Port: 22 - Swap
sftp://e2.tch.harvard.eduwithsftp://<your_crl_machine>if you want to connect to the CRL filesystem instead
- [tip] use an 'arrow' next to 'Quickconnect' button to access previously logged devices
- [tip] Click 'View/Remote Directory Tree' for tree-view of the remote machine.
- [tip] Right click on remote file and click 'View/Edit' to view file on your computer (it will be stored in temporary folder only)
- [tip] Right click on remote file and click 'Download' to download the file to your currently opened local folder
- [wormhole] there is a direct link between CRL filesystem and e2
- its location on CRL filesystem is
/fileserver/Rad-Warfield-e2/ - its location on e2 filesystem is
/lab-share/Rad-Warfield-e2/ - IMPORTANT 1: you must write to 'research-computing@childrens.harvard.edu' to request
read/write/executepermissions on /lab-share/Rad-Warfield-e2 folder on e2 cluster (you must specify that you are part of Simon's research group) - IMPORTANT 2: this location is ONLY accessible via the following machines on CRL: boreas, auster, io, ganymede
- therefore you must
ssh boreasbefore you will be able to see this location - if you want to access this location from your own CRL machine, you will need to spend at least a few days in back-forth emails with research computing to set it up
- you can also copy data between e2 and your BCH Google Drive
- you can do this by using
rclonecommand - please refer to my BCH Google Drive tutorial for more info
- tbd with Simon during the journal club