Skip to content

Commit b660590

Browse files
committed
docs: Render C/F90/F08 bindings in man pages
Use the pympistandard Python module and associated MPI-4.1 MPI Standard JSON definition file to generate bindings -- regular and embiggened -- in the MPI man pages. In the generation code, had to handle a variety of cases: * When there is no C binding * When there is no mpif.h / use mpi binding * When there is no use mpi_f08 binding * When there are embiggened C and/or F08 bindings * When a single man page includes documentation for multiple MPI APIs * When we do not have man pages for MPI APIs described in the official MPI Forum API JSON Also, this commit adds a new submodule: the pympistandard Python module from the MPI Forum repository. Some other cleanups were also necessary as part of this commit: * Add some missing man pages * Fix some random RST formatting errors in existing man pages Signed-off-by: Jeff Squyres <[email protected]>
1 parent 08ac1be commit b660590

File tree

448 files changed

+60401
-15821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

448 files changed

+60401
-15821
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ docs/_build
516516
docs/_static
517517
docs/_static/css/custom.css
518518
docs/_templates
519+
docs/man-openmpi/man3/bindings/*.rst
519520

520521
# Common Python virtual environment and cache directory names
521522
venv

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
[submodule "oac"]
1010
path = config/oac
1111
url = ../../open-mpi/oac
12+
[submodule "3rd-party/pympistandard"]
13+
path = 3rd-party/pympistandard
14+
url = ../../mpi-forum/pympistandard

.readthedocs-pre-create-environment.sh

+3
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ PRRTE_RST_TARGET_DIR=docs/prrte-rst-content
2626

2727
cp -rp $SCHIZO_SRC_DIR $SCHIZO_TARGET_DIR
2828
cp -rp $PRRTE_RST_SRC_DIR $PRRTE_RST_TARGET_DIR
29+
30+
cd docs
31+
python3 ./generate-mpi-man3-bindings.py --srcdir . --builddir .

3rd-party/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
SUBDIRS = $(OPAL_3RDPARTY_SUBDIRS)
1818
DIST_SUBDIRS = $(OPAL_3RDPARTY_DIST_SUBDIRS)
19-
EXTRA_DIST = $(OPAL_3RDPARTY_EXTRA_DIST) autogen.subdirs
19+
EXTRA_DIST = $(OPAL_3RDPARTY_EXTRA_DIST) autogen.subdirs pympistandard
2020

2121
distclean-local:
2222
rm -rf $(OPAL_3RDPARTY_DISTCLEAN_DIRS)

3rd-party/pympistandard

Submodule pympistandard added at 7bc6bb0

docs/Makefile.am

+22-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright (c) 2022 Cisco Systems, Inc. All rights reserved.
3-
# Copyright (c) 2023-2024 Jeffrey M. Squyres. All rights reserved.
3+
# Copyright (c) 2023-2025 Jeffrey M. Squyres. All rights reserved.
44
#
55
# $COPYRIGHT$
66
#
@@ -60,6 +60,8 @@ RST_SOURCE_FILES = \
6060
EXTRA_DIST = \
6161
requirements.txt \
6262
no-prrte-content.rst.txt \
63+
generate-mpi-man3-bindings.py \
64+
mpi-standard-apis.json \
6365
html \
6466
man \
6567
$(SPHINX_CONFIG) \
@@ -843,6 +845,10 @@ OMPI_MAN3_RST = $(OMPI_MAN3:%.3=man-openmpi/man3/%.3.rst)
843845
OMPI_MAN3_BUILT = $(OMPI_MAN3:%.3=$(MAN_OUTDIR)/%.3)
844846
OMPI_MAN3_INSTALL_FROM = $(OMPI_MAN3:%.3=$(MAN_INSTALL_FROM)/%.3)
845847

848+
# Use this one file as a sentinel for building all the Open MPI man
849+
# page API bindings files
850+
SENTINEL_OMPI_MAN3_BINDING = $(builddir)/man-openmpi/man3/bindings/mpi_init.rst
851+
846852
OMPI_MAN7_RST = $(OMPI_MAN7:%.7=man-openmpi/man7/%.7.rst)
847853
OMPI_MAN7_BUILT = $(OMPI_MAN7:%.7=$(MAN_OUTDIR)/%.7)
848854
OMPI_MAN7_INSTALL_FROM = $(OMPI_MAN7:%.7=$(MAN_INSTALL_FROM)/%.7)
@@ -921,7 +927,7 @@ man: $(ALL_MAN_BUILT)
921927
# Remove the copies of the built HTML and man pages to get back to a
922928
# clean git clone.
923929
maintainer-clean-local:
924-
rm -rf html man
930+
rm -rf html man man-openmpi/man3/bindings
925931

926932
# If we're doing a VPATH build, we may have "html" and "man"
927933
# directories in the build tree (e.g., if we did "make dist"). Remove
@@ -967,8 +973,8 @@ $(builddir)/schizo-ompi-rst-content:
967973
$(builddir)/prrte-rst-content:
968974
$(OMPI_V_MKDIR) if test ! -d "$@"; then mkdir "$@"; fi
969975

970-
# Get the schizo-ompi-rst-cli.rst file that we need. CAVEAT: we name
971-
# it ".in" so that Sphinx doesn't slurp it in via two different
976+
# Get the schizo-ompi-cli.rst file that we need. CAVEAT: we name it
977+
# ".rstxt" so that Sphinx doesn't slurp it in via two different
972978
# locations in the RST docroot (i.e., via
973979
# /schizo-ompi-rst-content/schizo-ompi-cli.rstxt and via
974980
# /man-openmpi/man1/mpirun.1.rst). Sphinx *shouldn't* do this -- it
@@ -998,10 +1004,20 @@ $(builddir)/schizo-ompi-rst-content/schizo-ompi-cli.rstxt: $(srcdir)/no-prrte-co
9981004
cp -pf $(srcdir)/no-prrte-content.rst.txt "$@"
9991005
endif
10001006

1007+
$(builddir)/man-openmpi/man3/bindings:
1008+
$(OMPI_V_MKDIR) if test ! -d "$@"; then mkdir -p "$@"; fi
1009+
1010+
$(SENTINEL_OMPI_MAN3_BINDING): $(builddir)/man-openmpi/man3/bindings
1011+
$(SENTINEL_OMPI_MAN3_BINDING): generate-mpi-man3-bindings.py
1012+
$(SENTINEL_OMPI_MAN3_BINDING): mpi-standard-apis.json
1013+
$(OMPI_V_GEN) $(PYTHON3) $(srcdir)/generate-mpi-man3-bindings.py \
1014+
--srcdir $(srcdir) --builddir $(builddir)
1015+
10011016
$(ALL_MAN_BUILT): $(builddir)/prrte-rst-content
10021017
$(ALL_MAN_BUILT): $(builddir)/schizo-ompi-rst-content/schizo-ompi-cli.rstxt
10031018
$(ALL_MAN_BUILT): $(RST_SOURCE_FILES) $(IMAGE_SOURCE_FILES)
10041019
$(ALL_MAN_BUILT): $(TEXT_SOURCE_FILES) $(SPHINX_CONFIG)
1020+
$(ALL_MAN_BUILT): $(SENTINEL_OMPI_MAN3_BINDING)
10051021

10061022
# Render the RST source into both 1) full HTML docs and 2) nroff man
10071023
# pages.
@@ -1029,7 +1045,7 @@ $(ALL_MAN_BUILT): $(TEXT_SOURCE_FILES) $(SPHINX_CONFIG)
10291045
# not think of anything better to do.
10301046
#
10311047
# NOTE: This is a little gross in that for a VPATH build, we *always*
1032-
# copy from the source tree to the dest tree (if the target does not
1048+
# copy from the source tree to the build tree (if the target does not
10331049
# exist or any of the sources in the source tree -- thanks to
10341050
# make/VPATH handling -- have changed compared to the target).
10351051
# However, we're using "cp -p", so even though we're copying *all the
@@ -1039,6 +1055,7 @@ $(ALL_MAN_BUILT): $(TEXT_SOURCE_FILES) $(SPHINX_CONFIG)
10391055
# changed. We're going to overwrite any local changes in the build
10401056
# tree, but you shouldn't be editing the build tree, anyway. So --
10411057
# good enough.
1058+
10421059
$(ALL_MAN_BUILT):
10431060
$(OMPI_V_SPHINX_COPYRST) if test "$(srcdir)" != "$(builddir)"; then \
10441061
len=`echo "$(srcdir)/" | wc -c`; \

0 commit comments

Comments
 (0)