diff --git a/.gitmodules b/.gitmodules index 5646d8fedc5..ead00add5d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/3rd-party/openpmix b/3rd-party/openpmix index 08e41ed5629..e87b2ee832d 160000 --- a/3rd-party/openpmix +++ b/3rd-party/openpmix @@ -1 +1 @@ -Subproject commit 08e41ed5629b51832f5708181af6d89218c7a74e +Subproject commit e87b2ee832d249fadd61938a578aaee407b976b9 diff --git a/3rd-party/prrte b/3rd-party/prrte index 30cadc6746e..e88a3576ea6 160000 --- a/3rd-party/prrte +++ b/3rd-party/prrte @@ -1 +1 @@ -Subproject commit 30cadc6746ebddd69ea42ca78b964398f782e4e3 +Subproject commit e88a3576ea6732a1b6fe034c9c26425205bc41eb diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 index 28140bad066..fd07c5ee3e2 100644 --- a/config/ompi_setup_prrte.m4 +++ b/config/ompi_setup_prrte.m4 @@ -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" @@ -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 @@ -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], @@ -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 - ]], [[ -#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 -]) diff --git a/ompi/dpm/dpm.c b/ompi/dpm/dpm.c index 4b5dbf623e1..84911df57b4 100644 --- a/ompi/dpm/dpm.c +++ b/ompi/dpm/dpm.c @@ -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 diff --git a/ompi/tools/mpirun/Makefile.am b/ompi/tools/mpirun/Makefile.am index 7167ccdf6dd..0c64ca4766f 100644 --- a/ompi/tools/mpirun/Makefile.am +++ b/ompi/tools/mpirun/Makefile.am @@ -14,6 +14,12 @@ 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 @@ -21,8 +27,12 @@ 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)\"" \ diff --git a/ompi/tools/mpirun/help-mpirun.txt b/ompi/tools/mpirun/help-mpirun.txt index 7df77c785cf..d68133e3a76 100644 --- a/ompi/tools/mpirun/help-mpirun.txt +++ b/ompi/tools/mpirun/help-mpirun.txt @@ -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 \ No newline at end of file diff --git a/ompi/tools/mpirun/main.c b/ompi/tools/mpirun/main.c index 3a4e18dced9..dc31f0220b5 100644 --- a/ompi/tools/mpirun/main.c +++ b/ompi/tools/mpirun/main.c @@ -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) { @@ -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) { @@ -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 @@ -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; } /* @@ -214,4 +157,4 @@ int main(int argc, char *argv[]) * Additional copyrights may follow * * $HEADER$ - */ + */ \ No newline at end of file