Skip to content
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

Fix finding "prte" for singleton comm_spawn #12390

Merged
merged 1 commit into from
Mar 13, 2024
Merged
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
57 changes: 55 additions & 2 deletions ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Copyright (c) 2014-2020 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
* Copyright (c) 2018-2022 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
Expand Down Expand Up @@ -53,6 +53,7 @@
#include "opal/util/show_help.h"
#include "opal/util/printf.h"
#include "opal/mca/hwloc/base/base.h"
#include "opal/mca/installdirs/base/base.h"
#include "opal/mca/pmix/base/base.h"

#include "ompi/communicator/communicator.h"
Expand Down Expand Up @@ -1974,6 +1975,46 @@ static void set_handler_default(int sig)
sigaction(sig, &act, (struct sigaction *)0);
}

static char *find_prte(void)
jsquyres marked this conversation as resolved.
Show resolved Hide resolved
{
char *filename = NULL;
#if !OMPI_USING_INTERNAL_PRRTE
char *prrte_prefix = NULL;
#endif

/* 1) Did the user tell us exactly where to find prte? */
filename = getenv("OMPI_PRTERUN");
if (NULL != filename) {
return strdup(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%sprte", 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%sprte", 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("prte");

return filename;
#endif
#endif
}

static int start_dvm(char **hostfiles, char **dash_host)
{
pmix_status_t pret;
Expand All @@ -1987,11 +2028,23 @@ static int start_dvm(char **hostfiles, char **dash_host)
pmix_info_t info;
int buffer_length, num_chars_read, chunk;
char *uri;
char *opal_prefix = getenv("OPAL_PREFIX");

/* 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
}

/* find the prte binary using the install_dirs support - this also
* checks to ensure that we can see this executable and it *is* executable by us
*/
cmd = opal_find_absolute_path("prte");
cmd = find_prte();
if (NULL == cmd) {
/* guess we couldn't do it - best to abort */
OMPI_ERROR_LOG(OMPI_ERROR);
Expand Down
Loading