[slurm-users] Execute parallel commands on all nodes running jobs of a particular user

172 views
Skip to first unread message

Ole Holm Nielsen

unread,
Jul 19, 2018, 4:48:33 AM7/19/18
to slurm...@lists.schedmd.com
Hi Slurm users,

We have found the need to execute a parallel command on all nodes
running jobs belonging to a particular user.

I have made a configuration to the excellent ClusterShell tool as
documented in https://wiki.fysik.dtu.dk/niflheim/SLURM#clustershell

If you add a "slurmuser" section to the
/etc/clustershell/groups.conf.d/slurm.conf file, you can now run
commands such as:

$ clush -bw@su:username 'df -Ph /scratch'

$ clush -bw@su:username 'du -s /scratch/username'

I hope that others may find this feature useful.

/Ole

Bjørn-Helge Mevik

unread,
Aug 6, 2018, 6:53:41 AM8/6/18
to slurm...@schedmd.com
There is also a Slurm plugin for pdsh (unfortunately not enabled in the
default redhat/centos RPMs) that lets you run a command on each node
belonging to a specific job with "pdsh -j <jobid> <command>". Not
exactly the same, though. :)

--
Regards,
Bjørn-Helge Mevik, dr. scient,
Department for Research Computing, University of Oslo
signature.asc

Ole Holm Nielsen

unread,
Aug 7, 2018, 3:32:19 PM8/7/18
to slurm...@lists.schedmd.com
On 06-08-2018 12:53, Bjørn-Helge Mevik wrote:
> There is also a Slurm plugin for pdsh (unfortunately not enabled in the
> default redhat/centos RPMs) that lets you run a command on each node
> belonging to a specific job with "pdsh -j <jobid> <command>". Not
> exactly the same, though. :)

Bjørn, that is a different task. I've documented pdsh usage with Slurm
in my Wiki page
https://wiki.fysik.dtu.dk/niflheim/SLURM#pdsh-parallel-distributed-shell.
However, I find it easier to work with ClusterShell, see
https://wiki.fysik.dtu.dk/niflheim/SLURM#clustershell.

The functionality I proposed on this list is to run a command on *all*
nodes belonging to *all* jobs of a particular user:

> If you add a "slurmuser" section to the /etc/clustershell/groups.conf.d/slurm.conf file, you can now run commands such as:
>
> $ clush -bw@su:username 'df -Ph /scratch'
>
> $ clush -bw@su:username 'du -s /scratch/username'

This functionality will be available in the next release 1.8.1 of
ClusterShell.

/Ole

Bjørn-Helge Mevik

unread,
Aug 8, 2018, 3:22:47 AM8/8/18
to slurm...@schedmd.com
Ole Holm Nielsen <Ole.H....@fysik.dtu.dk> writes:

> Bjørn, that is a different task.

I know, but related. Just meant as a tip for people who already use
pdsh.
signature.asc
Reply all
Reply to author
Forward
0 new messages