Skip to content

Commit cdb35c3

Browse files
authored
Merge pull request #11820 from jsquyres/pr/generate-mpirun-man-page
Include PRTE RST content in mpirun.1 man page
2 parents 2ebdfbb + c356981 commit cdb35c3

16 files changed

+636
-174
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,3 +534,12 @@ docs/_templates
534534
# Common Python virtual environment directory names
535535
venv
536536
py??
537+
538+
# Copies of PRRTE RST files (i.e., not source controlled in this tree)
539+
docs/prrte-rst-content
540+
docs/schizo-ompi-rst-content
541+
542+
# Copies of the built HTML docs and man pages (for distribution
543+
# tarballs)
544+
docs/html
545+
docs/man

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
3333
Jeff Squyres <[email protected]> --quiet <--quiet>
3434
Jeff Squyres <[email protected]>
35+
Jeff Squyres <[email protected]>
3536

3637
3738

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# The ReadTheDocs build process does not run autogen/configure/make.
6+
# Hence, we have to copy the PRRTE RST files (from the 3rd-party/prrte
7+
# tree) to our docs/ tree manually.
8+
9+
# Ensure that we're in the RTD CI environment
10+
11+
if [[ "${READTHEDOCS:-no}" == "no" ]]; then
12+
echo "This script is only intended to be run in the ReadTheDocs CI environment"
13+
exit 1
14+
fi
15+
16+
SCHIZO_SRC_DIR=3rd-party/prrte/src/mca/schizo/ompi
17+
SCHIZO_TARGET_DIR=docs/schizo-ompi-rst-content
18+
19+
PRRTE_RST_SRC_DIR=3rd-party/prrte/src/docs/prrte-rst-content
20+
PRRTE_RST_TARGET_DIR=docs/prrte-rst-content
21+
22+
# Copy the OMPI schizo file from PRRTE
23+
24+
cp -rp $SCHIZO_SRC_DIR $SCHIZO_TARGET_DIR
25+
26+
# Only copy the PRRTE RST source files in prrte-rst-content that are
27+
# referenced by ".. include::" in the schizo-ompi-cli.rst file. We do
28+
# this because Sphinx complains if there are .rst files that are not
29+
# referenced. :-(
30+
31+
mkdir -p $PRRTE_RST_TARGET_DIR
32+
files=`fgrep '.. include::' $SCHIZO_TARGET_DIR/schizo-ompi-cli.rstxt | awk '{ print $3 }'`
33+
for file in $files; do
34+
filename=`basename $file`
35+
cp -pf $PRRTE_RST_SRC_DIR/$filename $PRRTE_RST_TARGET_DIR
36+
done

.readthedocs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ build:
1212
os: ubuntu-22.04
1313
tools:
1414
python: "3.10"
15+
jobs:
16+
# RTD doesn't run configure or make. So we have to manually copy
17+
# in the PRRTE RST files to docs/.
18+
pre_create_environment:
19+
- ./.readthedocs-pre-create-environment.sh
1520

1621
python:
1722
install:
@@ -21,3 +26,6 @@ python:
2126
sphinx:
2227
configuration: docs/conf.py
2328
fail_on_warning: true
29+
30+
submodules:
31+
include: all

3rd-party/prrte

Submodule prrte updated 117 files

Makefile.ompi-rules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) 2008-2022 Cisco Systems, Inc. All rights reserved.
33
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
44
# Copyright (c) 2020 Intel, Inc. All rights reserved.
5+
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
56
# $COPYRIGHT$
67
#
78
# Additional copyrights may follow
@@ -26,6 +27,14 @@ OMPI_V_GEN = $(ompi__v_GEN_$V)
2627
ompi__v_GEN_ = $(ompi__v_GEN_$AM_DEFAULT_VERBOSITY)
2728
ompi__v_GEN_0 = @echo " GENERATE" $@;
2829

30+
OMPI_V_COPYALL = $(ompi__v_COPYALL_$V)
31+
ompi__v_COPYALL_ = $(ompi__v_COPYALL_$AM_DEFAULT_VERBOSITY)
32+
ompi__v_COPYALL_0 = @echo " COPY tree $@";
33+
34+
OMPI_V_SPHINX_COPYRST = $(ompi__v_SPHINX_COPYRST_$V)
35+
ompi__v_SPHINX_COPYRST_ = $(ompi__v_SPHINX_COPYRST_$AM_DEFAULT_VERBOSITY)
36+
ompi__v_SPHINX_COPYRST_0 = @echo " COPY RST source files";
37+
2938
OMPI_V_SPHINX_HTML = $(ompi__v_SPHINX_HTML_$V)
3039
ompi__v_SPHINX_HTML_ = $(ompi__v_SPHINX_HTML_$AM_DEFAULT_VERBOSITY)
3140
ompi__v_SPHINX_HTML_0 = @echo " GENERATE HTML docs";

