Skip to content
Snippets Groups Projects
Commit 1a015b6a authored by Roman Sliva's avatar Roman Sliva
Browse files

Update slurm-job-submission-and-execution.md

parent 7f5f8ef0
No related branches found
No related tags found
No related merge requests found
Pipeline #33211 passed with warnings
......@@ -116,13 +116,43 @@ $ cat slurm-1511.out
#### Job Environment Variables
Slurm exposes useful information about job to job main process (usually shell) via environment variables.
To view all of the Slurm's environment variables, use the command:
Slurm provides useful information to the job via environment variables. Environment variables are available on all nodes allocated to job when accessed via Slurm supported means (srun, compatible mpirun).
```shell
See all Slurm variables
```
set | grep ^SLURM
```
### Useful Variables
| variable name | description | example |
| ------ | ------ | ------ |
| SLURM_JOBID | job id of the executing job| 593 |
| SLURM_JOB_NODELIST | nodes allocated to the job | p03-amd[01-02] |
| SLURM_JOB_NUM_NODES | number of nodes allocated to the job | 2 |
| SLURM_STEP_NODELIST | nodes allocated to the job step | p03-amd01 |
| SLURM_STEP_NUM_NODES | number of nodes allocated to the job step | 1 |
| SLURM_JOB_PARTITION | name of the partition | p03-amd |
| SLURM_SUBMIT_DIR | submit directory | /scratch/project/open-xx-yy/work |
See [Slurm srun documentation][2] for details.
Get job nodelist
```
$ echo $SLURM_JOB_NODELIST
cn[10-11]
```
Expand nodelist to list of nodes.
```
$ scontrol show hostnames $SLURM_JOB_NODELIST
cn10
cn11
```
#### Common Job Workflow
!!! Note
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment