Skip to content

Commit 161f054

Browse files
committed
A variety of docs updates:
* Typo fixes * Add :ref: links to man pages (mostly `mpirun` and `ompi_info`) * Add notes for contributors about PR'ing to `main` first and then cherry-picking to release branches later. Thanks to @jolivain suggesting that we add this policy to the docs. * Include contributor suggestion to submit fixes to the docs. * Renamed Developers -> Git to "GitHub, Git, and related topics". Added info about: * Git commits and a reference to the contributors declaration (in contributors.rst) * Branching scheme * Details about PR to main first and cherry-picking to release branches * A few words about Github PR CI / MTT * Added information about running Sphinx, and how to view the Sphinx docs locally * Added notes about how to view man pages locally * Added a placeholder oshrun.1 man page (it just refers to mpirun.1) * Per #10772 (comment), discuss PMIx and PRRTE MCA * Mention Perl and Python as tools required by Open MPI developers * Expanded on some "advice for packagers" from the "required support dependencies" section, and moved it to its own section: * Don't use Open MPI's bundled sub-packages (Libevent, Hwloc, PMIx, PRTE) * Discussion of components: included in project libraries vs. DSOs * Add short "prerequisites" section for running MPI apps Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent ee324be commit 161f054

26 files changed

+739
-160
lines changed

docs/building-apps/building-static-apps.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _label-building-fully-static-apps:
2+
13
Building fully-static MPI applications
24
======================================
35

docs/building-apps/extracting-wrapper-flags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ that will show what commands would have been invoked.
2323
shell$ mpicc --showme
2424
2525
.. note:: If you pass ``--showme`` *and additional command line
26-
parameters* to the wrapper compiler, sure to *also* pass in a
26+
parameters* to the wrapper compiler, be sure to *also* pass in a
2727
filename. Otherwise, the ``--showme`` functionality will not
2828
display output as expected.
2929

docs/building-apps/quickstart.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ probably work in many environments.
1717
Open MPI provides "wrapper" compilers that should be used for
1818
compiling MPI and OpenSHMEM applications:
1919

20-
+---------+--------------------------+
21-
| C | ``mpicc``, ``oshcc`` |
22-
+---------+--------------------------+
23-
| C++ | ``mpiCC``, ``oshCC`` (or |
24-
| | ``mpic++`` if your |
25-
| | filesystem is |
26-
| | case-insensitive) |
27-
+---------+--------------------------+
28-
| Fortran | ``mpifort``, ``oshfort`` |
29-
+---------+--------------------------+
20+
+---------+-----------------------------------+
21+
| C | :ref:`mpicc(1) <man1-mpicc>`, |
22+
| | :ref:`oshcc(1) <man1-oshcc>` |
23+
+---------+-----------------------------------+
24+
| C++ | :ref:`mpic++(1) <man1-mpic++>`, |
25+
| | :ref:`oshc++(1) <man1-oshc++>` |
26+
| | (and :ref:`mpiCC(1) <man1-mpiCC>` |
27+
| | and :ref:`oshCC(1) <man1-oshCC>` |
28+
| | if you filesystem is |
29+
| | case-sensitive) |
30+
+---------+-----------------------------------+
31+
| Fortran | :ref:`mpifort(1) <man1-mpifort>`, |
32+
| | :ref:`oshfort(1) <man1-oshfort>` |
33+
+---------+-----------------------------------+
3034

3135
.. caution:: The legacy names ``mpif77`` and ``mpif90`` still exist,
3236
and are simply symbolic links to the ``mpifort`` wrapper

docs/contributing.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ There are many ways to contribute. Here are a few:
2525
#. Submit bug fixes to the main code base.
2626

