Skip to content

Commit a012ee9

Browse files
authored
Merge pull request #5886 from yosefe/topic/osc-ucx-fix-finalize-hang
osc_ucx: fix hang/timeout in component finalize
2 parents 9a36555 + dc68094 commit a012ee9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ static int component_init(bool enable_progress_threads, bool enable_mpi_threads)
131131
return OMPI_SUCCESS;
132132
}
133133

134+
static void component_world_barrier(void)
135+
{
136+
ompi_communicator_t *comm = &ompi_mpi_comm_world.comm;
137+
opal_progress_register(progress_callback);
138+
comm->c_coll->coll_barrier(comm, comm->c_coll->coll_barrier_module);
139+
opal_progress_unregister(progress_callback);
140+
}
141+
134142
static int component_finalize(void) {
135143
int i;
136144
for (i = 0; i < ompi_proc_world_size(); i++) {
@@ -140,7 +148,9 @@ static int component_finalize(void) {
140148
}
141149
}
142150

151+
assert(mca_osc_ucx_component.num_modules == 0);
143152
if (mca_osc_ucx_component.ucp_worker != NULL) {
153+
component_world_barrier();
144154
ucp_worker_destroy(mca_osc_ucx_component.ucp_worker);
145155
}
146156

0 commit comments

Comments
 (0)