1
1

opal mca: externalize delimiter for base_env_list mca parameters

fixed by Elena, reviewed by MikeD

This commit was SVN r32182.
Этот коммит содержится в:
Mike Dubman 2014-07-09 18:55:49 +00:00
родитель 8ab9b628b5
Коммит 6efc9a7329
2 изменённых файлов: 30 добавлений и 9 удалений

Просмотреть файл

@ -123,12 +123,17 @@ starting your job.
Source: %s
#
[incorrect-env-list-param]
WARNING: The format of MCA parameter "mca_base_env_list" is a semicolon (;) delimited
list of VAR=VAL and/or VAR instances, e.g.: -mca mca_base_env_list 'VAR1=VAL1;VAR2;VAR3=VAL3'...
If a variable, VAR, is listed but not explicitly assigned a value in the command line, VAR will
be assigned the value set in the executing environment.
The following environment variable was listed unassigned in "mca_base_env_list", but was
not found in your environment:
WARNING: The format of "mca_base_env_list" parameter is a delimited list of VAR=VAL or
VAR instances. By default, the delimiter is a semicolon: VAR1=VAL1;VAR2;VAR3=VAL3;...
You can set other via "mca_base_env_list_delimiter" parameter. If the delimiter is a
semicolon, the value of "mca_base_env_list" variable should be quoted to not interfere
with SHELL command line parsing. In the case where a value is not assigned to variable
VAR, the value will be taken from the current environment.
The following environment variable was not found in the environment:
Variable: %s
MCA variable value: %s
#
[incorrect-env-list-sep]
An invalid value was supplied for an MCA variable "mca_base_env_list_delimiter".
The "mca_base_env_list" variable will be ignored.
Value: %s

Просмотреть файл

@ -63,6 +63,7 @@ static char *mca_base_var_override_file = NULL;
static char *mca_base_var_file_prefix = NULL;
static char *mca_base_param_file_path = NULL;
static char *mca_base_env_list = NULL;
static char *mca_base_env_list_sep = ";";
static bool mca_base_var_suppress_override_warning = false;
static opal_list_t mca_base_var_file_values;
static opal_list_t mca_base_var_override_values;
@ -273,14 +274,29 @@ static int mca_base_var_process_env_list(void)
char** tokens;
char* ptr;
char* param, *value;
char sep;
ret = mca_base_var_register ("opal", "mca", "base", "env_list",
"Set SHELL env variables",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY, &mca_base_env_list);
if ((0 > ret) || (NULL == mca_base_env_list)) {
ret = mca_base_var_register ("opal", "mca", "base", "env_list_delimiter",
"Set SHELL env variables delimiter. Default: semicolon ';'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY, &mca_base_env_list_sep);
if (NULL == mca_base_env_list) {
return OPAL_SUCCESS;
}
tokens = opal_argv_split(mca_base_env_list, ';');
sep = ';';
if (NULL != mca_base_env_list_sep) {
if (1 == strlen(mca_base_env_list_sep)) {
sep = mca_base_env_list_sep[0];
} else {
opal_show_help("help-mca-var.txt", "incorrect-env-list-sep",
true, mca_base_env_list_sep);
return OPAL_SUCCESS;
}
}
tokens = opal_argv_split(mca_base_env_list, (int)sep);
if (NULL != tokens) {
for (i = 0; NULL != tokens[i]; i++) {
if (NULL == (ptr = strchr(tokens[i], '='))) {