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

pmix: Override some of the pmix env if internal component in use #4007

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions opal/mca/pmix/pmix2x/pmix2x_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/types.h"
#include "opal/mca/installdirs/installdirs.h"

#ifdef HAVE_STRING_H
#include <string.h>
Expand Down Expand Up @@ -78,9 +79,17 @@ int pmix2x_client_init(opal_list_t *ilist)
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
}
if ((NULL != (evar = getenv("OPAL_PREFIX"))) &&
(NULL == getenv("PMIX_INSTALL_PREFIX"))) {
if (NULL != (evar = getenv("OPAL_PREFIX"))) {
/* OMPI installation was relocated. We need to propagate this to
* internal PMIx as well
*/
opal_setenv("PMIX_INSTALL_PREFIX", evar, false, &environ);
} else if(NULL != getenv("PMIX_INSTALL_PREFIX")) {
/* we use internal version of PMIx, need to override this
* envar so we wont get corrupted configuration
*/
opal_setenv("PMIX_INSTALL_PREFIX", opal_install_dirs.prefix,
false, &environ);
}
}

Expand Down
13 changes: 11 additions & 2 deletions opal/mca/pmix/pmix2x/pmix2x_server_south.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "opal_config.h"
#include "opal/constants.h"
#include "opal/types.h"
#include "opal/mca/installdirs/installdirs.h"

#ifdef HAVE_STRING_H
#include <string.h>
Expand Down Expand Up @@ -109,9 +110,17 @@ int pmix2x_server_init(opal_pmix_server_module_t *module,
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
}
if ((NULL != (evar = getenv("OPAL_PREFIX"))) &&
(NULL == getenv("PMIX_INSTALL_PREFIX"))) {
if (NULL != (evar = getenv("OPAL_PREFIX"))) {
/* OMPI installation was relocated. We need to propagate this to
* internal PMIx as well
*/
opal_setenv("PMIX_INSTALL_PREFIX", evar, false, &environ);
} else if(NULL != getenv("PMIX_INSTALL_PREFIX")) {
/* we use internal version of PMIx, need to override this
* envar so we wont get corrupted configuration
*/
opal_setenv("PMIX_INSTALL_PREFIX", opal_install_dirs.prefix,
false, &environ);
}
}
++opal_pmix_base.initialized;
Expand Down