Skip to content

uofl: changes to Open MPI and move prrte/pmix shas #13299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "prrte"]
path = 3rd-party/prrte
url = ../../open-mpi/prrte
branch = master
branch = ompi_main
[submodule "openpmix"]
path = 3rd-party/openpmix
url = ../../openpmix/openpmix.git
Expand Down
2 changes: 1 addition & 1 deletion 3rd-party/openpmix
Submodule openpmix updated 407 files
2 changes: 1 addition & 1 deletion 3rd-party/prrte
Submodule prrte updated 418 files
165 changes: 54 additions & 111 deletions config/ompi_setup_prrte.m4
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dnl results of the build.
AC_DEFUN([OMPI_SETUP_PRRTE],[
AC_REQUIRE([AC_PROG_LN_S])

OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy target_rst_dir])
OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy target_rst_dir])

opal_show_subtitle "Configuring PRRTE"

Expand All @@ -56,16 +56,44 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
rm -rf "$target_rst_dir/prrte-rst-content"
rm -rf "$target_rst_dir/schizo-ompi-rst-content"

OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])

AC_ARG_WITH([prrte-bindir],
[AS_HELP_STRING([--with-prrte-bindir=DIR],
[Search for PRRTE binaries in DIR. Defaults to PRRTE_DIR/bin if not specified])])

AC_ARG_WITH([prrte],
[AS_HELP_STRING([--with-prrte],
[Enable/disable building with PRRTE. Supports 'yes', 'internal', and 'no', defaulting to 'yes'])])

AC_ARG_WITH([rte],
[AS_HELP_STRING([--with-rte],
[Enable/disable building with RTE. Supports 'yes' and 'no', defaulting to 'yes'])])

# Checking if --with-prrte and --with-rte values differ.
AS_IF([test -n "$with_prrte" -a -n "$with_rte" -a "$with_prrte" != "$with_rte"],
AC_MSG_ERROR(['--with-prrte' and '--with-rte' are both defined but have differing values. Please specify one or the other.]))

# Setting --with-prrte to --with-rte's value to avoid duplicate code
AS_IF([test -z "$with_prrte"],
[with_prrte="$with_rte"])

# We only want to accept 'yes' or 'no' as args for --with-prrte.
# If user does not specify, it defaults to 'yes'.
# We no longer support external prrte builds.
prrte_setup_internal_happy=0
AS_IF([test "$with_prrte" != "yes" -a "$with_prrte" != "no" -a "$with_prrte" != "" -a "$with_prrte" != "internal"],
AC_MSG_ERROR(['--with-prrte' option defaults to 'yes' and supports 'yes', 'internal', or 'no'. Internal is equivalent to yes. External PRRTE builds are no longer supported.]))

# Determines if user wants to build with PRRTE.
# Defaults to building with PRRTE if unspecified.
AS_CASE([$with_prrte],
["yes"], [prrte_setup_internal_happy=1
opal_prrte_mode="internal"],
["internal"], [prrte_setup_internal_happy=1
opal_prrte_mode="internal"],
["no"], [prrte_setup_internal_happy=0
opal_prrte_mode="disabled"],
[""], [prrte_setup_internal_happy=1
opal_prrte_mode="internal"])

m4_ifdef([package_prrte],
[OMPI_PRRTE_ADD_ARGS
AS_IF([test "$opal_prrte_mode" = "unspecified" -o "$opal_prrte_mode" = "internal"],
AS_IF([test "$opal_prrte_mode" = "internal"],
[# Run PRRTE's configure script unless the user
# explicitly asked us to use an external PMIX, so that
# "make dist" includes PRRTE in the dist tarball. This
Expand All @@ -78,37 +106,26 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
_OMPI_SETUP_PRRTE_INTERNAL([prrte_setup_internal_happy=1],
[prrte_setup_internal_happy=0])])

# if we have a pmix package and configure did not complete
# successfully (or wasn't started), then disable make dist.
AS_IF([test $prrte_setup_internal_happy != 1],
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])])