config/ompi_setup_prrte.m4

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dnl Copyright (c) 2019-2020 Intel, Inc. All rights reserved.
1919
dnl Copyright (c) 2020-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
2020
dnl Copyright (c) 2021 Nanook Consulting. All rights reserved.
2121
dnl Copyright (c) 2021-2022 IBM Corporation. All rights reserved.
22+
dnl Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
2223
dnl $COPYRIGHT$
2324
dnl
2425
dnl Additional copyrights may follow
@@ -35,10 +36,25 @@ dnl
3536
dnl A Makefile conditional OMPI_WANT_PRRTE will be defined based on the
3637
dnl results of the build.
3738
AC_DEFUN([OMPI_SETUP_PRRTE],[
38-
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy])
39+
AC_REQUIRE([AC_PROG_LN_S])
40+
41+
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy target_rst_dir])
3942
4043
opal_show_subtitle "Configuring PRRTE"
4144
45+
# We *must* have setup Sphinx before invoking this macro (i.e., it
46+
# is a programming error -- not a run-time error -- if Sphinx was
47+
# not previously setup).
48+
OAC_ASSERT_BEFORE([OAC_SETUP_SPHINX], [OMPI_SETUP_PRRTE])
49+
50+
# These are sym links to folders with PRRTE's RST files that we'll
51+
# slurp into mpirun.1.rst. We'll remove these links (or even
52+
# accidental full copies) now and replace them with new links to
53+
# the PRRTE that we find, below.
54+
target_rst_dir="$OMPI_TOP_BUILDDIR/docs"
55+
rm -rf "$target_rst_dir/prrte-rst-content"
56+
rm -rf "$target_rst_dir/schizo-ompi-rst-content"
57+
4258
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])
4359
4460
AC_ARG_WITH([prrte-bindir],
@@ -101,12 +117,15 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
101117
[$OMPI_USING_INTERNAL_PRRTE],
102118
[Whether or not we are using the internal PRRTE])
103119
104-
OPAL_SUMMARY_ADD([Miscellaneous], [prrte], [], [$opal_prrte_mode])
120+
AC_SUBST(OMPI_PRRTE_RST_CONTENT_DIR)
121+
AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR)
122+
AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1])
123+
124+
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode])
105125
106126
OPAL_VAR_SCOPE_POP
107127
])
108128

109-
110129
dnl _OMPI_SETUP_PRRTE_INTERNAL([action-if-success], [action-if-not-success])
111130
dnl
112131
dnl Attempt to configure the built-in PRRTE.
@@ -220,7 +239,15 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
220239
[AC_MSG_ERROR([PRRTE configuration failed. Cannot continue.])])
221240
222241
AS_IF([test "$internal_prrte_happy" = "yes"],
223-
[$1], [$2])
242+
[AC_MSG_CHECKING([for internal PRRTE RST files])
243+
AS_IF([test -n "$SPHINX_BUILD"],
244+
[OMPI_HAVE_PRRTE_RST=1
245+
OMPI_PRRTE_RST_CONTENT_DIR="$OMPI_TOP_SRCDIR/3rd-party/prrte/src/docs/prrte-rst-content"
246+
OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$OMPI_TOP_SRCDIR/3rd-party/prrte/src/mca/schizo/ompi"
247+
AC_MSG_RESULT([found])],
248+
[AC_MSG_RESULT([not found])])
249+
$1],
250+
[$2])
224251
225252
OPAL_VAR_SCOPE_POP
226253
])
@@ -284,9 +311,27 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
284311
[AC_DEFINE_UNQUOTED([OMPI_PRTERUN_PATH], ["${prterun_path}"], [Path to prterun])])
285312
286313
AS_IF([test "$setup_prrte_external_happy" = "yes"],
287-
[$1], [$2])
314+
[ # Determine if this external PRRTE has installed the RST
315+
# directories that we care about
316+
317+
AC_MSG_CHECKING([for external PRRTE RST files])
318+
prrte_install_dir=${with_prrte}/share/prte/rst
319+
AS_IF([test -n "$SPHINX_BUILD"],
320+
[AS_IF([test -d "$prrte_install_dir/prrte-rst-content" && \
321+
test -d "$prrte_install_dir/schizo-ompi-rst-content"],
322+
[OMPI_HAVE_PRRTE_RST=1
323+
OMPI_PRRTE_RST_CONTENT_DIR="$prrte_install_dir/prrte-rst-content"
324+
OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$prrte_install_dir/schizo-ompi-rst-content"
325+
AC_MSG_RESULT([found])
326+
],
327+
[ # This version of PRRTE doesn't have installed RST
328+
# files.
329+
AC_MSG_RESULT([not found])
330+
OMPI_HAVE_PRRTE_RST=0
331+
])
332+
])
333+
$1],
334+
[$2])
288335
289336
OPAL_VAR_SCOPE_POP
290337
])
291-
292-

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2929
# Copyright (c) 2019 Triad National Security, LLC. All rights
3030
# reserved.
31+
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
3132
# $COPYRIGHT$
3233
#
3334
# Additional copyrights may follow
@@ -1072,7 +1073,7 @@ AS_IF([test -z "$LEX" || \
10721073

10731074
dnl Note that we have to double escape the URL below
10741075
dnl so that the # it contains doesn't confuse the Autotools
1075-
OAC_SETUP_SPHINX([$srcdir/docs/_build/man/MPI_T.3],
1076+
OAC_SETUP_SPHINX([$srcdir/docs/man/MPI_T.3],
10761077
[[https://docs.open-mpi.org/en/main/developers/prerequisites.html#sphinx-and-therefore-python]])
10771078

10781079
#

0 commit comments

Comments
 (0)