Log in to the SCRC cluster first. Refer to Get Started to learn how. If you are off campus, connect to the NYU VPN before logging in.
Work in your ~/bigdata directory, because home directories have a small quota. If you don't have one fillout the User Request form
getSlurmExamples.sh is a command already installed on the cluster, so you don't need your own copy of it. It copies a full set of working examples into the directory you run it from:
$ cd ~/bigdata
$ getSlurmExamples.sh
$ cd ~/bigdata/slurmExamples
A job file is a shell script with three parts: the Slurm options, the software your job needs, and the command that runs your program.
#!/bin/bash
# 1. Slurm options: must start with exactly #SBATCH and come before any command
#SBATCH --job-name=myjob
#SBATCH --mem=1g
#SBATCH --time=00:10:00
#SBATCH --output=myjob-%j.out # %j = job ID
#SBATCH --mail-type=END,FAIL
#SBATCH --mail-user=netID@stern.nyu.edu
# 2. Software: run "module avail" to see what is installed
module purge
module load <software>/<version>
# 3. Your program
python myprogram.py
The first line, #!/bin/bash, must be the very first line of the file.
Slurm options tell the scheduler what your job needs. Slurm stops reading them at the first command in the file, so keep them all at the top.
The module lines clear any previously loaded software and then load the version you want. Replace <software>/<version> with a name and version listed by module avail. The last part is whatever you would type to run your program.
Submit the file from a login node with:
sbatch myjob.sbatch
The .sbatch extension is just a convention that makes job scripts easy to spot. Slurm doesn't care what the file is called.
Request only what your job needs, because jobs that request less are more likely to be scheduled sooner. Set a realistic --time and --mem, then check what a finished job actually used:
sacct -j <jobid> --format=JobID,Elapsed,MaxRSS,AllocCPUS,State
| Tutorial | Learning | Example folder |
| ------------------ | ------------------------------------- | ------------------------------- |
| Python Simple Job | Submit a job and check on it | 01-python-hello |
| Python Array Job | Run one script over many input files | 02-python-array-many-data-files |
| Python Virtual Env | Use your own packages in a job | 12-python-duckdb |
| R Fitspline | Pass a parameter with an array job | 10-R-pass-in-env-var |
| R Monte Carlo | Run a simulation | 14-monte-carlo-parallel |
| SAS | Run a SAS program | 08-SAS-mult-progs-against-data |
| MATLAB GPU | Compare CPU and GPU speed | 30-gpu-examples |
| Stata | Run a regression, catch hidden errors | 06-stata-hdfe |
Cloud Computing: virtual machines for research projects.
NYU High Performance Computing: the university-wide cluster, for work that outgrows SCRC.
These older guides are no longer maintained and may not work as written.