Skip to content

Commit 8634a63

Browse files
authored
Merge pull request #1834 from jjhursey/topic/coll-base-verbose
coll/base verbose, and neg priority cleanup
2 parents f38cc00 + 0a09f8b commit 8634a63

File tree

2 files changed

+71
-20
lines changed

2 files changed

+71
-20
lines changed

ompi/mca/coll/base/coll_base_comm_select.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* reserved.
2020
* Copyright (c) 2014 Research Organization for Information Science
2121
* and Technology (RIST). All rights reserved.
22+
* Copyright (c) 2016 IBM Corporation. All rights reserved.
2223
* $COPYRIGHT$
2324
*
2425
* Additional copyrights may follow
@@ -52,6 +53,7 @@ struct avail_coll_t {
5253

5354
int ac_priority;
5455
mca_coll_base_module_2_1_0_t *ac_module;
56+
const char * ac_component_name;
5557
};
5658
typedef struct avail_coll_t avail_coll_t;
5759

@@ -110,7 +112,7 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
110112
int ret;
111113

112114
/* Announce */
113-
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
115+
opal_output_verbose(9, ompi_coll_base_framework.framework_output,
114116
"coll:base:comm_select: new communicator: %s (cid %d)",
115117
comm->c_name, comm->c_contextid);
116118

@@ -143,6 +145,12 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
143145

144146
/* initialize the module */
145147
ret = avail->ac_module->coll_module_enable(avail->ac_module, comm);
148+
149+
opal_output_verbose(9, ompi_coll_base_framework.framework_output,
150+
"coll:base:comm_select: selecting %10s, priority %3d, %s",
151+
avail->ac_component_name, avail->ac_priority,
152+
(OMPI_SUCCESS == ret ? "Enabled": "Disabled") );
153+
146154
if (OMPI_SUCCESS == ret) {
147155

148156
/* copy over any of the pointers */
@@ -295,9 +303,23 @@ static opal_list_t *check_components(opal_list_t * components,
295303
avail = OBJ_NEW(avail_coll_t);
296304
avail->ac_priority = priority;
297305
avail->ac_module = module;
306+
// Point to the string so we don't have to free later
307+
avail->ac_component_name = component->mca_component_name;
298308

299309
opal_list_append(selectable, &avail->super);
300310
}
311+
else {
312+
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
313+
"coll:base:comm_select: component disqualified: %s (priority %d < 0)",
314+
component->mca_component_name, priority );
315+
316+
// If the disqualified collective returned a module make sure we
317+
// release it here, since it will become a leak otherwise.
318+
if( NULL != module ) {
319+
OBJ_RELEASE(module);
320+
module = NULL;
321+
}
322+
}
301323
}
302324

303325
/* If we didn't find any available components, return an error */

ompi/mca/coll/hcoll/coll_hcoll_module.c

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
3+
Copyright (c) 2016 IBM Corporation. All rights reserved.
34
$COPYRIGHT$
45
56
Additional copyrights may follow
@@ -50,6 +51,32 @@ static void mca_coll_hcoll_module_clear(mca_coll_hcoll_module_t *hcoll_module)
5051
hcoll_module->previous_iallgatherv = NULL;
5152
hcoll_module->previous_igatherv = NULL;
5253
hcoll_module->previous_ireduce = NULL;
54+
hcoll_module->previous_ialltoall = NULL;
55+
hcoll_module->previous_ialltoallv = NULL;
56+
57+
hcoll_module->previous_barrier_module = NULL;
58+
hcoll_module->previous_bcast_module = NULL;
59+
hcoll_module->previous_allreduce_module = NULL;
60+
hcoll_module->previous_reduce_module = NULL;
61+
hcoll_module->previous_allgather_module = NULL;
62+
hcoll_module->previous_allgatherv_module = NULL;
63+
hcoll_module->previous_gather_module = NULL;
64+
hcoll_module->previous_gatherv_module = NULL;
65+
hcoll_module->previous_alltoall_module = NULL;
66+
hcoll_module->previous_alltoallv_module = NULL;
67+
hcoll_module->previous_alltoallw_module = NULL;
68+
hcoll_module->previous_reduce_scatter_module = NULL;
69+
hcoll_module->previous_ibarrier_module = NULL;
70+
hcoll_module->previous_ibcast_module = NULL;
71+
hcoll_module->previous_iallreduce_module = NULL;
72+
hcoll_module->previous_ireduce_module = NULL;
73+
hcoll_module->previous_iallgather_module = NULL;
74+
hcoll_module->previous_iallgatherv_module = NULL;
75+
hcoll_module->previous_igatherv_module = NULL;
76+
hcoll_module->previous_ialltoall_module = NULL;
77+
hcoll_module->previous_ialltoallv_module = NULL;
78+
79+
5380
}
5481

5582
static void mca_coll_hcoll_module_construct(mca_coll_hcoll_module_t *hcoll_module)
@@ -63,6 +90,8 @@ void mca_coll_hcoll_mem_release_cb(void *buf, size_t length,
6390
hcoll_mem_unmap(buf, length, cbdata, from_alloc);
6491
}
6592

93+
#define OBJ_RELEASE_IF_NOT_NULL( obj ) if( NULL != (obj) ) OBJ_RELEASE( obj );
94+
6695
static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module)
6796
{
6897
int context_destroyed;
@@ -79,25 +108,25 @@ static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module
79108
destroy hcoll context*/
80109

81110
if (hcoll_module->hcoll_context != NULL){
82-
OBJ_RELEASE(hcoll_module->previous_barrier_module);
83-
OBJ_RELEASE(hcoll_module->previous_bcast_module);
84-
OBJ_RELEASE(hcoll_module->previous_allreduce_module);
85-
OBJ_RELEASE(hcoll_module->previous_allgather_module);
86-
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);
87-
OBJ_RELEASE(hcoll_module->previous_gatherv_module);
88-
OBJ_RELEASE(hcoll_module->previous_alltoall_module);
89-
OBJ_RELEASE(hcoll_module->previous_alltoallv_module);
90-
OBJ_RELEASE(hcoll_module->previous_reduce_module);
91-
92-
OBJ_RELEASE(hcoll_module->previous_ibarrier_module);
93-
OBJ_RELEASE(hcoll_module->previous_ibcast_module);
94-
OBJ_RELEASE(hcoll_module->previous_iallreduce_module);
95-
OBJ_RELEASE(hcoll_module->previous_iallgather_module);
96-
OBJ_RELEASE(hcoll_module->previous_iallgatherv_module);
97-
OBJ_RELEASE(hcoll_module->previous_igatherv_module);
98-
OBJ_RELEASE(hcoll_module->previous_ialltoall_module);
99-
OBJ_RELEASE(hcoll_module->previous_ialltoallv_module);
100-
OBJ_RELEASE(hcoll_module->previous_ireduce_module);
111+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_barrier_module);
112+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_bcast_module);
113+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allreduce_module);
114+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allgather_module);
115+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allgatherv_module);
116+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_gatherv_module);
117+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_alltoall_module);
118+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_alltoallv_module);
119+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_reduce_module);
120+
121+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ibarrier_module);
122+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ibcast_module);
123+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallreduce_module);
124+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallgather_module);
125+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallgatherv_module);
126+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_igatherv_module);
127+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ialltoall_module);
128+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ialltoallv_module);
129+
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ireduce_module);
101130

102131
/*
103132
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);

0 commit comments

Comments
 (0)