Skip to content

Commit

Permalink
wip - update to to match PRRTE side
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Squyres <jeff@squyres.com>
  • Loading branch information
jsquyres committed Aug 19, 2023
1 parent a65f248 commit 018d39a
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 257 deletions.
156 changes: 107 additions & 49 deletions config/ompi_setup_prrte.m4
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ dnl
dnl $HEADER$
dnl

dnl $1 dir
dnl $2 filename
AC_DEFUN([_OMPI_SETUP_PRRTE_DUMMY_RST_FILE], [
dir=$1
file=$2
mkdir -p "$dir"
rm -rf "$dir/$file"
cat > "$dir/$file" <<EOF
No content
==========
There is no meaningful content in this file because Open MPI was built
with a PRRTE that was too old to include machine-readable
documentation that could be incorporated into Open MPI's
documentation. If you build Open MPI with a newer version of PRRTE
(and have the Sphinx tool available when you run Open MPI's
``configure`` command), you should get more meaningful documentation
here.
Hence, there's no documentation for this section.
Sorry!
EOF
])

dnl Check for / configure PRRTE package. Prefer finding an external
dnl PRRTE, build our internal one if required. If we can not find an
dnl external PRRTE and the internal one fails to configure, abort.
Expand All @@ -66,10 +40,10 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
opal_show_subtitle "Configuring PRRTE"
# These are sym links to PRRTE's RST files that we'll slurp into
# mpirun.1.rst. We'll remove these links now and replace them
# with new links to the PRRTE that we find, below.
target_rst_dir="$OMPI_TOP_SRCDIR/docs/man-openmpi/man1"
# These are sym links to folders with PRRTE's RST files that we'll
# slurp into mpirun.1.rst. We'll remove these links now and
# replace them with new links to the PRRTE that we find, below.
target_rst_dir="$OMPI_TOP_SRCDIR/docs"
rm -rf "$target_rst_dir/prrte-rst-content"
rm -rf "$target_rst_dir/schizo-ompi-rst-content"
Expand Down Expand Up @@ -127,6 +101,10 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
AM_CONDITIONAL([OMPI_WANT_PRRTE],
[test "$prrte_setup_internal_happy" = "1" -o "$prrte_setup_external_happy" = "1"])
# If we are not building PRRTE, make dummy PRRTE docs files
AS_IF([test $OMPI_HAVE_PRRTE -eq 0],
[_OMPI_SETUP_PRRTE_DUMMY_RST_FILES])
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRRTE],
[$OMPI_HAVE_PRRTE],
[Whether or not PRRTE is available])
Expand All @@ -135,11 +113,78 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
[$OMPI_USING_INTERNAL_PRRTE],
[Whether or not we are using the internal PRRTE])
OPAL_SUMMARY_ADD([Miscellaneous], [prrte], [], [$opal_prrte_mode])
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode])
OPAL_VAR_SCOPE_POP
])

dnl Helper to make a dummy RST file in a specific target directory.
dnl
dnl $1 dir
dnl $2 filename
AC_DEFUN([_OMPI_SETUP_PRRTE_DUMMY_RST_FILE], [
dir="$1"
file="$2"
mkdir -p "$dir"
rm -rf "$dir/$file"
cat > "$dir/$file" <<EOF
No content
^^^^^^^^^^
There is no meaningful content in this file because Open MPI was either:
* Built without PRRTE support.
* Built with a PRRTE that was too old to include machine-readable
documentation that could be incorporated into Open MPI's
documentation.
If you build Open MPI with a newer version of PRRTE
(and have the Sphinx tool available when you run Open MPI's
``configure`` command), you should get more meaningful documentation
here.
Hence, there's no documentation for this section.
Sorry!
EOF
])

AC_DEFUN([_OMPI_SETUP_PRRTE_DUMMY_RST_FILES], [
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/prrte-rst-content],
[prterun-all-cli.rst])
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/prrte-rst-content],
[prterun-all-deprecated.rst])
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/schizo-ompi-rst-content],
[schizo-ompi-cli.rst])
AC_MSG_NOTICE([created dummy PRRTE RST files])
])


