Skip to content

Commit 6c8aded

Browse files
author
William Zhang
committed
io/romio341: Set default mca param value before registration
Setting the default right before registration is the well known behavior and prevents issues as the pointer can be set to NULL during param deregistration. Signed-off-by: William Zhang <wilzhang.amazon.com>
1 parent d32033c commit 6c8aded

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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",

0 commit comments

Comments
 (0)