Skip to content

Commit 25a3e27

Browse files
author
rhc54
authored
Merge pull request #2542 from rhc54/topic/ashley
Correctly cleanup the local children and node map info on remote orte…
2 parents 309c967 + e1aa793 commit 25a3e27

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

orte/mca/state/orted/state_orted.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static void track_procs(int fd, short argc, void *cbdata)
252252
orte_job_t *jdata;
253253
orte_proc_t *pdata, *pptr;
254254
opal_buffer_t *alert;
255-
int rc, i;
255+
int rc, i, j;
256256
orte_plm_cmd_flag_t cmd;
257257
char *rtmod;
258258

@@ -416,6 +416,31 @@ static void track_procs(int fd, short argc, void *cbdata)
416416
}
417417
/* mark that we sent it so we ensure we don't do it again */
418418
orte_set_attribute(&jdata->attributes, ORTE_JOB_TERM_NOTIFIED, ORTE_ATTR_LOCAL, NULL, OPAL_BOOL);
419+
/* cleanup the procs as these are gone */
420+
for (i=0; i < orte_local_children->size; i++) {
421+
if (NULL == (pptr = (orte_proc_t*)opal_pointer_array_get_item(orte_local_children, i))) {
422+
continue;
423+
}
424+
/* if this child is part of the job... */
425+
if (pptr->name.jobid == jdata->jobid) {
426+
/* clear the entry in the local children */
427+
opal_pointer_array_set_item(orte_local_children, i, NULL);
428+
/* find it in the node->procs array */
429+
for (j=0; j < pptr->node->procs->size; j++) {
430+
if (NULL == (pdata = (orte_proc_t*)opal_pointer_array_get_item(pptr->node->procs, j))) {
431+
continue;
432+
}
433+
if (pdata == pptr) {
434+
/* remove it */
435+
opal_pointer_array_set_item(pptr->node->procs, j, NULL);
436+
OBJ_RELEASE(pdata); // maintain accounting
437+
break;
438+
}
439+
}
440+
OBJ_RELEASE(pptr); // maintain accounting
441+
}
442+
}
443+
419444
}
420445
}
421446

orte/orted/pmix/pmix_server_register_fns.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata)
332332
if (NULL == (pptr = (orte_proc_t*)opal_pointer_array_get_item(node->procs, i))) {
333333
continue;
334334
}
335+
/* only consider procs from this job */
336+
if (pptr->name.jobid != jdata->jobid) {
337+
continue;
338+
}
335339
/* setup the proc map object */
336340
kv = OBJ_NEW(opal_value_t);
337341
kv->key = strdup(OPAL_PMIX_PROC_DATA);

0 commit comments

Comments
 (0)