[slurm-users] Getting task distribution from environment

Alexander Grund alexander.grund at tu-dresden.de
Mon Feb 3 13:28:30 UTC 2020


Hello,

I need to get (at least) a list with the number of tasks on each 
hostname for the current job step from withing each task.

My current approach is to use SLURM_STEP_NODELIST  and 
SLURM_STEP_NUM_TASKS and expand them without changing the order. Then I 
match them 1:1 to get something like:
"[n1: 2, n2: 2, n4: 1]" out of "n[1-2],n4" and "2(x2),1"

Questions:
- Is this valid aka does this always produce the correct result? Or can 
the order in those 2 variables not match?
- Is there an easier way?
- Is it possible to get some similar listing for CPUs allocated to each 
task? I know of SLURM_CPUS_PER_TASK but can the number of CPUs be 
different per task?

Thanks, Alex

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

Technische Universität Dresden
Zentrum für Informationsdienste und Hochleistungsrechnen (ZIH)
Würzburger Str.35/Chemnitzer Str.50, Raum 010 01062 Dresden
Tel.: +49 (351) 463-35982
E-Mail: alexander.grund at tu-dresden.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5204 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20200203/99a53c46/attachment.bin>


More information about the slurm-users mailing list