You can also look into the pdsh/dshbak perl scripts that are available from epel for the logic to do it.

But it was a great surprise to me to see it implemented here.
Nicely done.

Michel Bourget wrote:
On 02/01/2012 01:08 PM, jmkatc...@gmail.com wrote:
There's also the very useful Python hostlist package for translating
from this format and back to it.


I wished I had known about the "scontrol show hostnames ... ", a couple of months ago, cause I wrote a 50 lines awk script to accomplish all of that. Didn't do the reverse.

On Wed, Feb 1, 2012 at 9:11 AM, Sergey Linev<s.li...@gsi.de>  wrote:
Thanks for the good tip!


On 01.02.2012 17:28, Moe Jette wrote:
The scontrol command has options to translate:

$ scontrol show hostlist tux1,tux3,tux4
tux[1,3-4]
$ scontrol show hostnames tux[1,3-4]
tux1
tux3
tux4


Quoting Sergey Linev<s.li...@gsi.de>:

Hi,

When running batch job, two variables defines number and list of
nodes, where job should be run: SLURM_JOB_NUM_NODES and
SLURM_JOB_NODELIST.

Is there easy way (shell command) to extract node name for every node,
listed in SLURM_JOB_NODELIST?

With best regards,
Sergey

--

Dr. Sergey Linev,
GSI Helmholtzzentrum für Schwerionenforschung GmbH






Reply via email to