Slurm options

Slurm options

There is a great number of options for srun and sbatch. Below are the more important ones. For sbatch, it is recommended you specify these in your submission script rather than on the command line.

Option

Description

Option

Description

--job-name <name>

Name the job.

--partition <name>

Name of the partition to run the job. Defaults to cpu. We recommend using cpu for CPU jobs or gpu for GPU jobs.

--nodes <count>

Number of nodes to allocate. Defaults to 1. Do not use more than 1 unless your code can run on multiple nodes (e.g. MPI).

--ntasks <count>

Number of parallel tasks (simultaneous instances of the same program) to run. Defaults to 1. Do not use more than 1 unless your code can run on multiple processes (e.g. MPI).

--cpus-per-task <count>

Number of CPUs to allocate per task (see --ntasks). Defaults to 1. Do not use more than 1 unless your code uses parallelism (e.g. threads or OpenMPI).

--mem <amount[unit]>

Amount of memory to allocate. Unit is M (megabytes) or G (gigabytes, recommended). Defaults to 16G. 

If your job uses more memory than allocated with --mem, your job will be killed. Make sure to allocate the memory you need. Do not over allocate memory in excess (e.g. 64G when the job only needs 16G). Doing so negatively impacts everyone's ability to use the cluster.

--gres=gpu:<count>

Number of GPUs to allocate in exclusive mode. The GPU will NOT be shared with any other job. Use only when the job needs the whole of a GPU (e.g. all GPU memory).

--gres=shard:<count>

Number of GPU shards to allocate in shared mode. The GPU may be shared with other jobs. Use when the job has a small memory footprint and may simultaneously run along with other jobs.

--output=<filename>

Redirect the standard output to the file specified. Defaults to slurm-<job-id>.out.

--error=<filename>

Redirect the standard error to the file specified. Defaults to slurm-<job-id>.out.

--mail-user myemail@vcu.edu

Send an email to myemail@vcu.edu whenever the job status changes.

--mail-type=ALL

Type of notification to receive an email: ALL | BEGIN | END | FAIL | REQUEUE