# unless internal specifically requested by the user, try to find
# an external that works.
prrte_setup_external_happy=0
AS_IF([test "$opal_prrte_mode" != "internal" -a "$opal_prrte_mode" != "disabled"],
[_OMPI_SETUP_PRRTE_EXTERNAL(
[prrte_setup_external_happy=1
opal_prrte_mode="external"],
[AS_IF([test "$opal_prrte_mode" = "external"],
[AC_MSG_ERROR([External PRRTE requested but not found.])])])])

# external did not work out and customer did not specify external,
# so try the internal version.
AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"],
[opal_prrte_mode="internal"
OMPI_USING_INTERNAL_PRRTE=1
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
[OMPI_USING_INTERNAL_PRRTE=0])

AS_IF([test "$opal_prrte_mode" != "disabled"],
[AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "0"],
[AC_MSG_ERROR([Could not find viable prrte build.])])
OMPI_HAVE_PRRTE=1],
[OMPI_HAVE_PRRTE=0])
# if we have a pmix package and configure did not complete
# successfully (or wasn't started), then disable make dist.
AS_IF([test $prrte_setup_internal_happy != 1],
[OPAL_MAKEDIST_DISABLE="$OPAL_MAKEDIST_DISABLE PRRTE"])])

AS_IF([test "$opal_prrte_mode" = "disabled"],
[OMPI_WANT_PRRTE=0
OMPI_HAVE_PRRTE=0
OMPI_USING_INTERNAL_PRRTE=0
OMPI_HAVE_PRRTE_RST=0],
[AS_IF([test "$prrte_setup_internal_happy" = "1"],
[OMPI_WANT_PRRTE=1
OMPI_HAVE_PRRTE=1
OMPI_USING_INTERNAL_PRRTE=1
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
[OMPI_HAVE_PRRTE=0
OMPI_USING_INTERNAL_PRRTE=0])])

AM_CONDITIONAL([OMPI_WANT_PRRTE],
[test "$prrte_setup_internal_happy" = "1" -o "$prrte_setup_external_happy" = "1"])
[test "$prrte_setup_internal_happy" = "1"])

AC_DEFINE_UNQUOTED([OMPI_HAVE_PRRTE],
[$OMPI_HAVE_PRRTE],
Expand Down Expand Up @@ -265,77 +282,3 @@ dnl succeeded.
AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL_POST], [
OPAL_3RDPARTY_SUBDIRS="$OPAL_3RDPARTY_SUBDIRS prrte"
])


dnl _OMPI_SETUP_PRRTE_EXTERNAL([action if success], [action if not success])
dnl
dnl Try to find an external prrte with sufficient version.
AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
OPAL_VAR_SCOPE_PUSH([ompi_prte_min_version ompi_prte_min_num_version setup_prrte_external_happy opal_prrte_CPPFLAGS_save])

opal_prrte_CPPFLAGS_save=$CPPFLAGS

AS_IF([test -n "${with_prrte}" -a "${with_prrte}" != "yes" -a "${with_prrte}" != "no"],
[OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], ["-I${with_prrte}/include"])])

AC_CHECK_HEADER([prte.h], [setup_prrte_external_happy=yes],
[setup_prrte_external_happy=no])

ompi_prte_min_version=OMPI_PRTE_MIN_VERSION
ompi_prte_min_num_version=OMPI_PRTE_NUMERIC_MIN_VERSION
AS_IF([test "${setup_prrte_external_happy}" = "yes"],
[AC_CACHE_CHECK([if external PRRTE version is OMPI_PRTE_MIN_VERSION or greater],
[ompi_setup_prrte_cv_version_happy],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <prte_version.h>
]], [[
#if PRTE_NUMERIC_VERSION < $ompi_prte_min_num_version
#error "prrte API version is less than $ompi_prte_min_version"
#endif
]])],
[ompi_setup_prrte_cv_version_happy="yes"],
[ompi_setup_prrte_cv_version_happy="no"])])
AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"],
[setup_prrte_external_happy="no"])])