2727
* Awesome! Open a new GitHub pull request with the patch.
28+
29+
* Please submit bug fixes / new features on the ``main`` branch
30+
first, and then port them to the relevant release branch(es)
31+
after they have been accepted on ``main``. :ref:`See this
32+
section for more information <git-github-branch-scheme-label>`.
33+
2834
* Ensure the PR description clearly describes the problem and
2935
solution. If there is an existing GitHub issue open describing
3036
this bug, please include it in the description so we can track
@@ -50,6 +56,18 @@ There are many ways to contribute. Here are a few:
5056
* Be sure to see the :ref:`Open source contributions
5157
<contributing-open-source-label>` section, below.
5258

59+
#. Submit fixes and/or entirely new content to this documentation.
60+
61+
* Docs are great! We always need help with documentation.
62+
* These docs are authored using ReStructured Text markup with the
63+
Sphinx rendering tool under the ``docs/`` directory in the
64+
repository. This means you can submit a pull request with your
65+
docs updates, just like you would for any Open MPI code contribution.
66+
* :ref:`See this section <developers-installing-sphinx-label>` and
67+
:ref:`also this section <developers-rst-for-markdown-expats>` for
68+
information about how to install Sphinx locally and some
69+
high-level logistical instructions on how to write these docs.
70+
5371
#. Provide testing resources:
5472

5573
#. For Github Pull Request Continuous Integration (CI)

