Skip to content

Commit ce5a5f4

Browse files
authored
Merge pull request #11284 from shimmybalsam/ucc_team_destroy_nb
coll/ucc: updating team desroy as nonblocking
2 parents e89ef82 + 93c04f4 commit ce5a5f4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ompi/mca/coll/ucc/coll_ucc_module.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ static int mca_coll_ucc_save_coll_handlers(mca_coll_ucc_module_t *ucc_module)
186186
*/
187187
static int ucc_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, void *extra)
188188
{
189-
190189
mca_coll_ucc_module_t *ucc_module = (mca_coll_ucc_module_t*) attr_val;
191-
ucc_team_destroy(ucc_module->ucc_team);
190+
ucc_status_t status;
191+
while(UCC_INPROGRESS == (status = ucc_team_destroy(ucc_module->ucc_team))) {}
192192
if (ucc_module->comm == &ompi_mpi_comm_world.comm) {
193193
if (mca_coll_ucc_component.libucc_initialized) {
194194
UCC_VERBOSE(1,"finalizing ucc library");
@@ -197,6 +197,10 @@ static int ucc_comm_attr_del_fn(MPI_Comm comm, int keyval, void *attr_val, void
197197
ucc_finalize(mca_coll_ucc_component.ucc_lib);
198198
}
199199
}
200+
if (UCC_OK != status) {
201+
UCC_ERROR("UCC team destroy failed");
202+
return OMPI_ERROR;
203+
}
200204
return OMPI_SUCCESS;
201205
}
202206

oshmem/mca/scoll/ucc/scoll_ucc_module.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ int mca_scoll_ucc_progress(void)
5050

5151
static void mca_scoll_ucc_module_destruct(mca_scoll_ucc_module_t *ucc_module)
5252
{
53+
ucc_status_t status;
5354
if (ucc_module->ucc_team) {
54-
ucc_team_destroy(ucc_module->ucc_team);
55+
while(UCC_INPROGRESS == (status = ucc_team_destroy(ucc_module->ucc_team))) {}
56+
if (status != UCC_OK) {
57+
UCC_ERROR("UCC team destroy failed");
58+
}
5559
MCA_MEMHEAP_CALL(private_free(ucc_module->pSync));
5660
--mca_scoll_ucc_component.nr_modules;
5761
}

0 commit comments

Comments
 (0)