Thanks! I admit I'm not that experienced in Bash. I will give this a whirl
as a test.

In the meantime, let ask, what is the "canonical" way to create the host
list? It would be nice to have this in the Slurm FAQ somewhere.

Thanks!

Jeff



On Fri, Aug 9, 2024 at 1:32 PM Hermann Schwärzler via slurm-users <
slurm-users@lists.schedmd.com> wrote:

> Hi Paul,
>
> On 8/9/24 18:45, Paul Edmon via slurm-users wrote:
> > As I recall I think OpenMPI needs a list that has an entry on each line,
> > rather than one seperated by a space. See:
> >
> > [root@holy7c26401 ~]# echo $SLURM_JOB_NODELIST
> > holy7c[26401-26405]
> > [root@holy7c26401 ~]# scontrol show hostnames $SLURM_JOB_NODELIST
> > holy7c26401
> > holy7c26402
> > holy7c26403
> > holy7c26404
> > holy7c26405
> >
> > [root@holy7c26401 ~]# list=$(scontrol show hostname $SLURM_NODELIST)
> > [root@holy7c26401 ~]# echo $list
> > holy7c26401 holy7c26402 holy7c26403 holy7c26404 holy7c26405
>
> proper quoting does wonders here (please consult the man-page of bash).
> If you try
>
> echo "$list"
>
> you will see that you will get
>
> holy7c26401
> holy7c26402
> holy7c26403
> holy7c26404
> holy7c26405
>
> So you *can* pass this around in a variable if you use "$variable"
> whenever you provide it to a utility.
>
> Regards,
> Hermann
>
> --
> slurm-users mailing list -- slurm-users@lists.schedmd.com
> To unsubscribe send an email to slurm-users-le...@lists.schedmd.com
>
-- 
slurm-users mailing list -- slurm-users@lists.schedmd.com
To unsubscribe send an email to slurm-users-le...@lists.schedmd.com

Reply via email to