Skip to content

Commit ad346a1

Browse files
committed
Lots more updates, including two new FAQ sections.
Signed-off-by: Jeff Squyres <[email protected]>
1 parent fb3e6fd commit ad346a1

16 files changed

+2264
-421
lines changed

docs/developers.rst

Lines changed: 397 additions & 30 deletions
Large diffs are not rendered by default.

docs/examples.rst

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ are solely command-line manipulators, and have nothing to do with the
4141
actual compilation or linking of programs. The end result is an MPI
4242
executable that is properly linked to all the relevant libraries.
4343

44+
.. caution:: It is *absolutely not sufficient* to simply add ``-lmpi``
45+
to your link line and assume that you will obtain a valid
46+
Open MPI executable.
47+
4448
Customizing the behavior of the wrapper compilers is possible (e.g.,
4549
changing the compiler [not recommended] or specifying additional
46-
compiler/linker flags); see the Open MPI FAQ for more information.
50+
compiler/linker flags); see :doc:`this section of the Open MPI FAQ
51+
</faq/building-mpi-apps>` for more information.
4752

4853
Alternatively, Open MPI also installs ``pkg-config(1)`` configuration
4954
files under ``$libdir/pkgconfig``. If ``pkg-config`` is configured to find
@@ -57,22 +62,10 @@ performed like this:
5762
`pkg-config ompi-c --cflags --libs`
5863
shell$
5964
60-
Open MPI supplies multiple ``pkg-config(1)`` configuration files; one
61-
for each different wrapper compiler (language):
62-
63-
* ``ompi``: Synonym for ``ompi-c``; Open MPI applications using the C
64-
MPI bindings
65-
* ``ompi-c``: Open MPI applications using the C MPI bindings
66-
* ``ompi-cxx``: Open MPI applications using the C MPI bindings
67-
* ``ompi-fort``: Open MPI applications using the Fortran MPI bindings
68-
69-
The following ``pkg-config(1)`` configuration files *may* be installed,
70-
depending on which command line options were specified to Open MPI's
71-
configure script. They are not necessary for MPI applications, but
72-
may be used by applications that use Open MPI's lower layer support
73-
libraries.
74-
75-
* ``opal``: Open Portable Access Layer applications
65+
See :ref:`this FAQ item
66+
<faq-building-mpi-apps-wrapper-compiler-alternatives-label>` for more
67+
information on Open MPI's wrapper compilers and the use of
68+
``pkg-config``.
7669

7770

7871
Running Open MPI Applications

docs/faq/mpi-apps.rst renamed to docs/faq/building-mpi-apps.rst

Lines changed: 71 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Compiling MPI applications
2-
==========================
1+
Building MPI applications
2+
=========================
33

44
.. JMS How can I create a TOC just for this page here at the top?
55
@@ -44,6 +44,10 @@ Simply use the following instead:
4444
4545
shell$ mpicc my_mpi_application.c -o my_mpi_application
4646
47+
.. caution:: It is *absolutely not sufficient* to simply add ``-lmpi``
48+
to your link line and assume that you will obtain a valid
49+
Open MPI executable.
50+
4751
Note that Open MPI's wrapper compilers do not do any actual compiling
4852
or linking; all they do is manipulate the command line and add in all
4953
the relevant compiler / linker flags and then invoke the underlying
@@ -57,7 +61,7 @@ fault of the Open MPI wrapper compiler.
5761
Wait |mdash| what is ``mpifort``? Shouldn't I use ``mpif77`` and ``mpif90``?
5862
-----------------------------------------------------------------------------
5963

60-
``mpifort`` is a new name for the Fortran wrapper compiler that
64+
``mpifort`` is the new name for the Fortran wrapper compiler that
6165
debuted in Open MPI v1.7.
6266

6367
*It supports compiling all versions of Fortran*, and *utilizing all
@@ -68,27 +72,30 @@ mpi_f08``). There is no need to distinguish between "Fortran 77"
6872
worry about what dialect it is, nor which MPI Fortran interface it
6973
uses.
7074

71-
Other MPI implementations will also soon support a wrapper compiler
72-
named ``mpifort``, so hopefully we can move the whole world to this
73-
simpler wrapper compiler name, and eliminate the use of ``mpif77`` and
74-
``mpif90``.
75+
Other MPI implementations also support a wrapper compiler named
76+
``mpifort``; you do not lose any portability by using ``mpifort``.
77+
Please help us move the whole world to this simpler wrapper compiler
78+
name, and completely eliminate the use of ``mpif77`` and ``mpif90``.
7579

76-
.. important:: ``mpif77`` and ``mpif90`` are
77-
deprecated as of Open MPI v1.7.
80+
.. important:: ``mpif77`` and ``mpif90`` were deprecated back in Open
81+
MPI v1.7.
7882

