Skip to content

Commit

Permalink
Merge pull request #2894 from brandonbiggs/develop
Browse files Browse the repository at this point in the history
[feat] Support for `pdsh` and `clush` parallel launchers
  • Loading branch information
vkarak committed Jun 12, 2023
2 parents f49b0ec + 9d903c8 commit a128328
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ System Partition Configuration
Available values are the following:

- ``alps``: Parallel programs will be launched using the `Cray ALPS <https://pubs.cray.com/content/S-2393/CLE%205.2.UP03/cle-xc-system-administration-guide-s-2393-5203-xc/the-aprun-client>`__ ``aprun`` command.
- ``clush``: Parallel programs will be launched using the `ClusterShell <http://clustershell.readthedocs.org/>`__ ``clush`` command. This launcher uses the partition's :attr:`~config.systems.partitions.access` property in order to determine the options to be passed to ``clush``.
- ``ibrun``: Parallel programs will be launched using the ``ibrun`` command.
This is a custom parallel program launcher used at `TACC <https://portal.tacc.utexas.edu/user-guides/stampede2>`__.
- ``local``: No parallel program launcher will be used.
Expand All @@ -406,6 +407,7 @@ System Partition Configuration
- ``lrun-gpu``: Parallel programs will be launched using `LC Launcher <https://hpc.llnl.gov/training/tutorials/using-lcs-sierra-system#lrun>`__'s ``lrun -M "-gpu"`` command that enables the CUDA-aware Spectrum MPI.
- ``mpirun``: Parallel programs will be launched using the ``mpirun`` command.
- ``mpiexec``: Parallel programs will be launched using the ``mpiexec`` command.
- ``pdsh``: Parallel programs will be launched using the ``pdsh`` command. This launcher uses the partition's :attr:`~config.systems.partitions.access` property in order to determine the options to be passed to ``pdsh``.
- ``srun``: Parallel programs will be launched using `Slurm <https://slurm.schedmd.com/srun.html>`__'s ``srun`` command.
- ``srunalloc``: Parallel programs will be launched using `Slurm <https://slurm.schedmd.com/srun.html>`__'s ``srun`` command, but job allocation options will also be emitted.
This can be useful when combined with the ``local`` job scheduler.
Expand Down
2 changes: 1 addition & 1 deletion docs/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Environments Configuration
We have seen already environments to be referred to by the ``environs`` property of a partition.
An environment in ReFrame is simply a collection of environment modules, environment variables and compiler and compiler flags definitions.
None of these attributes is required.
An environment can simply by empty, in which case it refers to the actual environment that ReFrame runs in.
An environment can simply be empty, in which case it refers to the actual environment that ReFrame runs in.
In fact, this is what the generic fallback configuration of ReFrame does.

Environments in ReFrame are configured under the ``environments`` section of the documentation.
Expand Down
2 changes: 1 addition & 1 deletion reframe/core/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
_launcher_backend_modules = [
'reframe.core.launchers.local',
'reframe.core.launchers.mpi',
'reframe.core.launchers.ssh'
'reframe.core.launchers.rsh'
]
_launchers = {}
_scheduler_backend_modules = [
Expand Down
14 changes: 14 additions & 0 deletions reframe/core/launchers/ssh.py → reframe/core/launchers/rsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
from reframe.core.backends import register_launcher
from reframe.core.launchers import JobLauncher

# Remote shell launchers


@register_launcher('clush')
class ClushLauncher(JobLauncher):
def command(self, job):
return ['clush', *job.sched_access]


@register_launcher('pdsh')
class PdshLauncher(JobLauncher):
def command(self, job):
return ['pdsh', *job.sched_access]


@register_launcher('ssh')
class SSHLauncher(JobLauncher):
Expand Down
16 changes: 13 additions & 3 deletions unittests/test_launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(params=[
'alps', 'launcherwrapper', 'local', 'mpiexec', 'mpirun',
'alps', 'clush', 'launcherwrapper', 'local', 'mpiexec', 'mpirun', 'pdsh',
'srun', 'srunalloc', 'ssh', 'upcrun', 'upcxx-run', 'lrun', 'lrun-gpu'
])
def launcher(request):
Expand Down Expand Up @@ -66,8 +66,11 @@ def _make_job(launcher, *args, **kwargs):

@pytest.fixture()
def job(make_job, launcher):
if type(launcher).registered_name == 'ssh':
launcher_name = type(launcher).registered_name
if launcher_name == 'ssh':
access = ['-l user', '-p 22222', 'host']
elif launcher_name in ('clush', 'pdsh'):
access = ['-w', 'hostA', '-x', 'hostB']
else:
access = None

Expand All @@ -92,8 +95,11 @@ def job(make_job, launcher):

@pytest.fixture
def minimal_job(make_job, launcher):
if type(launcher).registered_name == 'ssh':
launcher_name = type(launcher).registered_name
if launcher_name == 'ssh':
access = ['host']
elif launcher_name in ('clush', 'pdsh'):
access = ['-w', 'host']
else:
access = None

Expand Down Expand Up @@ -138,6 +144,8 @@ def test_run_command(job):
'--foo')
elif launcher_name == 'ssh':
assert command == 'ssh -o BatchMode=yes -l user -p 22222 --foo host'
elif launcher_name in ('clush', 'pdsh'):
assert command == f'{launcher_name} -w hostA -x hostB --foo'
elif launcher_name == 'upcrun':
assert command == 'upcrun -N 2 -n 4 --foo'
elif launcher_name == 'upcxx-run':
Expand Down Expand Up @@ -175,6 +183,8 @@ def test_run_command_minimal(minimal_job):
'--foo')
elif launcher_name == 'ssh':
assert command == 'ssh -o BatchMode=yes --foo host'
elif launcher_name in ('clush', 'pdsh'):
assert command == f'{launcher_name} -w host --foo'
elif launcher_name == 'upcrun':
assert command == 'upcrun -n 1 --foo'
elif launcher_name == 'upcxx-run':
Expand Down

0 comments on commit a128328

Please sign in to comment.