Skip to content

Commit 1112744

Browse files
committed
osc/sm: Add MCA parameter to set priority
For some reason, the SM OSC component was one of the few components which did not have an MCA parameter to set priority. This patch fixes that. Signed-off-by: Brian Barrett <[email protected]>
1 parent efec44c commit 1112744

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ompi/mca/osc/sm/osc_sm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ typedef struct ompi_osc_sm_node_state_t ompi_osc_sm_node_state_t;
5353
struct ompi_osc_sm_component_t {
5454
ompi_osc_base_component_t super;
5555

56+
/** Priority of the osc/sm component */
57+
unsigned int priority;
58+
5659
char *backing_directory;
5760
};
5861
typedef struct ompi_osc_sm_component_t ompi_osc_sm_component_t;

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ ompi_osc_sm_module_t ompi_osc_sm_module_template = {
115115

116116
static int component_register (void)
117117
{
118+
char *description_str;
119+
118120
if (0 == access ("/dev/shm", W_OK)) {
119121
mca_osc_sm_component.backing_directory = "/dev/shm";
120122
} else {
@@ -128,6 +130,16 @@ static int component_register (void)
128130
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
129131
MCA_BASE_VAR_SCOPE_READONLY, &mca_osc_sm_component.backing_directory);
130132

133+
mca_osc_sm_component.priority = 100;
134+
opal_asprintf(&description_str, "Priority of the osc/sm component (default: %d)",
135+
mca_osc_sm_component.priority);
136+
(void)mca_base_component_var_register(&mca_osc_sm_component.super.osc_version,
137+
"priority", description_str,
138+
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0, 0,
139+
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_GROUP,
140+
&mca_osc_sm_component.priority);
141+
free(description_str);
142+
131143
return OPAL_SUCCESS;
132144
}
133145

@@ -179,7 +191,7 @@ component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit,
179191
}
180192
}
181193

182-
return 100;
194+
return mca_osc_sm_component.priority;
183195
}
184196

185197

0 commit comments

Comments
 (0)