79-
Although ``mpif77`` and ``mpif90`` still exist in Open MPI v1.7 for
80-
legacy reasons, they will likely be removed in some (undetermined)
81-
future release. It is in your interest to convert to ``mpifort`` now.
83+
.. warning:: Although ``mpif77`` and ``mpif90`` still exist in Open
84+
MPI for legacy reasons, they will likely be removed in
85+
some (undetermined) future release. It is in your
86+
interest to convert to ``mpifort`` now.
8287

83-
Also note that these names are literally just sym links to ``mpifort``
84-
under the covers. So you're using ``mpifort`` whether you realize it
85-
or not. :-)
88+
Also note that the ``mpif77`` and ``mpif90`` names are literally just
89+
symolic links to ``mpifort`` under the covers. Meaning: you're using
90+
``mpifort`` whether you realize it or not.
8691

8792
Basically, the 1980's called; they want their ``mpif77`` wrapper
8893
compiler back. *Let's let them have it.*
8994

9095
/////////////////////////////////////////////////////////////////////////
9196

97+
.. _faq-building-mpi-apps-wrapper-compiler-alternatives-label:
98+
9299
I can't / don't want to use Open MPI's wrapper compilers. What do I do?
93100
-----------------------------------------------------------------------
94101

@@ -106,12 +113,22 @@ Things are *much* better these days; wrapper compilers can handle
106113
almost any situation, and are far more reliable than you attempting to
107114
hard-code the Open MPI-specific compiler and linker flags manually.
108115

109-
That being said, there *are* some |mdash| very, very few |mdash| situations
110-
where using wrapper compilers can be problematic |mdash| such as nesting
111-
multiple wrapper compilers of multiple projects. Hence, Open MPI
112-
provides a workaround to find out what command line flags you need to
113-
compile MPI applications. There are generally two sets of flags that
114-
you need: compile flags and link flags.
116+
That being said, there *are* some situations |mdash| very, very few
117+
situations |mdash| where using wrapper compilers can be problematic
118+
|mdash| such as nesting multiple wrapper compilers of multiple
119+
projects. Hence, Open MPI provides a workaround to find out what
120+
command line flags you need to compile MPI applications. There are
121+
generally two sets of flags that you need: compile flags and link
122+
flags.
123+
124+
You can use one of two methods to dynamically discover what compiler /
125+
linker flags are necessary on your system:
126+
127+
#. Use the ``--showme`` flags to Open MPI's wrapper compilers, or
128+
#. Use the ``pkg-config(1)`` system.
129+
130+
Here's an example showing the use of the ``--showme`` wrapper compiler
131+
flags:
115132

116133
.. code-block:: sh
117134
:linenos:
@@ -126,16 +143,7 @@ The ``--showme:*`` flags work with all Open MPI wrapper compilers
126143
(specifically: ``mpicc``, ``mpiCC`` / ``mpicxx`` / ``mpic++``,
127144
``mpifort``, and if you really must use them, ``mpif77``, ``mpif90``).
128145

129-
Hence, if you need to use some compiler other than Open MPI's wrapper
130-
compilers, we advise you to run the appropriate Open MPI wrapper
131-
compiler with the ``--showme`` flags to see what Open MPI needs to
132-
compile / link, and then use those with your compiler.
133-
134-
.. caution:: It is *absolutely not sufficient* to simply add ``-lmpi``
135-
to your link line and assume that you will obtain a valid
136-
Open MPI executable.
137-
138-
.. caution:: It is almost never a good idea to hard-code these results
146+
.. warning:: It is almost never a good idea to hard-code these results
139147
in a Makefile (or other build system). It is almost
140148
always best to run (for example) ``mpicc
141149
--showme:compile`` in a dynamic fashion to find out what
@@ -151,8 +159,34 @@ compile / link, and then use those with your compiler.
151159
my_app: my_app.c
152160
$(CC) $(MPI_COMPILE_FLAGS) my_app.c $(MPI_LINK_FLAGS) -o my_app
153161
162+
And here's an example showing how to use ``pkg-config`` |mdash| you
163+
may need to add ``$prefix/lib/pkgconfig`` to the ``PKG_CONFIG_PATH``
164+
environment variable for Open MPI's config files to be found:
165+
166+
.. code-block:: sh
167+
:linenos:
168+
169+
# Show the flags necessary to compile MPI C applications
170+
shell$ export PKG_CONFIG_PATH=/opt/openmpi/lib/pkgconfig
171+
shell$ pkg-config ompi-c --cflags
172+
173+
# Show the flags necessary to link MPI C applications
174+
shell$ pkg-config ompi-c --libs
175+
176+
Open MPI supplies multiple ``pkg-config(1)`` configuration files; one
177+
for each different wrapper compiler (language):
178+
179+
* ``ompi``: Synonym for ``ompi-c``; Open MPI applications using the C
180+
MPI bindings
181+
* ``ompi-c``: Open MPI applications using the C MPI bindings
182+
* ``ompi-cxx``: Open MPI applications using the C MPI bindings
183+
* ``ompi-fort``: Open MPI applications using the Fortran MPI bindings
184+
185+
154186
/////////////////////////////////////////////////////////////////////////
155187

