Re: [slurm-users] SLURM_NTASKS not defined after salloc

2018-07-11 Thread Alexander Grund
Unfortunately this will not work. Example: salloc --nodes=3 --exclusive I'm wondering, why there is a discrepancy between the environment variables and scontrol. The latter clearly shows "NumNodes=3 NumCPUs=72 NumTasks=3 CPUs/Task=1" (yes I realize that those values are inconsistent too, but a

Re: [slurm-users] SLURM_NTASKS not defined after salloc

2018-07-11 Thread Jeffrey Frey
SLURM_NTASKS is only unset when no task count flags are handed to salloc (no --ntasks, --ntasks-per-node, etc.). Can't you then assume if it's not present in the environment you've got a single task allocated to you? So in your generic starter script instead of using SLURM_NTASKS itself, use a

Re: [slurm-users] SLURM_NTASKS not defined after salloc

2018-07-11 Thread Alexander Grund
Hi Peter, thanks for the information, you are right: SLURM_NTASKS is not set if "-n" is not passed to salloc. I am kinda relying on what happens after I call "srun ./binary" especially how many instances will be started. scontrol shows this information, so I could parse this. But is there an

Re: [slurm-users] SLURM_NTASKS not defined after salloc

2018-07-11 Thread Peter Kjellström
On Wed, 11 Jul 2018 14:10:51 +0200 Alexander Grund wrote: > Hi all, > > is it expected/intended that the env variable SLURM_NTASKS is not > defined after salloc? It only gets defined after the an srun command. > The number of tasks appear in `scontrol -d show job ` though. > So is it a bug in o

[slurm-users] SLURM_NTASKS not defined after salloc

2018-07-11 Thread Alexander Grund
Hi all, is it expected/intended that the env variable SLURM_NTASKS is not defined after salloc? It only gets defined after the an srun command. The number of tasks appear in `scontrol -d show job ` though. So is it a bug in our installation or expected? Thanks, Alex