Python script for partitioning SLURM sessions

I spent this morning getting preCICE up and running on a cluster and came across the SLURMS sessions article in the documentation, which was very helpful. Thank you very much!

I noticed two things in the linked Python script for partitioning SLURM sessions:

  1. In my case, tnp = os.environ["SLURM_TASKS_PER_NODE"] resulted in the “64(x2)” (see also: Slurm Workload Manager - sbatch ) and thus an error message in mpirun. I solved it by using tnp = os.environ[“SLURM_TASKS_PER_NODE”].split(‘(‘)[0]. This removes everything beginning with “(“.
  2. Why does len(hostnames) have to be greater than sum(args.nodes)? Isn’t it okay if they are equal?

Hi,

Thanks for letting us know!

Updated the script to support the allocation syntax and fixed the hostname check. :+1:

Regards

Frédéric

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.