docs/developers/git-clone.rst

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/developers/git-github.rst

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
GitHub, Git, and related topics
2+
===============================
3+
4+
GitHub
5+
------
6+
7+
Open MPI's Git repositories are `hosted at GitHub
8+
<https://github.com/open-mpi/ompi>`_.
9+
10+
#. First, you will need a Git client. We recommend getting the latest
11+
version available. If you do not have the command ``git`` in your
12+
path, you will likely need to download and install Git.
13+
#. `ompi <https://github.com/open-mpi/ompi/>`_ is the main Open MPI
14+
repository where most active development is done. Git clone this
15+
repository. Note that the use of the ``--recursive`` CLI option is
16+
necessary because Open MPI uses Git submodules::
17+
18+
shell$ git clone --recursive https://github.com/open-mpi/ompi.git
19+
20+
Note that Git is natively capable of using many forms of web
21+
proxies. If your network setup requires the user of a web proxy,
22+
`consult the Git documentation for more details
23+
<https://git-scm.com/>`_.
24+
25+
Git commits: open source / contributor's declaration
26+
----------------------------------------------------
27+
28+
In order to remain open source, all new commits to the Open MPI
29+
repository must include a ``Signed-off-by:`` line, indicating the
30+
submitter's agreement to the :ref:`Open MPI Contributor's Declaration
31+
<contributing-contributors-declaration-label>`.
32+
33+
.. tip:: You can use the ``-s`` option to ``git commit`` to
34+
automatically add the ``Signed-off-by:`` line to your commit
35+
message.
36+
37+
.. _git-github-branch-scheme-label:
38+
39+
Git branch scheme
40+
-----------------
41+
42+
Generally, Open MPI has two types of branches in its Git repository:
43+
44+
#. ``main``:
45+
46+
* All active development occurs on the ``main`` branch (new features,
47+
bug fixes, etc.).
48+
49+
#. Release branches of the form ``vMAJOR.MINOR.x`` (e.g., ``v4.0.x``,
50+
``v4.1.x``, ``v5.0.x``).
51+
52+
* The ``.x`` suffix indicates that this branch is used to create
53+
all releases in the Open MPI vMAJOR.MINOR series.
54+
* Periodically, the Open MPI community will make a new release
55+
branch, typically from ``main``.
56+
* A Git tag of the form ``vMAJOR.MINOR.RELEASE`` is used to
57+
indicate the specific commit on a release branch from where
58+
official Open MPI release tarball was created (e.g., ``v4.1.0``,
59+
``v4.1.1``, ``v4.1.2``, etc.).
60+
61+
Once a bug is fixed or a new feature is implemented on ``main``, it is
62+
cherry-picked over to the relevant release branch(es).
63+
64+
.. attention:: It may seem odd to some, but the Open MPI community
65+
development model does *not* PR bug fixes or new
66+
features directly to release branches. Instead,
67+
initial bug-fix / feature PRs are generally first made
68+
to ``main``.
69+
70+
This helps us ensure that future releases (with
71+
``main`` as a Git ancestor) will contain the bug fix /
72+
feature.
73+
74+
For example:
75+
76+
.. code:: sh
77+
78+
shell$ git checkout main
79+
shell$ git pull --rebase
80+
shell$ git checkout pr/bug-fix
81+
82+
# ... make changes / fix a bug / etc. ...
83+
84+
shell$ git add ...
85+
shell$ git commit -s ...
86+
shell$ git push myfork
87+
88+
At this point, you go create a PR from your fork's ``pr/bug-fix``
89+
branch to the Open MPI community GitHub repo ``main`` branch. Work
90+
with the community to get the PR completed and merged. Then you can
91+
open a new PR to cherry pick the Git commits from that bug fix to each
92+
of the relevant release branches.
93+
94+
Depending on how far the release branch has diverged from ``main``,
95+
there may be some porting effort involved in the cherry-pick.
96+
97+
For example, if your bug fix on ``main`` is comprised of a single Git
98+
commit hash ``123abc``:
99+
100+
.. code:: sh
101+
102+
# Fetch all upstream git activity, including the merge of the "main" PR.
103+
shell$ get fetch --all
104+
105+
# Check out the target release branch, and advance to the most recent commit.
106+
shell$ git checkout v5.0.x
107+
shell$ git pull --rebase
108+
109+
# Make a branch for your bug fix
110+
shell$ git checkout -b pr/v5.0.x/bug-fix
111+
# Cherry pick the commit from the "main" branch
112+
shell$ git cherry-pick -x 123abc
113+
# Push to your fork
114+
shell$ git push myfork
115+
116+
The Open MPI development community *requires* adding the following
117+
line to the commit message of cherry-picked commits on release
118+
branches:
119+
120+
.. code:: text
121+
122+
(cherry picked from commit [git_hash_of_original_commit])
123+
124+
.. note:: Note the use of the ``-x`` option to ``git cherry-pick``.
125+
This option automatically adds the ``(cherry picked from
126+
...)`` line to your commit message.
127+
128+
.. admonition:: Rationale
129+
:class: tip
130+
131+
Git does not actually store any meta data about Git cherry-picks in
132+
the commit. Having a standardized text line containing the source
133+
Git commit hash in the commit messages helps the Open MPI
134+
development community track where commits came from on release
135+
branches, and therefore allows us to check whether all relevant
136+
commits have been ported to a given release branch.
137+
138+
Once your commits are ready and pushed up to your fork, make a PR to
139+
the target release branch.
140+
141+
.. warning:: A GitHub PR CI job checks all commits on release branches
142+
for the ``(cherry picked from...)`` line. It will also
143+
ensure that the Git hash cited in that line actually
144+
exists on the ``main`` branch.
145+
146+
This check ensures that commits are not made to release
147+
branches before their corresponding ``main`` PR was
148+
merged.
149+
150+
All this being said, sometimes there is a need for a non-cherry-picked
151+
commit on a release branch. E.g., sometimes a release branch has
152+
diverged so much that the bug no longer exists on ``main``. It would
153+
therefore not make sense |mdash| or even be impossible |mdash| to
154+
commit the bug fix in question to ``main``.
155+
156+
In such cases, make a regular PR to the target branch (with commits
157+
that do *not* include ``(cherry picked from ...)`` lines). In the PR
158+
description, add a line with the following token:
159+
160+
.. code:: text
161+
162+
bot:notacherrypick
163+
164+
This tells the GitHub CI job that this PR contains commits that are
165+
not cherry-picked from ``main``.
166+
167+
.. warning:: ``bot:notacherrypick`` should only be used when
168+
absolutely necessary. It is not a license to avoid
169+
the process of PR'ing to ``main`` first.
170+
171+
CI (testing)
172+
------------
173+
174+
The Open MPI community generally runs two flavors of testing:
175+
176+
#. A bunch of tests on each PR (Continuous Integration / CI). These
177+
tests are a mixture of GitHub Actions and other CI systems (e.g.,
178+
Jenkins). Examples include (but are not limited to):
179+
180+
* Check each Git commit for bozo email addresses
181+
* Check that each Git commit contains a ``Signed-off-by`` line
182+
* Check that commits on release branches contain a cherry-pick
183+
notice
184+
* Build and publish the docs
185+
* Build Open MPI in a variety of environments and run sanity tests
186+
with that installation
187+
188+
#. Daily testing via the MPI Testing Tool (MTT).
189+
190+
* These are generally tests that take much longer to run than on a
191+
per-PR basis. `A "nightly snapshot" tarball
192+
<https://www.open-mpi.org/nightly/>`_ is created for ``main`` and
193+
each relevant release branch.
194+
* MTT tests are run with this snapshot tarball so that all
195+
organizations are testing with the same snapshots.
196+
* `Results are available here <https://mtt.open-mpi.org/>`_.