188+
.. _faq-building-mpi-apps-override-wrapper-flags-label:
189+
156190
How do I override the flags specified by Open MPI's wrapper compilers?
157191
----------------------------------------------------------------------
158192

@@ -170,6 +204,8 @@ to ``$prefix/share/openmpi/WRAPPER_NAME-wrapper-data.txt``. A
170204
few environment variables are available for run-time replacement of
171205
the wrapper's default values (from the text files):
172206

207+
.. note:: You may need to scroll right in the following table.
208+
173209
.. list-table::
174210
:header-rows: 1
175211

@@ -284,7 +320,7 @@ interesting for end-users:
284320

285321
/////////////////////////////////////////////////////////////////////////
286322

287-
.. _faq-mpi-apps-showme-label:
323+
.. _faq-building-mpi-apps-showme-label:
288324

289325
How can I tell what the wrapper compiler default flags are?
290326
-----------------------------------------------------------
@@ -438,7 +474,7 @@ Due to popular user request, Open MPI changed its policy starting with
438474
v1.7.4: by default on supported systems, Open MPI's wrapper compilers
439475
*do* insert ``-rpath`` (or similar) flags when linking MPI applications.
440476
You can see the exact flags added by the ``--showme`` functionality
441-
described in :ref:`this FAQ entry <faq-mpi-apps-showme-label>`.
477+
described in :ref:`this FAQ entry <faq-building-mpi-apps-showme-label>`.
442478

443479
This behavior can be disabled by configuring Open MPI with the
444480
``--disable-wrapper-rpath`` CLI option.
@@ -529,6 +565,6 @@ Starting with v4.0.0, Open MPI |mdash| by default |mdash| removes the
529565
prototypes for MPI symbols that were deprecated in 1996 and finally
530566
removed from the MPI standard in MPI-3.0 (2012).
531567

532-
:doc:`See this FAQ category </faq/mpi-removed>` for much more
533-
information, including how to easily update your MPI application
568+
:doc:`See this FAQ category </faq/removed-mpi-constructs>` for much
569+
more information, including how to easily update your MPI application
534570
to avoid these problems.

docs/faq/building.rst renamed to docs/faq/building-open-mpi.rst

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ What are the default build options for Open MPI?
4747
------------------------------------------------
4848

4949
If you have obtained a developer's checkout from Git,
50-
:doc:`you must consult these directions </developer>`.
50+
:doc:`you must consult these directions </developers>`.
5151

5252
The default options for building an Open MPI tarball are:
5353

@@ -87,12 +87,13 @@ Instead, you probably want to install your new version of Open MPI to
8787
another path, such as ``/opt/openmpi-version`` (or whatever is
8888
appropriate for your system).
8989

90-
The :ref:`where to install <faq-building-where-to-install-label>` FAQ
91-
question constans some suggestions on where to install Open MPI.
90+
The :ref:`where to install
91+
<faq-building-open-mpi-where-to-install-label>` FAQ question contains
92+
some suggestions on where to install Open MPI.
9293

9394
/////////////////////////////////////////////////////////////////////////
9495

95-
.. _faq-building-where-to-install-label:
96+
.. _faq-building-open-mpi-where-to-install-label:
9697

9798
Where should I install Open MPI?
9899
--------------------------------
@@ -179,8 +180,9 @@ There are two common approaches:
179180

180181
Two common options to avoid this extra filesystem traffic
181182
are to build Open MPI to not use plugins (see :ref:`this
182-
FAQ entry for detail <faq-building-avoid-dso-label>`) or
183-
to install Open MPI locally (see below).
183+
FAQ entry for detail
184+
<faq-building-open-mpi-avoid-dso-label>`) or to install
185+
Open MPI locally (see below).
184186

185187
#. If you are concerned with networked filesystem costs of accessing
186188
the Open MPI binaries, you can install Open MPI on the local hard
@@ -264,7 +266,7 @@ upgrading your Open MPI installation:
264266

265267
/////////////////////////////////////////////////////////////////////////
266268

267-
.. _faq-building-avoid-dso-label:
269+
.. _faq-building-open-mpi-avoid-dso-label:
268270

269271
Can I disable Open MPI's use of plugins?
270272
----------------------------------------
@@ -322,7 +324,7 @@ ways:
322324
built as standalone DSOs. However, Open MPI will still look for
323325
DSOs in the filesystem at run-time. Specifically: this option
324326
*significantly* decreases (but does not eliminate) filesystem
325-
traffic during ``MPI_INIT`, but does allow the flexibility of
327+
traffic during ``MPI_INIT``, but does allow the flexibility of
326328
adding new plugins to an existing Open MPI installation.
327329

