Skip to content

Commit 10c93a1

Browse files
committed
Ensure proper handling of default MCA param files
Update PMIx/PRRTE to ensure we pickup the default system and user MCA param definitions during PMIx_server_setup_application so they get propagated. Protect OPAL's MCA var processing so it doesn't try to process a NULL filename when PMIx provides the params for it. Signed-off-by: Ralph Castain <rhc@pmix.org>
1 parent 0fa7ead commit 10c93a1

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

opal/mca/base/mca_base_var.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ int mca_base_var_init(void)
297297
return OPAL_ERROR;
298298
}
299299

300+
if( NULL == (cwd = getcwd(NULL, 0) )) {
301+
opal_output(0, "Error: Unable to get the current working directory\n");
302+
cwd = strdup(".");
303+
}
304+
300305
/* Set this before we register the parameter, below */
301306

302307
mca_base_var_initialized = true;
@@ -410,20 +415,15 @@ int mca_base_var_cache_files(bool rel_path_search)
410415
char *tmp;
411416
int ret;
412417

413-
if (NULL == cwd) {
414-
cwd = (char *) malloc(sizeof(char) * MAXPATHLEN);
415-
if( NULL == (cwd = getcwd(cwd, MAXPATHLEN) )) {
416-
opal_output(0, "Error: Unable to get the current working directory\n");
417-
cwd = strdup(".");
418-
}
418+
if (NULL != getenv("OPAL_USER_PARAMS_GIVEN")) {
419+
/* PMIx already provided the params for us */
420+
return OPAL_SUCCESS;
419421
}
420422

421423
#if OPAL_WANT_HOME_CONFIG_FILES
422-
if (NULL == getenv("OPAL_USER_PARAMS_GIVEN")) {
423-
opal_asprintf(&mca_base_var_files, "%s"OPAL_PATH_SEP".openmpi" OPAL_PATH_SEP
424-
"mca-params.conf%c%s" OPAL_PATH_SEP "openmpi-mca-params.conf",
425-
home, ',', opal_install_dirs.sysconfdir);
426-
}
424+
opal_asprintf(&mca_base_var_files, "%s"OPAL_PATH_SEP".openmpi" OPAL_PATH_SEP
425+
"mca-params.conf%c%s" OPAL_PATH_SEP "openmpi-mca-params.conf",
426+
home, ',', opal_install_dirs.sysconfdir);
427427
#else
428428
opal_asprintf(&mca_base_var_files, "%s" OPAL_PATH_SEP "openmpi-mca-params.conf",
429429
opal_install_dirs.sysconfdir);

0 commit comments

Comments
 (0)