SLURM Environmental Variables: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Scheduler]] | [[Category:Scheduler]] | ||
Slurm passes configuration data to jobs via environmental variables. The following is a list of commonly used variables that are set by Slurm for each job | Slurm passes configuration data to jobs via environmental variables. The following is a list of commonly used variables that are set by Slurm for each job on SLURM 22. | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
Line 9: | Line 9: | ||
| $SLURM_CPUS_ON_NODE || Number of cores/node | | $SLURM_CPUS_ON_NODE || Number of cores/node | ||
|- | |- | ||
| $ | | $SRUN_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. | ||
|- | |- | ||
| $SLURM_JOB_ID || Job ID | | $SLURM_JOB_ID || Job ID |
Latest revision as of 16:29, 23 December 2024
Slurm passes configuration data to jobs via environmental variables. The following is a list of commonly used variables that are set by Slurm for each job on SLURM 22.
Slurm Variable Name | Description |
---|---|
$SLURM_CPUS_ON_NODE | Number of cores/node |
$SRUN_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. |
$SLURM_JOB_ID | Job ID |
$SLURM_JOBID | Deprecated. Same as SLURM_JOB_ID |
$SLURM_JOB_NAME | Job Name |
$SLURM_JOB_NODELIST | Nodes assigned to job |
$SLURM_JOB_NUM_NODES | Number of nodes allocated to job |
$SLURM_LOCALID | Index to core running on within node |
$SLURM_NODEID | Index to node running on relative to nodes assigned to job |
$SLURM_NTASKS | Total number of cores for job |
$SLURM_PROCID | Index of task relative to job |
$SLURM_SUBMIT_DIR | Submit Directory |
$SLURM_TMPDIR | Temporary directory. See also Temporary Directories. |
$SLURM_SUBMIT_HOST | Host submitted from |
$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. |