Updated list of environment variables set by slurm

Updated list of environment variables set by slurm

Updated list of Slurm variables.

Slurm Job Environment Variables
Slurm Variable Name Description Example values
$SLURM_CPUS_ON_NODE Number of cores/node 8,3
$SLURM_CPUS_PER_TASK Number of cores per task. I.e., the value given to the -cpus-per-task or -c sbatch options. Not set unless one of those options given. 8,3
$SLURM_JOB_ID Job ID 5741192
$SLURM_JOBID Deprecated. Same as SLURM_JOB_ID  
$SLURM_JOB_NAME Job Name myjob
$SLURM_JOB_NODELIST Nodes assigned to job compute-b24-[1-3,5-9],compute-b25-[1,4,8]
$SLURM_JOB_NUM_NODES Number of nodes allocated to job 2
$SLURM_LOCALID Index to core running on
within node
4
$SLURM_NODEID Index to node running on
relative to nodes assigned to job
0
$SLURM_NNODES Deprecated. Same as SLURM_JOB_NUM_NODES 4
$SLURM_NODELIST Deprecated. Same as SLURM_JOB_NODELIST compute-b24-[1-3,5-9],compute-b25-[1,4,8]
$SLURM_NTASKS Total number of cores for job??? 11
$SLURM_PROCID Index of task relative to job 0
$SLURM_SUBMIT_DIR Submit Directory /lustre/payerle/work
$SLURM_SUBMIT_HOST Host submitted from login-1.deepthought2.umd.edu
$SLURM_TASKS_PER_NODE This gives a comma-delimited list of integers representing the task per the node, using the same ordering as in SLURM_JOB_NODELIST. If consecutive nodes have the same task count, the integer will be followed by '(xN)', so the example value is for 2 tasks on the first three nodes and 1 task on the fourth node.  

a

Variable

Description

$SLURM_JOB_ID

The Job ID.

$SLURM_JOBID

Deprecated. Same as $SLURM_JOB_ID

$SLURM_SUBMIT_DIR

The path of the job submission directory.

$SLURM_SUBMIT_HOST

The hostname of the node used for job submission.

$SLURM_JOB_NODELIST

Contains the definition (list) of the nodes that is assigned to the job.

$SLURM_NODELIST

Deprecated. Same as SLURM_JOB_NODELIST.

$SLURM_CPUS_PER_TASK

Number of CPUs per task.

$SLURM_CPUS_ON_NODE

Number of CPUs on the allocated node.

$SLURM_JOB_CPUS_PER_NODE

Count of processors available to the job on this node.

$SLURM_CPUS_PER_GPU

Number of CPUs requested per allocated GPU.

$SLURM_MEM_PER_CPU

Memory per CPU. Same as --mem-per-cpu .

$SLURM_MEM_PER_GPU

Memory per GPU.

$SLURM_MEM_PER_NODE

Memory per node. Same as --mem .

$SLURM_GPUS

Number of GPUs requested.

$SLURM_NTASKS

Same as -n, –ntasks. The number of tasks.

$SLURM_NTASKS_PER_NODE

Number of tasks requested per node.

$SLURM_NTASKS_PER_SOCKET

Number of tasks requested per socket.

$SLURM_NTASKS_PER_CORE

Number of tasks requested per core.

$SLURM_NTASKS_PER_GPU

Number of tasks requested per GPU.

$SLURM_NPROCS

Same as -n, --ntasks. See $SLURM_NTASKS.

$SLURM_NNODES

Total number of nodes in the job’s resource allocation.

$SLURM_TASKS_PER_NODE

Number of tasks to be initiated on each node.

$SLURM_ARRAY_JOB_ID

Job array’s master job ID number.

$SLURM_ARRAY_TASK_ID

Job array ID (index) number.

$SLURM_ARRAY_TASK_COUNT

Total number of tasks in a job array.

$SLURM_ARRAY_TASK_MAX

Job array’s maximum ID (index) number.

$SLURM_ARRAY_TASK_MIN

Job array’s minimum ID (index) number.

Tags
English