docs/developers/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ probably don't need to read this section.
1212
:maxdepth: 1
1313

1414
prerequisites
15-
git-clone
15+
git-github
1616
compiler-pickyness
1717
autogen
1818
building-open-mpi

docs/developers/prerequisites.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ build them manually, see the :ref:`how to build and install GNU
4747
Autotools section <developers-installing-autotools-label>` for much
4848
more detail.
4949

50+
Perl
51+
----
52+
53+
Open MPI still uses Perl for a few of its build scripts (most notably,
54+
``autogen.pl``).
55+
56+
Generally speaking, any recent-ish release of Perl 5 should be
57+
sufficient to correctly execute Open MPI's Perl scripts.
5058

5159
Flex
5260
----
@@ -80,12 +88,12 @@ MacPorts on MacOS), see `the Flex Github repository
8088
<https://github.com/westes/flex>`_.
8189

8290

83-
Sphinx
84-
------
91+
Sphinx (and therefore Python)
92+
-----------------------------
8593

86-
`Sphinx <https://www.sphinx-doc.org/>`_ is used to generate both the
87-
HTML version of the documentation (that you are reading right now) and
88-
the nroff man pages.
94+
`Sphinx <https://www.sphinx-doc.org/>`_ is a Python-based tool used to
95+
generate both the HTML version of the documentation (that you are
96+
reading right now) and the nroff man pages.
8997

9098
Official Open MPI distribution tarballs contain pre-built HTML
9199
documentation and man pages. This means that -- similar to the GNU

docs/developers/source-code.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,23 @@ C / C++
7979
* In Open MPI, we **always** ``#define`` a logical macro to be
8080
either 0 or 1 -- we never ``#undef`` it.
8181
* The reason for this is defensive programming: if you are only
82-
checking if a preprocessor macro is defined (via ``#ifdef`` or
83-
``"#if`` defined(FOO)"), you will get no warning when compiling if
82+
checking if a preprocessor macro is defined (via ``#ifdef FOO`` or
83+
``#if defined(FOO)``), you will get no warning when compiling if
8484
you accidentally misspell the macro name. However, if you use the
8585
logic test ``#if FOO`` with an undefined macro (e.g., because you
8686
misspelled it), you'll get a compiler warning or error.
87-
Misspelled macro names can be tremendously difficult to find when
88-
they are buried in thousands of lines of code, so we will take all
89-
the help from the preprocessor/compiler that we can get!
87+
88+
.. admonition:: Rationale
89+
:class: tip
90+
91+
Misspelled macro names can be tremendously difficult to find
92+
when they are buried in thousands of lines of code; we will
93+
take all the help from the preprocessor/compiler that we can
94+
get!
9095

9196
.. code-block:: c
9297
93-
/* Gnu Way - you will get no warning from the compiler if you
98+
/* GNU Way - you will get no warning from the compiler if you
9499
misspell "FOO"; the test will simply be false */
95100
#ifdef FOO
96101
...

0 commit comments

Comments
 (0)