Skip to content

Commit 5860359

Browse files
committed
squashme add some more faq sections
Signed-off-by: Jeff Squyres <[email protected]>
1 parent f1ecd22 commit 5860359

File tree

6 files changed

+609
-3
lines changed

6 files changed

+609
-3
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
# Release is a sphinx config variable -- assign it to the computed
4242
# Open MPI version number.
43+
series = f"{ompi_data['major']}.{ompi_data['minor']}.x"
4344
release = f"{ompi_data['major']}.{ompi_data['minor']}.{ompi_data['release']}{ompi_data['greek']}"
4445

4546

@@ -80,5 +81,7 @@
8081
rst_prolog = f"""
8182
.. |mdash| unicode:: U+02014 .. Em dash
8283
.. |rarrow| unicode:: U+02192 .. Right arrow
84+
8385
.. |ompi_ver| replace:: {release}
86+
.. |ompi_series| replace:: {series}
8487
"""

docs/faq/building-open-mpi.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ There are two common approaches:
200200

201201
/////////////////////////////////////////////////////////////////////////
202202

203+
.. _faq-building-open-mpi-install-overwrite:
204+
203205
Should I install a new version of Open MPI over an old version?
204206
---------------------------------------------------------------
205207

docs/faq/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ that they are worth categorizing in an official way.
2424
fault-tolerance
2525
tuning
2626
ofi
27+
troubleshooting
28+
ssh
29+
slurm
2730

2831
.. TODO:
2932
30-
troubleshooting
3133
parallel debugging
32-
rsh/ssh
3334
PBS / Torque
34-
Slurm
3535
SGE
3636
Large Clusters
3737

