Skip to content

Commit 3f12346

Browse files
authored
Merge pull request #13115 from Petter-Programs/coll_han_alltoall_bugfix
Fix race condition in coll_han_alltoall.c
2 parents 0e1ed32 + 2e02475 commit 3f12346

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ompi/mca/coll/han/coll_han_alltoall.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
4+
* Copyright (c) 2025 Barcelona Supercomputing Center (BSC-CNS). All Rights Reserved.
5+
*
46
* Additional copyrights may follow
57
*
68
* $HEADER$
@@ -369,6 +371,13 @@ int mca_coll_han_alltoall_using_smsc(
369371
ompi_request_wait_all(inter_recv_count, inter_recv_reqs, MPI_STATUS_IGNORE);
370372

371373
cleanup:
374+
375+
/* we may still have neighbors reading directly from our buffer, so we must ensure it is not modified */
376+
if (!ii_push_data)
377+
{
378+
low_comm->c_coll->coll_barrier(low_comm, low_comm->c_coll->coll_barrier_module);
379+
}
380+
372381
for (int jlow=0; jlow<low_size; jlow++) {
373382
if (jlow != low_rank ) {
374383
mca_smsc->unmap_peer_region(sbuf_map_ctx[jlow]);

0 commit comments

Comments
 (0)