328330
Note that the ``--disable-mca-dso`` option does not affect whether
@@ -474,7 +476,7 @@ Installation guide for more details.
474476

475477
/////////////////////////////////////////////////////////////////////////
476478

477-
.. _faq-building-sed-errors-label:
479+
.. _faq-building-open-mpi-sed-errors-label:
478480

479481
Configure issues warnings about sed and unterminated commands
480482
-------------------------------------------------------------
@@ -508,14 +510,14 @@ coming from (and eliminate it):
508510
509511
/////////////////////////////////////////////////////////////////////////
510512

511-
Open MPI configured ok, but I get "Makefile:602: *** missing separator" kinds of errors when building
512-
-----------------------------------------------------------------------------------------------------
513+
Open MPI configured ok, but I get ``Makefile:602: *** missing separator`` kinds of errors when building
514+
-------------------------------------------------------------------------------------------------------
513515

514516
This is *usually* an indication that ``configure`` succeeded but
515517
really shouldn't have.
516518

517-
:ref:`See this FAQ entry <faq-building-sed-errors-label>` for one
518-
possible cause.
519+
:ref:`See this FAQ entry <faq-building-open-mpi-sed-errors-label>` for
520+
one possible cause.
519521

520522
/////////////////////////////////////////////////////////////////////////
521523

@@ -866,8 +868,8 @@ that you want it to use:
866868
Note that you cannot configure with ``--disable-dlopen`` as that will
867869
break the ability of the Open MPI library to dynamically load ``libcuda.so``.
868870

869-
:doc:`See this FAQ entry </faq/cuda>`
870-
for detals on how to use the CUDA support.";
871+
:doc:`See this FAQ section </faq/cuda>` for detals on how to use the
872+
CUDA support.";
871873

872874
/////////////////////////////////////////////////////////////////////////
873875

@@ -1142,12 +1144,13 @@ There are a few different possible solutions to this issue:
11421144
11431145
Be sure to :ref:`see this section of the Installation guide
11441146
<install-misc-support-libraries-label>` and :ref:`this FAQ entry
1145-
<faq-building-intext-hwloc-libevent-label>` for more information about
1146-
the bundled hwloc and/or Libevent vs. system-installed versions.
1147+
<faq-building-open-mpi-intext-hwloc-libevent-label>` for more
1148+
information about the bundled hwloc and/or Libevent
1149+
vs. system-installed versions.
11471150

11481151
/////////////////////////////////////////////////////////////////////////
11491152

1150-
.. _faq-building-intext-hwloc-libevent-label:
1153+
.. _faq-building-open-mpi-intext-hwloc-libevent-label:
11511154

11521155
Should I use the bundled hwloc and Libevent, or system-installed versions?
11531156
--------------------------------------------------------------------------

docs/faq/contributing.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ There are many ways to contribute. Here are a few:
1515
#. Subscribe to `the mailing lists
1616
<https://www.open-mpi.org/community/lists/>`_ and become active in
1717
the discussions.
18-
#. Obtain `a source code checkout <https://www.open-mpi.org/source/>`_
19-
of Open MPI's code base and start looking through the code (be sure
20-
to see the :doc:`Developers guide </developers>`) for technical
21-
details about the code base).
18+
#. Obtain `a Git clone <https://www.open-mpi.org/source/>`_ of Open
19+
MPI's code base and start looking through the code.
20+
21+
* Be sure to see the :doc:`Developers guide </developers>` for
22+
technical details about the code base and how to build it).
23+
2224
#. Write your own components and contribute them back to the main code
2325
base.
2426
#. Contribute bug fixes and feature enhancements to the main code

docs/faq/general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ I want to redistribute Open MPI. Can I?
132132

133133
Absolutely.
134134

135-
*NOTE:* We are not lawyers and this is not legal advice.
135+
.. note:: We are not lawyers and this is not legal advice.
136136

137137
Please read the :doc:`Open MPI license </license>` (the BSD license).
138138
It contains extremely liberal provisions for redistribution.

docs/faq/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ that they are worth categorizing in an official way.
1717
contributing
1818
supported-systems
1919
sysadmin
20-
building
21-
mpi-apps
20+
building-open-mpi
21+
building-mpi-apps
22+
removed-mpi-constructs
23+
running-mpi-apps
2224
fault-tolerance
2325
tuning
24-
mpi-removed
26+
ofi

0 commit comments

Comments
 (0)