From 9bc5ca51c9059214dcacd8c88f52ea292125dd53 Mon Sep 17 00:00:00 2001 From: Gerardo Garcia Date: Sun, 10 Nov 2024 22:56:35 -0500 Subject: [PATCH 1/6] modified mpirun to longer fork/exec prterun but now to instead call the function directly in the process Note this commit will need to be adjusted to reset .gitmodules before merging into Open MPI main Signed-off-by: Gerardo Garcia Signed-off-by: Howard Pritchard --- .gitmodules | 2 +- 3rd-party/prrte | 2 +- ompi/dpm/dpm.c | 5 ++- ompi/tools/mpirun/Makefile.am | 6 ++- ompi/tools/mpirun/help-mpirun.txt | 14 ++---- ompi/tools/mpirun/main.c | 73 ++++--------------------------- 6 files changed, 23 insertions(+), 79 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5646d8fedc5..4606d308ec7 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/prrte b/3rd-party/prrte index 30cadc6746e..95c240ef136 160000 --- a/3rd-party/prrte +++ b/3rd-party/prrte @@ -1 +1 @@ -Subproject commit 30cadc6746ebddd69ea42ca78b964398f782e4e3 +Subproject commit 95c240ef136aa7f03ccdb888deca7f847445c4e0 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..68d4049d72a 100644 --- a/ompi/tools/mpirun/Makefile.am +++ b/ompi/tools/mpirun/Makefile.am @@ -21,8 +21,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 From 6e4665f53328d95056e9cb5e44779c714e5b02a9 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Mon, 9 Jun 2025 15:20:17 -0600 Subject: [PATCH 2/6] uofl: changes to Open MPI and move prrte/pmix shas This PR adds Univ. of Louisville capstone class mods to Open MPI as well as pointing 3rd-party/prrte to sha 572d99a6da5c679a5a9c25f45e626c0e4d3e9ff3 (head of ompi_main branch of OMPI fork of prrte), and moves the 3rd-party/openpmix to be the v6.0.0 release. Signed-off-by: Howard Pritchard --- .gitmodules | 2 +- 3rd-party/openpmix | 2 +- 3rd-party/prrte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4606d308ec7..ead00add5d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "prrte"] path = 3rd-party/prrte url = ../../open-mpi/prrte - branch = ompi-main + 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 95c240ef136..572d99a6da5 160000 --- a/3rd-party/prrte +++ b/3rd-party/prrte @@ -1 +1 @@ -Subproject commit 95c240ef136aa7f03ccdb888deca7f847445c4e0 +Subproject commit 572d99a6da5c679a5a9c25f45e626c0e4d3e9ff3 From 90b3f48f51ad2b32076ec23c177cd0aae5a08935 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Wed, 11 Jun 2025 14:04:35 -0600 Subject: [PATCH 3/6] ompi-prrte: advance sha to e88a3576ea6732a1 Signed-off-by: Howard Pritchard --- 3rd-party/prrte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd-party/prrte b/3rd-party/prrte index 572d99a6da5..e88a3576ea6 160000 --- a/3rd-party/prrte +++ b/3rd-party/prrte @@ -1 +1 @@ -Subproject commit 572d99a6da5c679a5a9c25f45e626c0e4d3e9ff3 +Subproject commit e88a3576ea6732a1b6fe034c9c26425205bc41eb From f6efdbb2ad3d1c23b4a8e6c6068bc3b265cbff55 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Thu, 12 Jun 2025 11:55:17 -0600 Subject: [PATCH 4/6] fix vpath problem Signed-off-by: Howard Pritchard --- ompi/tools/mpirun/Makefile.am | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ompi/tools/mpirun/Makefile.am b/ompi/tools/mpirun/Makefile.am index 68d4049d72a..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 From 3c0d3acc3eb2c00c3319c98969e1fbdb9c8c7da9 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Wed, 9 Jul 2025 10:41:44 -0600 Subject: [PATCH 5/6] switch back to allowing external prte in which case we use the old app launch method. Signed-off-by: Howard Pritchard --- config/ompi_setup_prrte.m4 | 2 + ompi/tools/mpirun/Makefile.am | 5 +- ompi/tools/mpirun/help-mpirun.txt | 14 ++- ompi/tools/mpirun/main.c | 139 ++++++++++++++++++++++++------ 4 files changed, 132 insertions(+), 28 deletions(-) diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 index 28140bad066..bdc5821ec47 100644 --- a/config/ompi_setup_prrte.m4 +++ b/config/ompi_setup_prrte.m4 @@ -118,6 +118,8 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe [$OMPI_USING_INTERNAL_PRRTE], [Whether or not we are using the internal PRRTE]) + AM_CONDITIONAL(OMPI_USING_INTERNAL_PRRTE, [test $OMPI_USING_INTERNAL_PRRTE -eq 1]) + AC_SUBST(OMPI_PRRTE_RST_CONTENT_DIR) AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR) AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1]) diff --git a/ompi/tools/mpirun/Makefile.am b/ompi/tools/mpirun/Makefile.am index 0c64ca4766f..48cda6f1075 100644 --- a/ompi/tools/mpirun/Makefile.am +++ b/ompi/tools/mpirun/Makefile.am @@ -31,8 +31,11 @@ mpirun_SOURCES = \ # 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 +if OMPI_USING_INTERNAL_PRRTE +mpirun_LDADD += \ $(top_builddir)/3rd-party/prrte/src/libompi-prrte.la +endif 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 d68133e3a76..35982ffbe28 100644 --- a/ompi/tools/mpirun/help-mpirun.txt +++ b/ompi/tools/mpirun/help-mpirun.txt @@ -14,4 +14,16 @@ Open MPI's mpirun command was unable to launch the user's application. This may indicate an issue with the environment or incorrect configuration. -Error Message: %s \ No newline at end of file +Error Message: %s + +[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: + + Command: %s + Error Message: %s diff --git a/ompi/tools/mpirun/main.c b/ompi/tools/mpirun/main.c index dc31f0220b5..bc4cfed3882 100644 --- a/ompi/tools/mpirun/main.c +++ b/ompi/tools/mpirun/main.c @@ -28,7 +28,9 @@ #include "opal/util/printf.h" #include "opal/util/show_help.h" #include "ompi/constants.h" +#if OMPI_USING_INTERNAL_PRRTE #include "3rd-party/prrte/include/prte.h" +#endif static void append_prefixes(char ***out, const char *in) @@ -78,6 +80,10 @@ static void setup_mca_prefixes(void) } +#if OMPI_USING_INTERNAL_PRRTE + +/* we can use prte_launch */ + int main(int argc, char *argv[]) { char *opal_prefix = getenv("OPAL_PREFIX"); @@ -105,9 +111,7 @@ int main(int argc, char *argv[]) /* as a special case, if OPAL_PREFIX was set and either PRRTE or * PMIx are internal builds, set their prefix variables as well */ if (NULL != opal_prefix) { -#if OMPI_USING_INTERNAL_PRRTE setenv("PRTE_PREFIX", opal_prefix, 1); -#endif #if OPAL_USING_INTERNAL_PMIX setenv("PMIX_PREFIX", opal_prefix, 1); #endif @@ -134,27 +138,110 @@ int main(int argc, char *argv[]) return 0; } -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2017-2020 Intel, Inc. All rights reserved. - * Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2021 Nanook Consulting. All rights reserved. - * Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved. - * Copyright (c) 2022 Triad National Security, LLC. All rights - * reserved. - - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ \ No newline at end of file +#else + +/* using external prrte so cannot assume there's a prte_launch */ + +static char *find_prterun(void) +{ + char *filename = NULL; + char *prrte_prefix = NULL; + + /* 1) Did the user tell us exactly where to find prterun? */ + filename = getenv("OMPI_PRTERUN"); + if (NULL != filename) { + return filename; + } + + /* 2) 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 +} + +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) { + fprintf(stderr, "Failed initializing opal: %d\n", ret); + exit(1); + } + + /* note that we just modify our environment rather than create a + * child environment because it is easier and we're not going to + * be around long enough for it to matter (since we exec prterun + * asap */ + setenv("PRTE_MCA_schizo_proxy", "ompi", 1); + setenv("OMPI_VERSION", OMPI_VERSION, 1); + char *base_tool_name = opal_basename(argv[0]); + setenv("OMPI_TOOL_NAME", base_tool_name, 1); + free(base_tool_name); + + /* TODO: look for --prefix and compare with OPAL_PREFIX and pick + * one */ + + /* as a special case, if OPAL_PREFIX was set and either PRRTE or + * PMIx are internal builds, set their prefix variables as well */ + if (NULL != opal_prefix) { +#if OPAL_USING_INTERNAL_PMIX + setenv("PMIX_PREFIX", opal_prefix, 1); +#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 + */ + + setenv("OMPI_LIBDIR_LOC", opal_install_dirs.libdir, 1); + + // Set environment variable to tell PRTE what MCA prefixes belong + // 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"); + } + + /* 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); +} +#endif /* OMPI_USING_INTERNAL_PRRTE */ + From b652fa07bad78736c61951b9db51d28728ab708f Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Thu, 10 Jul 2025 16:16:16 -0600 Subject: [PATCH 6/6] configury: add check for prte_launch being available for the selected prrte (external or internal). Signed-off-by: Howard Pritchard --- config/ompi_setup_prrte.m4 | 14 ++++++++++++++ ompi/tools/mpirun/main.c | 13 ++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 index bdc5821ec47..e9071ac0001 100644 --- a/config/ompi_setup_prrte.m4 +++ b/config/ompi_setup_prrte.m4 @@ -21,6 +21,8 @@ dnl Copyright (c) 2021 Nanook Consulting. All rights reserved. dnl Copyright (c) 2021-2022 IBM Corporation. All rights reserved. dnl Copyright (c) 2023-2024 Jeffrey M. Squyres. All rights reserved. dnl Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. +dnl Copyright (c) 2025 Triad National Security, LLC. All rights +dnl reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -98,6 +100,7 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"], [opal_prrte_mode="internal" OMPI_USING_INTERNAL_PRRTE=1 + OMPI_HAVE_PRTE_LAUNCH=1 _OMPI_SETUP_PRRTE_INTERNAL_POST()], [OMPI_USING_INTERNAL_PRRTE=0]) @@ -124,6 +127,9 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR) AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1]) + AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], $OMPI_HAVE_PRTE_LAUNCH, + [Whether prte_launch support available]) + OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode]) OPAL_VAR_SCOPE_POP @@ -197,6 +203,9 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [ opal_prrte_CPPFLAGS_save="${CPPFLAGS}" OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}]) + AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], [1], + [prte_launch support available in ompi (aka internal) prrte]) + AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ @@ -299,6 +308,11 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [ AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"], [setup_prrte_external_happy="no"])]) + AS_IF([test "${setup_prrte_external_happy}" = "yes"], + [AC_CHECK_DECL([prte_launch], + [OMPI_HAVE_PRTE_LAUNCH=1], [OMPI_HAVE_PRTE_LAUNCH=0], + [#include "prte.h"])],[]) + CPPFLAGS="$opal_prrte_CPPFLAGS_save" # If an external build and the user told us where to find PRRTE, diff --git a/ompi/tools/mpirun/main.c b/ompi/tools/mpirun/main.c index bc4cfed3882..35007930445 100644 --- a/ompi/tools/mpirun/main.c +++ b/ompi/tools/mpirun/main.c @@ -80,7 +80,7 @@ static void setup_mca_prefixes(void) } -#if OMPI_USING_INTERNAL_PRRTE +#if OMPI_HAVE_PRTE_LAUNCH /* we can use prte_launch */ @@ -111,7 +111,9 @@ int main(int argc, char *argv[]) /* as a special case, if OPAL_PREFIX was set and either PRRTE or * PMIx are internal builds, set their prefix variables as well */ if (NULL != opal_prefix) { +#if OMPI_USING_INTERNAL_PRRTE setenv("PRTE_PREFIX", opal_prefix, 1); +#endif #if OPAL_USING_INTERNAL_PMIX setenv("PMIX_PREFIX", opal_prefix, 1); #endif @@ -140,8 +142,6 @@ int main(int argc, char *argv[]) #else -/* using external prrte so cannot assume there's a prte_launch */ - static char *find_prterun(void) { char *filename = NULL; @@ -202,6 +202,9 @@ int main(int argc, char *argv[]) /* as a special case, if OPAL_PREFIX was set and either PRRTE or * PMIx are internal builds, set their prefix variables as well */ if (NULL != opal_prefix) { +#if OMPI_USING_INTERNAL_PRRTE + setenv("PRTE_PREFIX", opal_prefix, 1); +#endif #if OPAL_USING_INTERNAL_PMIX setenv("PMIX_PREFIX", opal_prefix, 1); #endif @@ -237,11 +240,11 @@ int main(int argc, char *argv[]) * 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); } -#endif /* OMPI_USING_INTERNAL_PRRTE */ +#endif /* OMPI_HAVE_PRTE_LAUNCH */