Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SLURM task ID in program

Tags:

slurm

I'm running srun -n 100 python foo.py. Inside the python script how does it find out which task number/id/rank it is? Is there an environment variable set?

like image 705
sligocki Avatar asked Oct 19 '25 01:10

sligocki


1 Answers

Have a look at man srun or man sbatch for a list of environment variables. $SLURM_PROCID might be the one you need.

like image 142
ciaron Avatar answered Oct 22 '25 06:10

ciaron