docs/faq/slurm.rst

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
Running MPI jobs with Slurm
2+
===========================
3+
4+
.. JMS How can I create a TOC just for this page here at the top?
5+
6+
/////////////////////////////////////////////////////////////////////////
7+
8+
.. _faq-slurm-support-label:
9+
10+
Does Open MPI support running jobs under Slurm?
11+
-----------------------------------------------
12+
13+
Yes.
14+
15+
Open MPI supports two modes of launching parallel MPI jobs under
16+
Slurm:
17+
18+
#. Using ``mpirun``. Open MPI's ``mpirun`` will detect that it is
19+
inside of a Slurm job, and will automatically utilize the SLURM
20+
infrastructure for launching and controlling the individual MPI
21+
processes.
22+
23+
Using this method, you get the full power and extensive features of
24+
Open MPI's ``mpirun`` command (see the ``mpirun(1)`` man page for
25+
details).
26+
27+
#. Using ``srun``. Assuming that Slurm installed its Open MPI plugin,
28+
you can use ``srun`` to "direct launch" Open MPI applications
29+
without the use of Open MPI's ``mpirun`` command.
30+
31+
Using direct launch can be *slightly* faster when launching very,
32+
very large MPI processes (i.e., thousands or millions of MPI
33+
processes in a single job). But it has significantly fewer
34+
features than Open MPI's ``mpirun``.
35+
36+
.. note:: In versions of Open MPI prior to |ompi_series|, using
37+
``srun`` for direct launch was faster than using
38+
``mpirun``. **This is no longer true.**
39+
40+
Unless there is a strong reason to use ``srun`` for direct launch, the
41+
Open MPI team recommends using ``mpirun`` for launching under Slurm jobs.
42+
43+
/////////////////////////////////////////////////////////////////////////
44+
45+
How do I run use ``mpirun`` to launch jobs under Slurm?
46+
-------------------------------------------------------
47+
48+
Pretty much exactly as you would if you were not in a Slurm job.
49+
50+
For example, you can launch Open MPI's ``mpirun`` in an interactive
51+
Slurm allocation (via the ``salloc`` command) or you can submit a
52+
script to Slurm (via the ``sbatch`` command) that includes an
53+
invocation of the ``mpirun`` command.
54+
55+
Regardless of how ``mpirun`` is invoked, if it detects that it is
56+
running in a Slurm job, ``mpirun`` automatically obtains both the list
57+
of hosts and how many processes to start on each host from Slurm
58+
directly. Hence, it is unnecessary to specify the ``--hostfile``,
59+
``--host``, or ``-np`` options to ``mpirun``. Open MPI will also use
60+
Slurm-native mechanisms to launch and kill processes --
61+
``ssh`` is not required.
62+
63+
For example:
64+
65+
.. code-block:: sh
66+
:linenos:
67+
68+
# Allocate a Slurm job with 4 nodes
69+
shell$ salloc -N 4
70+
# Now run an Open MPI job on all the nodes allocated by Slurm
71+
shell$ mpirun my_mpi_application
72+
73+
This will run the 4 MPI processes on the nodes that were allocated by
74+
Slurm.
75+
76+
Or, if submitting a script:
77+
78+
.. code-block:: sh
79+
:linenos:
80+
81+
shell$ cat my_script.sh
82+
#!/bin/sh
83+
mpirun my_mpi_application
84+
shell$ sbatch -N 4 my_script.sh
85+
srun: jobid 1234 submitted
86+
shell$
87+
88+
Similar to the ``salloc`` case, no command line options specifing
89+
number of MPI processes were necessary, since Open MPI will obtain
90+
that information directly from Slurm at run time.
91+
92+
/////////////////////////////////////////////////////////////////////////
93+
94+
How do I use ``srun`` to directly launch Open MPI applications?
95+
---------------------------------------------------------------
96+
97+
.. note:: Per :ref:`this FAQ entry <faq-slurm-support-label>`, the
98+
Open MPI team generally recommends using ``mpirun`` for
99+
launching MPI jobs.
100+
101+
First, you must ensure that Slurm was built and installed with PMI-2
102+
support.
103+
104+
.. note:: Please ask your friendly neighborhood Slurm developer to
105+
support PMIx. PMIx is the current generation of run-time
106+
support API; PMI-2 is the legacy / antiquated API. Open MPI
107+
*only* supports PMI-2 for SLURM. :-)
108+
109+
Yes, if you have configured OMPI ``--with-pmi=foo``, where ``foo`` is
110+
the path to the directory where ``pmi2.h`` is located.
111+
112+
.. error:: JMS Ralph -- what else do we need to say here?
113+
114+
Open MPI applications can then be launched directly via the ``srun``
115+
command. For example:
116+
117+
.. code-block:: sh
118+
:linenos:
119+
120+
shell$ srun -N 4 my_mpi_application
121+
122+
Or you can use ``sbatch`` with a script:
123+
124+
.. code-block:: sh
125+
:linenos:
126+
127+
shell$ cat my_script.sh
128+
#!/bin/sh
129+
srun my_mpi_application
130+
shell$ sbatch -N 4 my_script.sh
131+
srun: jobid 1235 submitted
132+
shell$
133+
134+
Similar using ``mpirun`` inside of an ``sbatch`` batch script, no
135+
``srun`` command line options specifing number of processes were
136+
necessary, because ``sbatch`` set all the relevant Slurm-level
137+
parameters about number of processes, cores, partition, etc.
138+
139+
/////////////////////////////////////////////////////////////////////////
140+
141+
I use Slurm on a cluster with the OpenFabrics or UCX network stacks. Do I need to do anything special?
142+
-------------------------------------------------------------------------------------------------------
143+
144+
Yes.
145+
146+
You need to ensure that Slurm sets up the locked memory
147+
limits properly.
148+
149+
.. error:: JMS Need to point to general web pages about setting locked
150+
memory limits.
151+
152+
They used to be at
153+
``category=openfabrics#ib-locked-pages`` and
154+
``category=openfabrics#ib-locked-pages-more``.
155+
156+
This should probably be in a general networking section --
157+
not specific to verbs/openib.
158+
159+
/////////////////////////////////////////////////////////////////////////
160+
161+
My job fails / performs poorly when using mpirun under Slurm 20.11
162+
------------------------------------------------------------------
163+
164+
There were some changes in Slurm behavior that were introduced in
165+
Slurm 20.11.0 and subsequently reverted out in Slurm 20.11.3.
166+
167+
SchedMD (the makers of Slurm) strongly suggest that all Open MPI users
168+
avoid using Slurm versions 20.11.0 through 20.11.2.
169+
170+
Indeed, you will likely run into problems using just about any version
171+
of Open MPI these problematic Slurm releases.
172+
173+
.. important:: Please either downgrade to an older version or upgrade
174+
to a newer version of Slurm.

0 commit comments

Comments
 (0)