Skip to content

Commit dba9ea9

Browse files
committed
squashme: pr feedback
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 0007da5 commit dba9ea9

File tree

3 files changed

+52
-82
lines changed

3 files changed

+52
-82
lines changed

config/ompi_setup_prrte.m4

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
100100
AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"],
101101
[opal_prrte_mode="internal"
102102
OMPI_USING_INTERNAL_PRRTE=1
103-
OMPI_HAVE_PRTE_LAUNCH=1
104103
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
105104
[OMPI_USING_INTERNAL_PRRTE=0])
106105
@@ -127,8 +126,12 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
127126
AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR)
128127
AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1])
129128
130-
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], $OMPI_HAVE_PRTE_LAUNCH,
131-
[Whether prte_launch support available])
129+
dnl
130+
dnl If using external prrte that supports prte_launch or using internal prtte then
131+
dnl set OMPI_HAVE_PRTE_LAUNCH
132+
dnl
133+
AS_IF([test "$setup_pprte_external_has_prte_launch" = "1" -o "$prrte_setup_internal_happy" = "1"],
134+
[AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], [1], [Whether prte_launch support available])])
132135
133136
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode])
134137
@@ -203,9 +206,6 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
203206
opal_prrte_CPPFLAGS_save="${CPPFLAGS}"
204207
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}])
205208
206-
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], [1],
207-
[prte_launch support available in ompi (aka internal) prrte])
208-
209209
AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater])
210210
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pmix_version.h>]],
211211
[[
@@ -310,7 +310,7 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
310310
311311
AS_IF([test "${setup_prrte_external_happy}" = "yes"],
312312
[AC_CHECK_DECL([prte_launch],
313-
[OMPI_HAVE_PRTE_LAUNCH=1], [OMPI_HAVE_PRTE_LAUNCH=0],
313+
[setup_prrte_external_has_prte_launch=1], [setup_pprte_external_has_prte_launch=0],
314314
[#include "prte.h"])],[])
315315
316316
CPPFLAGS="$opal_prrte_CPPFLAGS_save"

ompi/tools/mpirun/help-mpirun.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Open MPI's mpirun command was unable to launch the user's application.
1515
This may indicate an issue with the environment or incorrect configuration.
1616

1717
Error Message: %s
18-
18+
#
1919
[no-prterun-found]
2020
Open MPI's mpirun command was unable to find an underlying prterun
2121
command to execute. Consider setting the OMPI_PRTERUN environment

ompi/tools/mpirun/main.c

Lines changed: 44 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "opal/util/printf.h"
2929
#include "opal/util/show_help.h"
3030
#include "ompi/constants.h"
31-
#if OMPI_USING_INTERNAL_PRRTE
32-
#include "3rd-party/prrte/include/prte.h"
31+
#if OMPI_HAVE_PRTE_LAUNCH
32+
#include "prte.h"
3333
#endif
3434

3535

@@ -79,69 +79,6 @@ static void setup_mca_prefixes(void)
7979
opal_argv_free(tmp);
8080
}
8181

82-
83-
#if OMPI_HAVE_PRTE_LAUNCH
84-
85-
/* we can use prte_launch */
86-
87-
int main(int argc, char *argv[])
88-
{
89-
char *opal_prefix = getenv("OPAL_PREFIX");
90-
int ret;
91-
92-
ret = opal_init_util(&argc, &argv);
93-
if (OMPI_SUCCESS != ret) {
94-
fprintf(stderr, "Failed initializing opal: %d\n", ret);
95-
exit(1);
96-
}
97-
98-
/* note that we just modify our environment rather than create a
99-
* child environment because it is easier and we're not going to
100-
* be around long enough for it to matter (since we exec prterun
101-
* asap */
102-
setenv("PRTE_MCA_schizo_proxy", "ompi", 1);
103-
setenv("OMPI_VERSION", OMPI_VERSION, 1);
104-
char *base_tool_name = opal_basename(argv[0]);
105-
setenv("OMPI_TOOL_NAME", base_tool_name, 1);
106-
free(base_tool_name);
107-
108-
/* TODO: look for --prefix and compare with OPAL_PREFIX and pick
109-
* one */
110-
111-
/* as a special case, if OPAL_PREFIX was set and either PRRTE or
112-
* PMIx are internal builds, set their prefix variables as well */
113-
if (NULL != opal_prefix) {
114-
#if OMPI_USING_INTERNAL_PRRTE
115-
setenv("PRTE_PREFIX", opal_prefix, 1);
116-
#endif
117-
#if OPAL_USING_INTERNAL_PMIX
118-
setenv("PMIX_PREFIX", opal_prefix, 1);
119-
#endif
120-
}
121-
122-
/*
123-
* set environment variable for our install location
124-
* used within the OMPI prrte schizo component
125-
*/
126-
127-
setenv("OMPI_LIBDIR_LOC", opal_install_dirs.libdir, 1);
128-
129-
// Set environment variable to tell PRTE what MCA prefixes belong
130-
// to Open MPI.
131-
setup_mca_prefixes();
132-
133-
134-
ret = prte_launch(argc, argv);
135-
if (OMPI_SUCCESS != ret) {
136-
opal_show_help("help-mpirun.txt", "prte-launch-failed", 1, strerror(errno));
137-
exit(1);
138-
}
139-
140-
return 0;
141-
}
142-
143-
#else
144-
14582
static char *find_prterun(void)
14683
{
14784
char *filename = NULL;
@@ -210,23 +147,33 @@ int main(int argc, char *argv[])
210147
#endif
211148
}
212149

213-
full_prterun_path = find_prterun();
214-
if (NULL == full_prterun_path) {
215-
opal_show_help("help-mpirun.txt", "no-prterun-found", 1);
216-
exit(1);
217-
}
218-
219150
/*
220151
* set environment variable for our install location
221152
* used within the OMPI prrte schizo component
222153
*/
223-
224154
setenv("OMPI_LIBDIR_LOC", opal_install_dirs.libdir, 1);
225155

226156
// Set environment variable to tell PRTE what MCA prefixes belong
227157
// to Open MPI.
228158
setup_mca_prefixes();
229159

160+
#if OMPI_HAVE_PRTE_LAUNCH
161+
162+
ret = prte_launch(argc, argv);
163+
if (OMPI_SUCCESS != ret) {
164+
opal_show_help("help-mpirun.txt", "prte-launch-failed", 1, strerror(errno));
165+
exit(1);
166+
}
167+
168+
return 0;
169+
#else
170+
171+
full_prterun_path = find_prterun();
172+
if (NULL == full_prterun_path) {
173+
opal_show_help("help-mpirun.txt", "no-prterun-found", 1);
174+
exit(1);
175+
}
176+
230177
/* calling mpirun (and now prterun) with a full path has a special
231178
* meaning in terms of -prefix behavior, so copy that behavior
232179
* into prterun */
@@ -245,6 +192,29 @@ int main(int argc, char *argv[])
245192
opal_show_help("help-mpirun.txt", "prterun-exec-failed",
246193
1, full_prterun_path, strerror(errno));
247194
exit(1);
195+
#endif /* OMPI_HAVE_PRTE_LAUNCH*/
248196
}
249-
#endif /* OMPI_HAVE_PRTE_LAUNCH */
250-
197+
/*
198+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
199+
* University Research and Technology
200+
* Corporation. All rights reserved.
201+
* Copyright (c) 2004-2005 The University of Tennessee and The University
202+
* of Tennessee Research Foundation. All rights
203+
* reserved.
204+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
205+
* University of Stuttgart. All rights reserved.
206+
* Copyright (c) 2004-2005 The Regents of the University of California.
207+
* All rights reserved.
208+
* Copyright (c) 2017-2020 Intel, Inc. All rights reserved.
209+
* Copyright (c) 2020-2022 Cisco Systems, Inc. All rights reserved
210+
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
211+
* Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
212+
* Copyright (c) 2022-2025 Triad National Security, LLC. All rights
213+
* reserved.
214+
215+
* $COPYRIGHT$
216+
*
217+
* Additional copyrights may follow
218+
*
219+
* $HEADER$
220+
*/

0 commit comments

Comments
 (0)