Picky, picky, picky...the a-retentive amongst us wants the default value to show in ompi_info! Of all the nerve...
:-) Okay, cleanup the prior commit so that the default component search path shows in ompi_info, and remains available in component_find. This commit was SVN r22278.
Этот коммит содержится в:
родитель
76222eb869
Коммит
70e385bcab
@ -60,6 +60,8 @@ OPAL_DECLSPEC OBJ_CLASS_DECLARATION(mca_base_component_priority_list_item_t);
|
|||||||
* Public variables
|
* Public variables
|
||||||
*/
|
*/
|
||||||
OPAL_DECLSPEC extern int mca_base_param_component_path;
|
OPAL_DECLSPEC extern int mca_base_param_component_path;
|
||||||
|
OPAL_DECLSPEC extern char *mca_base_system_default_path;
|
||||||
|
OPAL_DECLSPEC extern char *mca_base_user_default_path;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public functions
|
* Public functions
|
||||||
|
@ -33,6 +33,14 @@ int mca_base_close(void)
|
|||||||
extern bool mca_base_opened;
|
extern bool mca_base_opened;
|
||||||
if (mca_base_opened) {
|
if (mca_base_opened) {
|
||||||
|
|
||||||
|
/* release the default paths */
|
||||||
|
if (NULL != mca_base_system_default_path) {
|
||||||
|
free(mca_base_system_default_path);
|
||||||
|
}
|
||||||
|
if (NULL != mca_base_user_default_path) {
|
||||||
|
free(mca_base_user_default_path);
|
||||||
|
}
|
||||||
|
|
||||||
/* Close down the component repository */
|
/* Close down the component repository */
|
||||||
mca_base_component_repository_finalize();
|
mca_base_component_repository_finalize();
|
||||||
|
|
||||||
|
@ -250,20 +250,6 @@ static void find_dyn_components(const char *path, const char *type_name,
|
|||||||
component_file_item_t *file;
|
component_file_item_t *file;
|
||||||
opal_list_item_t *cur;
|
opal_list_item_t *cur;
|
||||||
char prefix[32 + MCA_BASE_MAX_TYPE_NAME_LEN], *basename;
|
char prefix[32 + MCA_BASE_MAX_TYPE_NAME_LEN], *basename;
|
||||||
char *system_default;
|
|
||||||
char *user_default=NULL;
|
|
||||||
|
|
||||||
/* copy the default location definitions */
|
|
||||||
#if OPAL_WANT_HOME_CONFIG_FILES
|
|
||||||
system_default = strdup(opal_install_dirs.pkglibdir);
|
|
||||||
asprintf(&user_default, "%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_home_directory());
|
|
||||||
#else
|
|
||||||
# if defined(__WINDOWS__) && defined(_DEBUG)
|
|
||||||
asprintf(&system_default, "%s/debug", opal_install_dirs.pkglibdir);
|
|
||||||
# else
|
|
||||||
asprintf(&system_default, "%s", opal_install_dirs.pkglibdir);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If path is NULL, iterate over the set of directories specified by
|
/* If path is NULL, iterate over the set of directories specified by
|
||||||
the MCA param mca_base_component_path. If path is not NULL, then
|
the MCA param mca_base_component_path. If path is not NULL, then
|
||||||
@ -295,13 +281,15 @@ static void find_dyn_components(const char *path, const char *type_name,
|
|||||||
}
|
}
|
||||||
if ((0 == strcmp(dir, "USER_DEFAULT") ||
|
if ((0 == strcmp(dir, "USER_DEFAULT") ||
|
||||||
0 == strcmp(dir, "USR_DEFAULT"))
|
0 == strcmp(dir, "USR_DEFAULT"))
|
||||||
&& NULL != user_default) {
|
&& NULL != mca_base_user_default_path) {
|
||||||
if (0 != lt_dlforeachfile(user_default, save_filename, NULL)) {
|
if (0 != lt_dlforeachfile(mca_base_user_default_path,
|
||||||
|
save_filename, NULL)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (0 == strcmp(dir, "SYS_DEFAULT") ||
|
} else if (0 == strcmp(dir, "SYS_DEFAULT") ||
|
||||||
0 == strcmp(dir, "SYSTEM_DEFAULT")) {
|
0 == strcmp(dir, "SYSTEM_DEFAULT")) {
|
||||||
if (0 != lt_dlforeachfile(system_default, save_filename, NULL)) {
|
if (0 != lt_dlforeachfile(mca_base_system_default_path,
|
||||||
|
save_filename, NULL)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -313,10 +301,6 @@ static void find_dyn_components(const char *path, const char *type_name,
|
|||||||
} while (NULL != end);
|
} while (NULL != end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(system_default);
|
|
||||||
if (NULL != user_default) {
|
|
||||||
free(user_default);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Look through the list of found files and find those that match
|
/* Look through the list of found files and find those that match
|
||||||
the desired framework name */
|
the desired framework name */
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
*/
|
*/
|
||||||
int mca_base_param_component_path = -1;
|
int mca_base_param_component_path = -1;
|
||||||
bool mca_base_opened = false;
|
bool mca_base_opened = false;
|
||||||
|
char *mca_base_system_default_path=NULL;
|
||||||
|
char *mca_base_user_default_path=NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Private functions
|
* Private functions
|
||||||
@ -65,11 +67,29 @@ int mca_base_open(void)
|
|||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the system and user default paths will be defined in component_find */
|
/* define the system and user default paths */
|
||||||
|
#if OPAL_WANT_HOME_CONFIG_FILES
|
||||||
|
mca_base_system_default_path = strdup(opal_install_dirs.pkglibdir);
|
||||||
|
asprintf(&mca_base_user_default_path, "%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_home_directory());
|
||||||
|
#else
|
||||||
|
# if defined(__WINDOWS__) && defined(_DEBUG)
|
||||||
|
asprintf(&mca_base_system_default_path, "%s/debug", opal_install_dirs.pkglibdir);
|
||||||
|
# else
|
||||||
|
asprintf(&mca_base_system_default_path, "%s", opal_install_dirs.pkglibdir);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* see if the user wants to override the defaults */
|
||||||
|
if (NULL == mca_base_user_default_path) {
|
||||||
|
value = strdup(mca_base_system_default_path);
|
||||||
|
} else {
|
||||||
|
asprintf(&value, "%s%c%s", mca_base_system_default_path,
|
||||||
|
OPAL_ENV_SEP, mca_base_user_default_path);
|
||||||
|
}
|
||||||
mca_base_param_component_path =
|
mca_base_param_component_path =
|
||||||
mca_base_param_reg_string_name("mca", "component_path",
|
mca_base_param_reg_string_name("mca", "component_path",
|
||||||
"Path where to look for Open MPI and ORTE components",
|
"Path where to look for Open MPI and ORTE components",
|
||||||
false, false, "SYSTEM_DEFAULT:USER_DEFAULT", NULL);
|
false, false, value, NULL);
|
||||||
free(value);
|
free(value);
|
||||||
param_index = mca_base_param_reg_string_name("mca", "verbose",
|
param_index = mca_base_param_reg_string_name("mca", "verbose",
|
||||||
"Top-level verbosity parameter",
|
"Top-level verbosity parameter",
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user