Environment Variables

When a SLURM-scheduled work begins, it requires some information about its execution environment. For instance, It needs to identify the working directory and the nodes assigned to it. SLURM sends this data to the executing job through environment variables. The most common environment variables are as follows:



The Job ID.


The path of the job submission directory.


The hostname of the node used for job submission.


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


Number of GPUs requested.


Memory per GPU.


Memory per node. Same as --mem .


Same as --ntasks. The number of tasks.


Number of tasks requested per GPU.


Number of tasks requested per node.


Number of tasks requested per core.


Same as --ntasks. See $SLURM_NTASKS.


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


Number of tasks to be initiated on each node.


Job array’s master job ID number.


Job array ID (index) number.


Total number of tasks in a job array.


Job array’s maximum ID (index) number.


Job array’s minimum ID (index) number.

Visit the SLURM page on environment variables for a complete list of environment variables.