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 any better way? The script in question is a generic starter (wrapper) and should work no matter what the user passed to salloc. It should just be able to know, how many processes would be started by srun. How can I do that?


Am 11.07.2018 um 15:12 schrieb Peter Kjellström:
On Wed, 11 Jul 2018 14:10:51 +0200
Alexander Grund <alexander.gr...@tu-dresden.de> 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 <jobid>` though.
> So is it a bug in our installation or expected?

my salloc sets SLURM_NTASKS (if you pass -n, otherwise not). This is
similar to how sbatch works.

Tested on 17.11.7


Sent from my Android device with K-9 Mail. Please excuse my brevity.

Alexander Grund
Interdisziplinäre Anwendungsunterstützung und Koordination (IAK)

Technische Universität Dresden
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Chemnitzer Str. 46b, Raum 010 01062 Dresden
Tel.: +49 (351) 463-35982
E-Mail: alexander.gr...@tu-dresden.de

Reply via email to