Skip to content

Commit b652fa0

Browse files
committed
configury: add check for prte_launch
being available for the selected prrte (external or internal). Signed-off-by: Howard Pritchard <[email protected]>
1 parent 3c0d3ac commit b652fa0

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

config/ompi_setup_prrte.m4

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ dnl Copyright (c) 2021 Nanook Consulting. All rights reserved.
2121
dnl Copyright (c) 2021-2022 IBM Corporation. All rights reserved.
2222
dnl Copyright (c) 2023-2024 Jeffrey M. Squyres. All rights reserved.
2323
dnl Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
24+
dnl Copyright (c) 2025 Triad National Security, LLC. All rights
25+
dnl reserved.
2426
dnl $COPYRIGHT$
2527
dnl
2628
dnl Additional copyrights may follow
@@ -98,6 +100,7 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
98100
AS_IF([test "$prrte_setup_external_happy" = "0" -a "$prrte_setup_internal_happy" = "1"],
99101
[opal_prrte_mode="internal"
100102
OMPI_USING_INTERNAL_PRRTE=1
103+
OMPI_HAVE_PRTE_LAUNCH=1
101104
_OMPI_SETUP_PRRTE_INTERNAL_POST()],
102105
[OMPI_USING_INTERNAL_PRRTE=0])
103106
@@ -124,6 +127,9 @@ OPAL_VAR_SCOPE_PUSH([prrte_setup_internal_happy prrte_setup_external_happy targe
124127
AC_SUBST(OMPI_SCHIZO_OMPI_RST_CONTENT_DIR)
125128
AM_CONDITIONAL(OMPI_HAVE_PRRTE_RST, [test $OMPI_HAVE_PRRTE_RST -eq 1])
126129
130+
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], $OMPI_HAVE_PRTE_LAUNCH,
131+
[Whether prte_launch support available])
132+
127133
OPAL_SUMMARY_ADD([Miscellaneous], [PRRTE], [], [$opal_prrte_mode])
128134
129135
OPAL_VAR_SCOPE_POP
@@ -197,6 +203,9 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_INTERNAL], [
197203
opal_prrte_CPPFLAGS_save="${CPPFLAGS}"
198204
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${opal_pmix_CPPFLAGS}])
199205
206+
AC_DEFINE_UNQUOTED([OMPI_HAVE_PRTE_LAUNCH], [1],
207+
[prte_launch support available in ompi (aka internal) prrte])
208+
200209
AC_MSG_CHECKING([if PMIx version is 4.0.0 or greater])
201210
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pmix_version.h>]],
202211
[[
@@ -299,6 +308,11 @@ AC_DEFUN([_OMPI_SETUP_PRRTE_EXTERNAL], [
299308
AS_IF([test "${ompi_setup_prrte_cv_version_happy}" = "no"],
300309
[setup_prrte_external_happy="no"])])
301310
311+
AS_IF([test "${setup_prrte_external_happy}" = "yes"],
312+
[AC_CHECK_DECL([prte_launch],
313+
[OMPI_HAVE_PRTE_LAUNCH=1], [OMPI_HAVE_PRTE_LAUNCH=0],
314+
[#include "prte.h"])],[])
315+
302316
CPPFLAGS="$opal_prrte_CPPFLAGS_save"
303317
304318
# If an external build and the user told us where to find PRRTE,

ompi/tools/mpirun/main.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void setup_mca_prefixes(void)
8080
}
8181

8282

83-
#if OMPI_USING_INTERNAL_PRRTE
83+
#if OMPI_HAVE_PRTE_LAUNCH
8484

8585
/* we can use prte_launch */
8686

@@ -111,7 +111,9 @@ int main(int argc, char *argv[])
111111
/* as a special case, if OPAL_PREFIX was set and either PRRTE or
112112
* PMIx are internal builds, set their prefix variables as well */
113113
if (NULL != opal_prefix) {
114+
#if OMPI_USING_INTERNAL_PRRTE
114115
setenv("PRTE_PREFIX", opal_prefix, 1);
116+
#endif
115117
#if OPAL_USING_INTERNAL_PMIX
116118
setenv("PMIX_PREFIX", opal_prefix, 1);
117119
#endif
@@ -140,8 +142,6 @@ int main(int argc, char *argv[])
140142

141143
#else
142144

143-
/* using external prrte so cannot assume there's a prte_launch */
144-
145145
static char *find_prterun(void)
146146
{
147147
char *filename = NULL;
@@ -202,6 +202,9 @@ int main(int argc, char *argv[])
202202
/* as a special case, if OPAL_PREFIX was set and either PRRTE or
203203
* PMIx are internal builds, set their prefix variables as well */
204204
if (NULL != opal_prefix) {
205+
#if OMPI_USING_INTERNAL_PRRTE
206+
setenv("PRTE_PREFIX", opal_prefix, 1);
207+
#endif
205208
#if OPAL_USING_INTERNAL_PMIX
206209
setenv("PMIX_PREFIX", opal_prefix, 1);
207210
#endif
@@ -237,11 +240,11 @@ int main(int argc, char *argv[])
237240
* TODO: Need to handle --prefix rationally here. */
238241
for (i = 1; NULL != argv[i]; i++) {
239242
opal_argv_append_nosize(&prterun_args, argv[i]);
240-
}
243+
}
241244
ret = execv(full_prterun_path, prterun_args);
242245
opal_show_help("help-mpirun.txt", "prterun-exec-failed",
243246
1, full_prterun_path, strerror(errno));
244247
exit(1);
245248
}
246-
#endif /* OMPI_USING_INTERNAL_PRRTE */
249+
#endif /* OMPI_HAVE_PRTE_LAUNCH */
247250

0 commit comments

Comments
 (0)