CPPFLAGS="$opal_prrte_CPPFLAGS_save"

# If an external build and the user told us where to find PRRTE,
# find prterun and save that path.
prterun_path=
AS_IF([test "$setup_prrte_external_happy" = "yes"],
[AS_IF([test "${with_prrte_bindir}" = "yes" -o "${with_prrte_bindir}" = "no"],
[AC_MSG_ERROR(["yes" and "no" are not valid arguments for --with-prrte-bindir])])
AS_IF([test -z "${with_prrte_bindir}" -a -n "${with_prrte}"],
[with_prrte_bindir="${with_prrte}/bin"])
AS_IF([test -n "${with_prrte_bindir}"],
[AS_IF([test -x ${with_prrte_bindir}/prterun],
[prterun_path="${with_prrte_bindir}/prterun"],
[AC_MSG_ERROR([Could not find executable prterun: ${with_prrte_bindir}/prterun])])])])
AS_IF([test -n "${prterun_path}"],
[AC_DEFINE_UNQUOTED([OMPI_PRTERUN_PATH], ["${prterun_path}"], [Path to prterun])])

OMPI_HAVE_PRRTE_RST=0
AS_IF([test "$setup_prrte_external_happy" = "yes"],
[ # Determine if this external PRRTE has installed the RST
# directories that we care about

AC_MSG_CHECKING([for external PRRTE RST files])
prrte_install_dir=${with_prrte}/share/prte/rst
AS_IF([test -n "$SPHINX_BUILD"],
[AS_IF([test -d "$prrte_install_dir/prrte-rst-content" && \
test -d "$prrte_install_dir/schizo-ompi-rst-content"],
[OMPI_HAVE_PRRTE_RST=1
OMPI_PRRTE_RST_CONTENT_DIR="$prrte_install_dir/prrte-rst-content"
OMPI_SCHIZO_OMPI_RST_CONTENT_DIR="$prrte_install_dir/schizo-ompi-rst-content"
AC_MSG_RESULT([found])
],
[ # This version of PRRTE doesn't have installed RST
# files.
AC_MSG_RESULT([not found])
])
])
$1],
[$2])

OPAL_VAR_SCOPE_POP
])
5 changes: 4 additions & 1 deletion ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,10 @@ static char *find_prte(void)
#if OMPI_USING_INTERNAL_PRRTE
/* 2) If using internal PRRTE, use our bindir. Note that this
* will obey OPAL_PREFIX and OPAL_DESTDIR */
opal_asprintf(&filename, "%s%sprte", opal_install_dirs.bindir, OPAL_PATH_SEP);
/*
* TODO: HPP replace hard-wired prrte prefix with something configurable
*/
opal_asprintf(&filename, "%s%sompi-prte", opal_install_dirs.bindir, OPAL_PATH_SEP);
return filename;
#else

Expand Down
12 changes: 11 additions & 1 deletion ompi/tools/mpirun/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,25 @@

if OMPI_WANT_PRRTE

#
# to help VPATH'd builds find prrte_version.h
#
AM_CFLAGS = \
-I$(top_builddir)/3rd-party/prrte/include

bin_PROGRAMS = mpirun

EXTRA_DIST = help-mpirun.txt

mpirun_SOURCES = \
main.c

#
# TODO: HPP replace hard-wired prrte prefix with something configurable
#
mpirun_LDADD = \
$(top_builddir)/opal/libopen-pal_core.la
$(top_builddir)/opal/libopen-pal_core.la \
$(top_builddir)/3rd-party/prrte/src/libompi-prrte.la

mpirun_CPPFLAGS = \
-DMCA_oshmem_FRAMEWORKS="\"$(MCA_oshmem_FRAMEWORKS)\"" \
Expand Down
14 changes: 4 additions & 10 deletions ompi/tools/mpirun/help-mpirun.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@
# This is the US/English help file for Open MPI wrapper compiler error
# messages.
#
[no-prterun-found]
Open MPI's mpirun command was unable to find an underlying prterun
command to execute. Consider setting the OMPI_PRTERUN environment
variable to help mpirun find the correct underlying prterun.
[prterun-exec-failed]
Open MPI's mpirun command could not execute the underlying prterun
command. The prterun command we tried to execute and the error
message from exec() are below:
[prte-launch-failed]
Open MPI's mpirun command was unable to launch the user's application.
This may indicate an issue with the environment or incorrect configuration.

