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 a bug introduced by PR 11854 #12242

Merged
merged 1 commit into from
Jan 19, 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
28 changes: 15 additions & 13 deletions opal/mca/pmix/base/pmix_base_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static bool check_pmix_overlap(char *var, char *value)
// changes here, there are likely to be changes there.
static void translate_params(void)
{
char *evar, *tmp, *e2;
char *evar = NULL, *tmp, *e2 = NULL;
char *file;
const char *home;
opal_list_t params;
Expand Down Expand Up @@ -193,20 +193,22 @@ static void translate_params(void)
home = opal_home_directory();
if (NULL != home) {
file = opal_os_path(false, home, ".openmpi", "mca-params.conf", NULL);
OBJ_CONSTRUCT(&params, opal_list_t);
mca_base_parse_paramfile(file, &params);
free(file);
OPAL_LIST_FOREACH (fv, &params, mca_base_var_file_value_t) {
pmix_overlap = check_pmix_overlap(&e2[len], evar);
if (!pmix_overlap && check_pmix_param(fv->mbvfv_var)) {
opal_asprintf(&tmp, "PMIX_MCA_%s", fv->mbvfv_var);
// set it, but don't overwrite if they already
// have a value in our environment
setenv(tmp, fv->mbvfv_value, false);
free(tmp);
if (NULL != file) {
OBJ_CONSTRUCT(&params, opal_list_t);
mca_base_parse_paramfile(file, &params);
free(file);
OPAL_LIST_FOREACH (fv, &params, mca_base_var_file_value_t) {
pmix_overlap = check_pmix_overlap(fv->mbvfv_var, fv->mbvfv_value);
if (!pmix_overlap && check_pmix_param(fv->mbvfv_var)) {
opal_asprintf(&tmp, "PMIX_MCA_%s", fv->mbvfv_var);
// set it, but don't overwrite if they already
// have a value in our environment
setenv(tmp, fv->mbvfv_value, false);
free(tmp);
}
}
OPAL_LIST_DESTRUCT(&params);
}
OPAL_LIST_DESTRUCT(&params);
}

/* check if the user has set OMPIHOME in their environment */
Expand Down