Skip to content

Commit df5a394

Browse files
authored
Merge pull request #11513 from wckzhang/string_param
Set default values before mca param registration
2 parents 153dee9 + 39d12da commit df5a394

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

ompi/mca/coll/ucc/coll_ucc_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ static int mca_coll_ucc_register(void)
9191
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_READONLY,
9292
&cm->runtime_version);
9393

94+
cm->cls = "";
9495
mca_base_component_var_register(c, "cls",
9596
"Comma separated list of UCC CLS to be used for team creation",
9697
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
9798
OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_READONLY, &cm->cls);
9899

100+
cm->cts = COLL_UCC_CTS_STR;
99101
mca_base_component_var_register(c, "cts",
100102
"Comma separated list of UCC coll types to be enabled",
101103
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,

ompi/mca/io/romio341/src/io_romio341_component.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ mca_io_base_component_2_0_0_t mca_io_romio341_component = {
113113
.io_register_datarep = register_datarep,
114114
};
115115

116-
static char *ompi_io_romio341_version = ROMIO_VERSION_STRING;
117-
static char *ompi_io_romio341_user_configure_params = MCA_io_romio341_USER_CONFIGURE_FLAGS;
118-
static char *ompi_io_romio341_complete_configure_params = MCA_io_romio341_COMPLETE_CONFIGURE_FLAGS;
116+
static char *ompi_io_romio341_version = NULL;
117+
static char *ompi_io_romio341_user_configure_params = NULL;
118+
static char *ompi_io_romio341_complete_configure_params = NULL;
119119

120120
static int register_component(void)
121121
{
@@ -132,18 +132,21 @@ static int register_component(void)
132132
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
133133
OPAL_INFO_LVL_9,
134134
MCA_BASE_VAR_SCOPE_READONLY, &delete_priority_param);
135+
ompi_io_romio341_version = ROMIO_VERSION_STRING;
135136
(void) mca_base_component_var_register(&mca_io_romio341_component.io_version,
136137
"version", "Version of ROMIO", MCA_BASE_VAR_TYPE_STRING,
137138
NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
138139
OPAL_INFO_LVL_9,
139140
MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio341_version);
141+
ompi_io_romio341_user_configure_params = MCA_io_romio341_USER_CONFIGURE_FLAGS;
140142
(void) mca_base_component_var_register(&mca_io_romio341_component.io_version,
141143
"user_configure_params",
142144
"User-specified command line parameters passed to ROMIO's configure script",
143145
MCA_BASE_VAR_TYPE_STRING, NULL, 0,
144146
MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
145147
OPAL_INFO_LVL_9,
146148
MCA_BASE_VAR_SCOPE_READONLY, &ompi_io_romio341_user_configure_params);
149+
ompi_io_romio341_complete_configure_params = MCA_io_romio341_COMPLETE_CONFIGURE_FLAGS;
147150
(void) mca_base_component_var_register(&mca_io_romio341_component.io_version,
148151
"complete_configure_params",
149152
"Complete set of command line parameters passed to ROMIO's configure script",

opal/runtime/opal_params_core.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ int opal_max_thread_in_progress = 1;
8787

8888
static bool opal_register_util_done = false;
8989

90-
/* Basic color options: 30=black, 31=red, 32=green,
91-
* 33=yellow, 34=blue, 35=magenta, 36=cyan, 37=white
92-
* https://en.wikipedia.org/wiki/ANSI_escape_code#Colors */
93-
static char *opal_var_dump_color_string = "name=34,value=32,valid_values=36";
90+
static char *opal_var_dump_color_string = NULL;
9491

9592
static char *opal_var_dump_color_keys[OPAL_VAR_DUMP_COLOR_KEY_COUNT] = {
9693
[OPAL_VAR_DUMP_COLOR_VAR_NAME] = "name",
@@ -258,6 +255,10 @@ int opal_register_util_params(void)
258255
return OPAL_ERR_OUT_OF_RESOURCE;
259256
}
260257

258+
/* Basic color options: 30=black, 31=red, 32=green,
259+
* 33=yellow, 34=blue, 35=magenta, 36=cyan, 37=white
260+
* https://en.wikipedia.org/wiki/ANSI_escape_code#Colors */
261+
opal_var_dump_color_string = "name=34,value=32,valid_values=36";
261262
ret = mca_base_var_register("opal", "opal", NULL, "var_dump_color", string,
262263
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_2, MCA_BASE_VAR_SCOPE_READONLY,
263264
&opal_var_dump_color_string);
@@ -434,13 +435,15 @@ static int parse_color_string(char *color_string, char **key_names,
434435
values_out[k] = NULL;
435436
}
436437

437-
tokens = opal_argv_split(color_string, ',');
438-
if (NULL == tokens) {
439-
return_code = OPAL_ERR_OUT_OF_RESOURCE;
440-
goto end;
438+
if (NULL != color_string) {
439+
tokens = opal_argv_split(color_string, ',');
440+
if (NULL == tokens) {
441+
return_code = OPAL_ERR_OUT_OF_RESOURCE;
442+
goto end;
443+
}
441444
}
442445

443-
for (int i = 0; tokens[i] != NULL; i++) {
446+
for (int i = 0; tokens && tokens[i] != NULL; i++) {
444447
kv = opal_argv_split(tokens[i], '=');
445448
if (NULL == kv) {
446449
return_code = OPAL_ERR_OUT_OF_RESOURCE;

oshmem/mca/scoll/ucc/scoll_ucc_component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ static int ucc_register(void)
9696
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
9797
&cm->ucc_np);
9898

99+
cm->cts = "";
99100
mca_base_component_var_register(c, "cls",
100101
"Comma separated list of UCC CLS to be used for team creation",
101102
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
102103
OPAL_INFO_LVL_6, MCA_BASE_VAR_SCOPE_READONLY,
103104
&cm->cls);
104-
105+
cm->cts = SCOLL_UCC_CTS_STR;
105106
mca_base_component_var_register(c, "cts",
106107
"Comma separated list of UCC coll types to be enabled",
107108
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,

0 commit comments

Comments
 (0)