Skip to content

Commit 59f304b

Browse files
committed
coll/base: neg. priority cleanup, verbose output improvements
* Print a verbose message if the component was disqualified because of a negative priority. * If a disqualified component provided a module, release it. * Display list of selected components in priority order - During the process of volunteering collective functions for a communicator, print the component name and priority. This will cause the verbose messages to be displayed in reverse priority order (lowest priority first, up to highest). This is helpful when determining which collective components are active in which order for a given communicator. To see the messages you need the following MCA parameter set to 9 or higher: `-mca coll_base_verbose 9` * Adjust verbose for commonly needed verbose output from 10 to 9 to make it easier to access this information.
1 parent f38cc00 commit 59f304b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
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 */

0 commit comments

Comments
 (0)