SLURM environment variables


Commonly used SLURM environment variables:

Environment Variable Semantic Meaning Sample Value
$LOCAL_SCRATCH Absolute directory path for large disk space per node (nodes will not have access to each other’s local scratch). This should always be /tmp/scratch across all SeARCH nodes /tmp/scratch
$SLURM_CLUSTER_NAME The name given to the cluster in the configuration of the master Slurm daemon Search
$SLURM_CPUS_ON_NODE CPUs/cores per node. 36
$SLURMD_NODENAME The name (as configured in Slurm) of the individual node evaluating the variable, which should match the hostname on our systems. compute-134-10
$SLURM_JOB_ACCOUNT The account used to submit the job. mogipc
$SLURM_JOB_CPUS_PER_NODE If a value for –cpus-per-node is specified for the job, this will reflect that.  16
$SLURM_JOB_IDor$SLURM_JOBID The job ID assigned to the job, so you can identify output related to just that job. 521837
$SLURM_JOB_NAME If the job was named, this will hold that name, otherwise it will default to the command that was run in the job. sh
$SLURM_JOB_NODELISTor$SLURM_NODELIST This contains the hostnames of the nodes that participated in your job. There will be at least one, and is often given in Slurm’s range syntax for contiguous nodes, like the sample value. compute-134-[6-9]
$SLURM_JOB_NUM_NODESor$SLURM_NNODES The quantity of nodes that were requested for the job. 4
$SLURM_JOB_PARTITION Contains what partition(s) the job was placed in. week
$SLURM_JOB_QOS Contains the Quality of Service specified by the job. high
$SLURM_JOB_USER Contains the username of the user who submitted the job. afonso
$SLURM_NODEID Per each individual node in the job, this represents its unique index value in the list of nodes. This should be a value between 0 and the node quantity requested. 0
$SLURM_STEP_IDor$SLURM_STEPID From within a job, sequential srun commands are called job “steps.” Each call to srun increments this variable, giving each step its own unique ID index. This may be helpful for debugging, for example seeing which step the job fails at. 0
$SLURM_STEP_NODELIST From within a job, calls to srun can contain differing specifications of how many nodes should be used for the step. If your job called for 5 nodes, and you used srun -N 3, this variable would contain the list of the 3 nodes from the 5 allocated to the job that participated in this job step. compute-134-[6-9]
$SLURM_STEP_NUM_NODES Like above, except this will contain the quantity of nodes requested for the job step. 3
$SLURM_STEP_NUM_TASKS Contains the quantity of tasks requested to be executed in the job step, defaults to task number of the job request. 1
$SLURM_STEP_TASKS_PER_NODE Contains the value specified by –tasks-per-node in the job step, defaults to the tasks-per-node of the job request. 1
$SLURM_SUBMIT_DIR Contains the absolute path of the directory the job was submitted from. /home/afonso
$SLURM_SUBMIT_HOST Contains the hostname of the system the job was submitted from. Should always be an SeARCH login node (s7sci or s7edu) or an SeARCH node. search7sci
$SLURM_TASKS_PER_NODE Contains the value specified by –tasks-per-node in the job request. 1