Skip to content

Commit d9fc88c

Browse files
author
Ralph Castain
authored
Merge pull request #2733 from rhc54/topic/dvm
Cleanup DVM leaks
2 parents 5c87fc1 + b55c032 commit d9fc88c

File tree

4 files changed

+53
-7
lines changed

4 files changed

+53
-7
lines changed

orte/mca/iof/base/iof_base_frame.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ static void orte_iof_base_sink_construct(orte_iof_sink_t* ptr)
239239
static void orte_iof_base_sink_destruct(orte_iof_sink_t* ptr)
240240
{
241241
OPAL_OUTPUT_VERBOSE((20, orte_iof_base_framework.framework_output,
242-
"%s iof: closing sink for process %s",
242+
"%s iof: closing sink for process %s on fd %d",
243243
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
244-
ORTE_NAME_PRINT(&ptr->name)));
244+
ORTE_NAME_PRINT(&ptr->name), ptr->wev->fd));
245245
if (NULL != ptr->wev && 0 <= ptr->wev->fd) {
246246
OBJ_RELEASE(ptr->wev);
247247
}
@@ -303,7 +303,6 @@ static void orte_iof_base_write_event_destruct(orte_iof_write_event_t* wev)
303303
return;
304304
}
305305
}
306-
307306
if (2 < wev->fd) {
308307
OPAL_OUTPUT_VERBOSE((20, orte_iof_base_framework.framework_output,
309308
"%s iof: closing fd %d for write event",

orte/mca/iof/hnp/iof_hnp.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ static int hnp_output(const orte_process_name_t* peer,
7272
orte_iof_tag_t source_tag,
7373
const char *msg);
7474

75+
static void hnp_complete(const orte_job_t *jdata);
76+
7577
static int finalize(void);
7678

7779
static int hnp_ft_event(int state);
@@ -88,6 +90,7 @@ orte_iof_base_module_t orte_iof_hnp_module = {
8890
.pull = hnp_pull,
8991
.close = hnp_close,
9092
.output = hnp_output,
93+
.complete = hnp_complete,
9194
.finalize = finalize,
9295
.ft_event = hnp_ft_event
9396
};
@@ -176,7 +179,8 @@ static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag,
176179
return ORTE_ERR_NOT_FOUND;
177180
}
178181
/* setup any requested output files */
179-
if (ORTE_SUCCESS != (rc = orte_iof_base_setup_output_files(dst_name, jdata, proct, &stdoutsink, &stderrsink, &stddiagsink))) {
182+
if (ORTE_SUCCESS != (rc = orte_iof_base_setup_output_files(dst_name, jdata, proct,
183+
&stdoutsink, &stderrsink, &stddiagsink))) {
180184
ORTE_ERROR_LOG(rc);
181185
return rc;
182186
}
@@ -422,6 +426,19 @@ static int hnp_close(const orte_process_name_t* peer,
422426
return ORTE_SUCCESS;
423427
}
424428

429+
static void hnp_complete(const orte_job_t *jdata)
430+
{
431+
orte_iof_proc_t *proct, *next;
432+
433+
/* cleanout any lingering sinks */
434+
OPAL_LIST_FOREACH_SAFE(proct, next, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
435+
if (jdata->jobid == proct->name.jobid) {
436+
opal_list_remove_item(&mca_iof_hnp_component.procs, &proct->super);
437+
OBJ_RELEASE(proct);
438+
}
439+
}
440+
}
441+
425442
static int finalize(void)
426443
{
427444
orte_iof_write_event_t *wev;

orte/mca/iof/orted/iof_orted.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ static int orted_output(const orte_process_name_t* peer,
7373
orte_iof_tag_t source_tag,
7474
const char *msg);
7575

76+
static void orted_complete(const orte_job_t *jdata);
77+
7678
static int finalize(void);
7779

7880
static int orted_ft_event(int state);
@@ -91,6 +93,7 @@ orte_iof_base_module_t orte_iof_orted_module = {
9193
.pull = orted_pull,
9294
.close = orted_close,
9395
.output = orted_output,
96+
.complete = orted_complete,
9497
.finalize = finalize,
9598
.ft_event = orted_ft_event
9699
};
@@ -126,7 +129,7 @@ static int orted_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_ta
126129
orte_job_t *jobdat=NULL;
127130
orte_ns_cmp_bitmask_t mask;
128131

129-
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
132+
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
130133
"%s iof:orted pushing fd %d for process %s",
131134
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
132135
fd, ORTE_NAME_PRINT(dst_name)));
@@ -164,7 +167,8 @@ static int orted_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_ta
164167
return ORTE_ERR_NOT_FOUND;
165168
}
166169
/* setup any requested output files */
167-
if (ORTE_SUCCESS != (rc = orte_iof_base_setup_output_files(dst_name, jobdat, proct, &stdoutsink, &stderrsink, &stddiagsink))) {
170+
if (ORTE_SUCCESS != (rc = orte_iof_base_setup_output_files(dst_name, jobdat, proct,
171+
&stdoutsink, &stderrsink, &stddiagsink))) {
168172
ORTE_ERROR_LOG(rc);
169173
return rc;
170174
}
@@ -312,6 +316,19 @@ static int orted_close(const orte_process_name_t* peer,
312316
return ORTE_SUCCESS;
313317
}
314318

319+
static void orted_complete(const orte_job_t *jdata)
320+
{
321+
orte_iof_proc_t *proct, *next;
322+
323+
/* cleanout any lingering sinks */
324+
OPAL_LIST_FOREACH_SAFE(proct, next, &mca_iof_orted_component.procs, orte_iof_proc_t) {
325+
if (jdata->jobid == proct->name.jobid) {
326+
opal_list_remove_item(&mca_iof_orted_component.procs, &proct->super);
327+
OBJ_RELEASE(proct);
328+
}
329+
}
330+
}
331+
315332
static int finalize(void)
316333
{
317334
orte_iof_proc_t *proct;

orte/mca/state/orted/state_orted.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "opal/util/output.h"
2121
#include "opal/dss/dss.h"
22+
#include "opal/mca/pmix/pmix.h"
2223

2324
#include "orte/mca/errmgr/errmgr.h"
2425
#include "orte/mca/iof/base/base.h"
@@ -440,11 +441,23 @@ static void track_procs(int fd, short argc, void *cbdata)
440441
OBJ_RELEASE(pptr); // maintain accounting
441442
}
442443
}
444+
/* tell the IOF that the job is complete */
445+
if (NULL != orte_iof.complete) {
446+
orte_iof.complete(jdata);
447+
}
448+
449+
/* tell the PMIx subsystem the job is complete */
450+
if (NULL != opal_pmix.server_deregister_nspace) {
451+
opal_pmix.server_deregister_nspace(jdata->jobid, NULL, NULL);
452+
}
443453

454+
/* cleanup the job info */
455+
opal_hash_table_set_value_uint32(orte_job_data, jdata->jobid, NULL);
456+
OBJ_RELEASE(jdata);
444457
}
445458
}
446459

447-
cleanup:
460+
cleanup:
448461
OBJ_RELEASE(caddy);
449462
}
450463

0 commit comments

Comments
 (0)