Slurm quick reference
Slurm commands and environment variables
Slurm is the job scheduler deployed on JASMIN. It allows users to submit, monitor, and control jobs on the LOTUS (CPU) and ORCHID (GPU) clusters.
Slurm command | Description |
---|---|
sbatch script_file | Submit a job script to the scheduler |
sinfo | Show available scheduling queues |
squeue -u <username> | List user’s pending and running jobs |
srun -n 1 -p test --pty /bin/bash | Request an interactive session on LOTUS |
Long and short argument names are separated by a comma.
#SBATCH
--partition=QUEUE_NAME, -p QUEUE_NAME
QUEUE_NAME
--time=hh:mm:ss, -t hh:mm:ss
hh:mm:ss
--time-min=hh:mm:ss
hh:mm:ss
--job-name=JOB_NAME
JOB_NAME
--output=FILE_NAME, -o FILE_NAME
stdout
)slurm-%j.out
, where %j
is replaced by the job ID--error=FILE_NAME, -e FILE_NAME
stderr
)slurm-%j.err
, where %j
is replaced by the job ID--open-mode=append|truncate
append
or truncate
--mem=XXX
XXX
memory is required for the job. Default units are megabytes (e.g. --mem=250
means 250MB)--array=INDEX
--array=1-10
- for an example submission script, see
this pageslurm-%A_%a.out
, where %A
is replaced by the job ID and %a
with the array index--output
and --error
as above with %A
and %a
instead of %j
--array=INDEX%ArrayTaskThrottle
%
separator--array=1-15%4
will limit the number of simultaneously running tasks from this job array to 4--chdir=DIRECTORY, -D DIRECTORY
DIRECTORY
before it is executed--exclusive
--dependency=<dependency_list>
--ntasks=NUMBER_OF_CORES, -n NUMBER_OF_CORES
--constraint=HOST_GROUP_NAME
Slurm command | Description |
---|---|
scancel <jobid> | Kill a job |
scontrol show job <jobid> | Show details job information |
scontrol update job <jobid> | Modify a pending job |
scancel --user=<username> | Kill all jobs owned by a user |
Slurm variable | Description |
---|---|
$SLURM_JOBID | Job identifier number |
$SLURM_ARRAY_JOB_ID | Job array |
$SLURM_ARRAY_TASK_ID | Job array index |
$SLURM_ARRAY_TASK_MAX | Last index number within a job array |
$SLURM_NTASKS | Number of processors allocated |