dnl Helper to ensure that a source directory exists before making a
dnl sym link to it.
dnl
dnl $1 source directory
dnl $2 target directory
AC_DEFUN([_OMPI_SETUP_PRRTE_CHECK_AND_LINK], [
OPAL_VAR_SCOPE_PUSH([src dest])
src="$1"
dest="$2"
AS_IF([test ! -d "$src"],
[AC_MSG_RESULT([not found])
AC_MSG_WARN([Directory $src does not exist])
AC_MSG_WARN([This should never happen])
AC_MSG_ERROR([Cannot continue])])
${LN_S} "$src" "$dest"
OPAL_VAR_SCOPE_POP
])

dnl _OMPI_SETUP_PRRTE_INTERNAL([action-if-success], [action-if-not-success])
dnl
Expand Down Expand Up @@ -254,8 +299,16 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
[AC_MSG_ERROR([PRRTE configuration failed. Cannot continue.])])
AS_IF([test "$internal_prrte_happy" = "yes"],
[${LN_S} $OMPI_TOP_SRCDIR/3rd-party/prrte/src/docs/prrte-rst-content $target_rst_dir
${LN_S} $OMPI_TOP_SRCDIR/3rd-party/prrte/src/mca/schizo/ompi $target_rst_dir/schizo-ompi-rst-content
[AC_MSG_CHECKING([for internal PRRTE RST files])
_OMPI_SETUP_PRRTE_CHECK_AND_LINK(
[$OMPI_TOP_SRCDIR/3rd-party/prrte/src/docs/prrte-rst-content],
[$target_rst_dir/prrte-rst-content])
_OMPI_SETUP_PRRTE_CHECK_AND_LINK(
[$OMPI_TOP_SRCDIR/3rd-party/prrte/src/mca/schizo/ompi],
[$target_rst_dir/schizo-ompi-rst-content])
AC_MSG_RESULT([found])
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [],
[Found internal PRRTE RST files])
$1], [$2])
OPAL_VAR_SCOPE_POP
Expand Down Expand Up @@ -320,24 +373,29 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
[AC_DEFINE_UNQUOTED([OMPI_PRTERUN_PATH], ["${prterun_path}"], [Path to prterun])])
AS_IF([test "$setup_prrte_external_happy" = "yes"],
[prrte_install_dir=${with_prrte}/share/prte/rst
AS_IF([test -f "$prrte_install_dir"],
[ # If this external PRRTE has installed the RST directories
# that we care about, make sym links into OMPI's docs/
# source tree.
AC_MSG_CHECKING([for external PRRTE RST files])
prrte_install_dir=${with_prrte}/share/prte/rst
AS_IF([test -d "$prrte_install_dir/prrte-rst-content" && \
test -d "$prrte_install_dir/schizo-ompi-rst-content"],
[${LN_S} "$prrte_install_dir/prrte-rst-content" "$target_rst_dir"
${LN_S} "$prrte_install_dir/schizo-ompi-rst-content" "$target_rst_dir"],
${LN_S} "$prrte_install_dir/schizo-ompi-rst-content" "$target_rst_dir"
AC_MSG_RESULT([found])
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [],
[Found external PRRTE RST files])
],
[ # This version of PRRTE doesn't have installed RST
# files. So we make dummy "you don't get help" RST
# files. Open to suggestion to do something
# better...?
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/prrte-rst-content],
[cli-add-host.rst])
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/schizo-ompi-rst-content],
[schizo-ompi-cli.rst])
_OMPI_SETUP_PRRTE_DUMMY_RST_FILE(
[$target_rst_dir/prrte-rst-content],
[deprecated-bind-to-core.rst])
])
# files. So we make dummy "you don't get help" RST
# files. Open to suggestion to do something
# better...?
AC_MSG_RESULT([not found (made empty dummy files)])
_OMPI_SETUP_PRRTE_DUMMY_RST_FILES
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [],
[Did not find external PRRTE RST files])
])
$1], [$2])
OPAL_VAR_SCOPE_POP
Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Sym links to PRRTE RST files
prrte-rst-content
schizo-ompi-rst-content
Loading

0 comments on commit 018d39a

Please sign in to comment.