Job Parameters in Slurm Scripts for Fox

Slurm supports a multitude of different job parameters. This enables you to effectively tailor your script to your need but also means that is easy to get lost and waste your time and quota.

The following parameters can be used as command line parameters with sbatch and salloc or in job scripts. To use it in a job script, start a newline with #SBATCH followed by the parameter. Replace <....> with the value you want, e.g. --job-name=test-job.

Parameters

Basic Settings

Parameter Function
--account=<name> Project (not user) account the job should be charged to.
--job-name=<name> Job name to be displayed by for example squeue
--output=<path> Path to the file where the job (error) output is written to

Requesting Resources

Parameter Function
--time=<[d-]hh:mm:ss> Time limit for job, after which the job will be killed. Days-hours:minutes:seconds or hours:minutes:seconds.
--nodes=<num_nodes> Number of nodes. Multiple nodes are only useful for jobs with distributed-memory (e.g., MPI).
--ntasks=<num_procs> Number of (MPI) processes to start. Mostly useful for MPI jobs.
--ntasks-per-node=<num_procs> Number of (MPI) processes per node. Mostly useful for MPI jobs.
--cpus-per-task=<num_threads> CPU cores per task. For parallelized applications this is the number of threads.
--gpus=<num_gpus> Number of GPUs.
--gpus-per-node=<num_gpus> Number of GPUs per node.
--gpus-per-task=<num_gpus> Number of GPUs pe task.
--cpus-per-gpu=<num_threads> Number of CPU cores per GPU.
--mem-per-cpu=<amount> Minimum memory (RAM) per requested physical CPU core. Number followed by unit prefix, e.g., 4G.
--mem-per-gpu=<amount> Minimum memory (RAM) per requested GPU. Number followed by unit prefix, e.g. 4G.
--mem=<amount> Minimum memory (RAM) per node. Number followed by unit prefix, e.g., 16G.
--exclusive Job will not share nodes with other jobs. Do not use this unless you really know what you are doing.

Job Types

These parameters are used to select which type of job to run, either in terms of which nodes it will run on and/or what quality of service (QoS) it will get.

Parameter Function
--partition=<name> Partition in which to run the job.
--qos=<name> The QoS to use.

See Job Types for how to use these parameters to specify the type of job.

Advanced Job Control

Parameter Function
--array=<indexes> Submit a collection of similar jobs, e.g. --array=1-10. (sbatch command only). More info.
--dependency=<state:jobid> Wait with the start of the job until specified dependencies have been satified. E.g. --dependency=afterok:123456,

CC Attribution: This page is maintained by the University of Oslo IT FFU-BT group. It has either been modified from, or is a derivative of, "Slurm Parameter and Settings" by NRIS under CC-BY-4.0. Changes: Added options to tables. Removed sections on "Differences between CPUs and tasks" and "Settings for OpenMP and MPI jobs".