Slurm - SBATCH Header / Flag Cheat Sheet
Overview
There are dozens of possible SBATCH headers/flags for fine-tuning the way a job runs. The most common options are listed here. See all possible options with the shell command: man sbatch
or man salloc
or visit the official Slurm documentsion for sbatch and salloc.
Table
Option | Examples | Usage |
---|---|---|
-N <X> Â |
 | Request a specified or range of nodes for job to be spread across. If omitted, Slurm will run on any number of nodes the job can fit on. It is recommended to set this to 1 unless you have an MPI job No Default value |
-n <X> Â |
| The number of tasks assigned to your job. A task is a ‘slot' a process can attach to. This should be 1 for serial jobs, and greater than 1 for MPI jobs Defaults to 1 if not defined |
-c <X> |
| The number of cores per task assigned to your job. This should be 1 or greater for serial jobs, and typically is 1 for MPI jobs. |
--mem=<X>G |
| Request a specified amount of memory for your job. Be sure to include Defaults to 2GiB per CPU core |
-t <time> Â |
| The time limit, aka wall time, for a job to run. This can be in the format Defaults to 4 hours if not set |
-p <partition> |
| The partition to submit the job to. See more information about partitions here: ##TODO Link to Paritions Defaults to HTC if not set |
-q <qos> |
| The QoS to submit the job to. See more information about QoS’s here: ##TODO Link to qos Defautls to public if not set |
--gres / -G |
| Gres stands for Generic Resources, we are only currently using this as a way to request GPU’s. You can specify a type of GPU, or use just a number to request any type of GPU Defaults to none if not defined |
-o <filename> |
| The output file that stdout is directed to for your job script. Can be a relevant path or absolute path. This is extremely useful for troubleshooting when a job fails, and also for seeing the output of the job. %j is translated to the jobID. See here for more info Note: the outfile and error file can be the same file Defaults to %j.out |
-e <filename> |
| The error file that stderr is directed to for your job script. Can be a relevant path or absolute path. This is extremely useful for troubleshooting when a job fails, and also for seeing the output of the job. %j is translated to the jobID. See here for more info Note: the outfile and error file can be the same file Defaults to %j.err |
--mail-type=<$VAR> |
| This option defined what notifications you receive about the job. Valid options are: NONE, BEGIN, END, FAIL, REQUEUE, ALL Defaults to NONE |
--mail-user=<$VAR> |
 | The user to send the job notifications to. %u translates to your asurite. Can be in the format %u@asu.edu to receive email notifications Defaults to NONE |
Â