Skip to content

Commit 9b7c1ca

Browse files
committed
Forgot to include the check for 0 in the Allreduce case (already got
Reduce and Reduce_scatter) This commit was SVN r6929.
1 parent afdfa70 commit 9b7c1ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ompi/mpi/c/allreduce.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
6262
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
6363
}
6464

65+
/* MPI-1, p114, says that each process must supply at least
66+
one element. But at least the Pallas benchmarks call
67+
MPI_REDUCE with a count of 0. So be sure to handle it. */
68+
69+
if (0 == count) {
70+
return MPI_SUCCESS;
71+
}
72+
6573
/* Invoke the coll component to perform the back-end operation */
6674

6775
err = comm->c_coll.coll_allreduce(sendbuf, recvbuf, count,

0 commit comments

Comments
 (0)