Avoid multiple calls to update_registry(). Also added sanity check.
This commit was SVN r6588.
Этот коммит содержится в:
родитель
4c119def85
Коммит
4ab9a924aa
@ -130,6 +130,7 @@ static void update_registry(bit_set changes, struct bproc_node_info_t *ni)
|
|||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
int ret;
|
int ret;
|
||||||
|
int cnt;
|
||||||
char *node_name;
|
char *node_name;
|
||||||
char *user;
|
char *user;
|
||||||
char *group;
|
char *group;
|
||||||
@ -137,19 +138,19 @@ static void update_registry(bit_set changes, struct bproc_node_info_t *ni)
|
|||||||
struct group *grp;
|
struct group *grp;
|
||||||
orte_gpr_value_t *value;
|
orte_gpr_value_t *value;
|
||||||
|
|
||||||
value = OBJ_NEW(orte_gpr_value_t);
|
cnt = num_bits(changes);
|
||||||
value->addr_mode = ORTE_GPR_OVERWRITE | ORTE_GPR_TOKENS_AND;
|
|
||||||
value->segment = strdup(ORTE_NODE_SEGMENT);
|
|
||||||
|
|
||||||
value->cnt = num_bits(changes);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if there's anything to do
|
* Check if there's anything to do
|
||||||
*/
|
*/
|
||||||
if (value->cnt == 0) {
|
if (cnt == 0)
|
||||||
OBJ_RELEASE(value);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
value = OBJ_NEW(orte_gpr_value_t);
|
||||||
|
value->addr_mode = ORTE_GPR_OVERWRITE | ORTE_GPR_TOKENS_AND;
|
||||||
|
value->segment = strdup(ORTE_NODE_SEGMENT);
|
||||||
|
|
||||||
|
value->cnt = cnt;
|
||||||
|
|
||||||
value->keyvals = (orte_gpr_keyval_t**)malloc(value->cnt * sizeof(orte_gpr_keyval_t*));
|
value->keyvals = (orte_gpr_keyval_t**)malloc(value->cnt * sizeof(orte_gpr_keyval_t*));
|
||||||
|
|
||||||
@ -207,6 +208,14 @@ static void update_registry(bit_set changes, struct bproc_node_info_t *ni)
|
|||||||
value->keyvals[idx++]->value.strptr = strdup(node_name);
|
value->keyvals[idx++]->value.strptr = strdup(node_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idx != cnt) {
|
||||||
|
opal_output(0, "soh_bproc: internal error %d != %d\n", idx, cnt);
|
||||||
|
free(node_name);
|
||||||
|
OBJ_RELEASE(value);
|
||||||
|
opal_event_del(&mca_soh_bproc_component.notify_event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ret = orte_schema.get_node_tokens(&value->tokens, &value->num_tokens,
|
ret = orte_schema.get_node_tokens(&value->tokens, &value->num_tokens,
|
||||||
mca_soh_bproc_component.cellid, node_name);
|
mca_soh_bproc_component.cellid, node_name);
|
||||||
|
|
||||||
@ -247,8 +256,10 @@ static int do_update(struct bproc_node_set_t *ns)
|
|||||||
else
|
else
|
||||||
changes = BIT_SET_ALL;
|
changes = BIT_SET_ALL;
|
||||||
|
|
||||||
|
if (!empty_set(changes)) {
|
||||||
update_registry(changes, ni);
|
update_registry(changes, ni);
|
||||||
changed |= !empty_set(changes);
|
changed = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user