Command: %s
Error Message: %s
Error Message: %s
73 changes: 8 additions & 65 deletions ompi/tools/mpirun/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,8 @@
#include "opal/util/printf.h"
#include "opal/util/show_help.h"
#include "ompi/constants.h"
#include "3rd-party/prrte/include/prte.h"

static char *find_prterun(void)
{
char *filename = NULL;
#if !OMPI_USING_INTERNAL_PRRTE
char *prrte_prefix = NULL;
#endif

/* 1) Did the user tell us exactly where to find prterun? */
filename = getenv("OMPI_PRTERUN");
if (NULL != filename) {
return filename;
}

#if OMPI_USING_INTERNAL_PRRTE
/* 2) If using internal PRRTE, use our bindir. Note that this
* will obey OPAL_PREFIX and OPAL_DESTDIR */
opal_asprintf(&filename, "%s%sprterun", opal_install_dirs.bindir, OPAL_PATH_SEP);
return filename;
#else

/* 3) Look in ${PRTE_PREFIX}/bin */
prrte_prefix = getenv("PRTE_PREFIX");
if (NULL != prrte_prefix) {
opal_asprintf(&filename, "%s%sbin%sprterun", prrte_prefix, OPAL_PATH_SEP, OPAL_PATH_SEP);
return filename;
}

/* 4) See if configure told us where to look, if set */
#if defined(OMPI_PRTERUN_PATH)
return strdup(OMPI_PRTERUN_PATH);
#else

/* 5) Use path search */
filename = opal_find_absolute_path("prterun");

return filename;
#endif
#endif
}

static void append_prefixes(char ***out, const char *in)
{
Expand Down Expand Up @@ -119,10 +81,7 @@ static void setup_mca_prefixes(void)
int main(int argc, char *argv[])
{
char *opal_prefix = getenv("OPAL_PREFIX");
char *full_prterun_path = NULL;
char **prterun_args = NULL;
int ret;
size_t i;

ret = opal_init_util(&argc, &argv);
if (OMPI_SUCCESS != ret) {
Expand Down Expand Up @@ -154,12 +113,6 @@ int main(int argc, char *argv[])
#endif
}

full_prterun_path = find_prterun();
if (NULL == full_prterun_path) {
opal_show_help("help-mpirun.txt", "no-prterun-found", 1);
exit(1);
}

/*
* set environment variable for our install location
* used within the OMPI prrte schizo component
Expand All @@ -171,24 +124,14 @@ int main(int argc, char *argv[])
// to Open MPI.
setup_mca_prefixes();

/* calling mpirun (and now prterun) with a full path has a special
* meaning in terms of -prefix behavior, so copy that behavior
* into prterun */
if (opal_path_is_absolute(argv[0])) {
opal_argv_append_nosize(&prterun_args, full_prterun_path);
} else {
opal_argv_append_nosize(&prterun_args, "prterun");

ret = prte_launch(argc, argv);
if (OMPI_SUCCESS != ret) {
opal_show_help("help-mpirun.txt", "prte-launch-failed", 1, strerror(errno));
exit(1);
}

/* Copy all the mpirun arguments to prterun.
* TODO: Need to handle --prefix rationally here. */
for (i = 1; NULL != argv[i]; i++) {
opal_argv_append_nosize(&prterun_args, argv[i]);
}
ret = execv(full_prterun_path, prterun_args);
opal_show_help("help-mpirun.txt", "prterun-exec-failed",
1, full_prterun_path, strerror(errno));
exit(1);
return 0;
}

/*
Expand All @@ -214,4 +157,4 @@ int main(int argc, char *argv[])
* Additional copyrights may follow
*
* $HEADER$
*/
*/