Skip to content

Commit 007c061

Browse files
committed
stream/coll: call MPIR_Allreduce_auto and add a FIXME
It is not safe in MPIX_Allreduce_enqueue to call MPIR_Allreduce_auto in a callback since we can't ensure it does not collide with another on-going collectives.
1 parent 22f110e commit 007c061

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mpi/stream/stream_enqueue.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,12 @@ static void allreduce_enqueue_cb(void *data)
615615
}
616616
}
617617

618-
mpi_errno = MPIR_Allreduce(sendbuf, recvbuf, p->count, p->datatype, p->op, p->comm_ptr, 0);
618+
/* FIXME: it's not safe to issue collective inside a callback.
619+
* IDEA: dup a lightweith communicator that shares the context_id but designate a unique
620+
* nonblocking tag for collectives to use.
621+
*/
622+
mpi_errno = MPIR_Allreduce_auto(sendbuf, recvbuf, p->count, p->datatype, p->op, p->comm_ptr,
623+
MPIR_CSEL_ENTRY__AUTO);
619624
MPIR_Assertp(mpi_errno == MPI_SUCCESS);
620625

621626
if (p->host_recvbuf) {

0 commit comments

Comments
 (0)