Plug slot allocation leak
This commit was SVN r26260.
Этот коммит содержится в:
родитель
c5e4b2ab44
Коммит
53bbcf4b5b
@ -183,6 +183,30 @@ static int finalize(void)
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static void cleanup_node(orte_proc_t *proc)
|
||||
{
|
||||
orte_node_t *node;
|
||||
orte_proc_t *p;
|
||||
int i;
|
||||
|
||||
if (NULL == (node = proc->node)) {
|
||||
return;
|
||||
}
|
||||
node->num_procs--;
|
||||
node->slots_inuse--;
|
||||
for (i=0; i < node->procs->size; i++) {
|
||||
if (NULL == (p = (orte_proc_t*)opal_pointer_array_get_item(node->procs, i))) {
|
||||
continue;
|
||||
}
|
||||
if (p->name.jobid == proc->name.jobid &&
|
||||
p->name.vpid == proc->name.vpid) {
|
||||
opal_pointer_array_set_item(node->procs, i, NULL);
|
||||
OBJ_RELEASE(p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void track_procs(int fd, short argc, void *cbdata)
|
||||
{
|
||||
orte_state_caddy_t *caddy = (orte_state_caddy_t*)cbdata;
|
||||
@ -234,6 +258,8 @@ static void track_procs(int fd, short argc, void *cbdata)
|
||||
/* the proc has terminated */
|
||||
pdata->alive = false;
|
||||
pdata->state = ORTE_PROC_STATE_TERMINATED;
|
||||
/* return the allocated slot for reuse */
|
||||
cleanup_node(pdata);
|
||||
/* Clean up the session directory as if we were the process
|
||||
* itself. This covers the case where the process died abnormally
|
||||
* and didn't cleanup its own session directory.
|
||||
@ -253,6 +279,8 @@ static void track_procs(int fd, short argc, void *cbdata)
|
||||
/* the proc has terminated */
|
||||
pdata->alive = false;
|
||||
pdata->state = ORTE_PROC_STATE_TERMINATED;
|
||||
/* return the allocated slot for reuse */
|
||||
cleanup_node(pdata);
|
||||
/* Clean up the session directory as if we were the process
|
||||
* itself. This covers the case where the process died abnormally
|
||||
* and didn't cleanup its own session directory.
|
||||
@ -274,6 +302,8 @@ static void track_procs(int fd, short argc, void *cbdata)
|
||||
*/
|
||||
orte_session_dir_finalize(proc);
|
||||
}
|
||||
/* return the allocated slot for reuse */
|
||||
cleanup_node(pdata);
|
||||
/* track job status */
|
||||
jdata->num_terminated++;
|
||||
if (jdata->num_terminated == jdata->num_procs) {
|
||||
|
@ -244,7 +244,7 @@ static void track_procs(int fd, short argc, void *cbdata)
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
/* pack all the local child vpids and epochs */
|
||||
/* pack all the local child vpids */
|
||||
for (i=0; i < orte_local_children->size; i++) {
|
||||
if (NULL == (pptr = (orte_proc_t*)opal_pointer_array_get_item(orte_local_children, i))) {
|
||||
continue;
|
||||
@ -268,7 +268,9 @@ static void track_procs(int fd, short argc, void *cbdata)
|
||||
goto cleanup;
|
||||
}
|
||||
/* send it */
|
||||
if (0 > (rc = orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, alert, ORTE_RML_TAG_PLM, 0, orte_rml_send_callback, NULL))) {
|
||||
if (0 > (rc = orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, alert,
|
||||
ORTE_RML_TAG_PLM, 0,
|
||||
orte_rml_send_callback, NULL))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
} else {
|
||||
rc = ORTE_SUCCESS;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user