Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When exactly does SLURM export environmental variables?

Tags:

hpc

slurm

With the option --export=ALL, the current environmental variables should be visible to the job script when submitted as

sbatch --export=ALL jobscript.sh

My question is, when exactly does SLURM do the export? Does the export happen when the job is submitted or when it actually starts running? If the job spends some time in the queue and the environmental variables are changed after the job submission but before running starts, which version of them will be "seen" by the job?

like image 741
Botond Avatar asked Oct 22 '25 16:10

Botond


1 Answers

The job will see the environment as it is at the time the sbatch command is run.

When sbatch is run, Slurm will save the environment in a file named hash.<last digit of the job>/job.<jobid>/environmnet in the directory configured as StateSaveLocation.

like image 84
damienfrancois Avatar answered Oct 25 '25 02:10

damienfrancois



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!