Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coll/base: call coll_module_disable only once per module #11126

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions ompi/mca/coll/base/coll_base_comm_unselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
* Copyright (c) 2020 BULL S.A.S. All rights reserved.
* Copyright (c) 2022 Computer Architecture and VLSI Systems (CARV)
* Laboratory, ICS Forth. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -40,10 +42,6 @@
#define CLOSE(comm, func) \
do { \
if (NULL != comm->c_coll->coll_ ## func ## _module) { \
if (NULL != comm->c_coll->coll_ ## func ## _module->coll_module_disable) { \
comm->c_coll->coll_ ## func ## _module->coll_module_disable( \
comm->c_coll->coll_ ## func ## _module, comm); \
} \
OBJ_RELEASE(comm->c_coll->coll_ ## func ## _module); \
comm->c_coll->coll_## func = NULL; \
comm->c_coll->coll_## func ## _module = NULL; \
Expand All @@ -52,7 +50,13 @@

int mca_coll_base_comm_unselect(ompi_communicator_t * comm)
{
opal_list_item_t *item;
mca_coll_base_avail_coll_t *avail;

OPAL_LIST_FOREACH(avail, comm->c_coll->module_list, mca_coll_base_avail_coll_t) {
if (NULL != avail->ac_module->coll_module_disable) {
avail->ac_module->coll_module_disable(avail->ac_module, comm);
}
}

CLOSE(comm, allgather);
CLOSE(comm, allgatherv);
Expand Down Expand Up @@ -133,16 +137,13 @@ int mca_coll_base_comm_unselect(ompi_communicator_t * comm)
CLOSE(comm, iagree);
#endif

for (item = opal_list_remove_first(comm->c_coll->module_list);
NULL != item; item = opal_list_remove_first(comm->c_coll->module_list)) {
mca_coll_base_avail_coll_t *avail = (mca_coll_base_avail_coll_t *) item;

if(avail->ac_module) {
OPAL_LIST_FOREACH(avail, comm->c_coll->module_list, mca_coll_base_avail_coll_t) {
if (avail->ac_module) {
OBJ_RELEASE(avail->ac_module);
}
OBJ_RELEASE(avail);
}
OBJ_RELEASE(comm->c_coll->module_list);

OPAL_LIST_RELEASE(comm->c_coll->module_list);

free(comm->c_coll);
comm->c_coll = NULL;
Expand Down