Skip to content

Commit 75b7ef9

Browse files
committed
coll/libnbc: fix nbc_ireduce when sendbuf == recvbuf
if sendbuf is equal to recvbuf, that should not be interpreted as equivalent to MPI_IN_PLACE on the non root rank(s) Thanks Valentin Petrov for the report
1 parent 2969235 commit 75b7ef9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ompi/mca/coll/libnbc/nbc_ireduce.c

+4
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ static inline int red_sched_binomial (int rank, int p, int root, const void *sen
309309
RANK2VRANK(rank, vrank, vroot);
310310
maxr = (int)ceil((log((double)p)/LOG2));
311311

312+
if (rank != root) {
313+
inplace = 0;
314+
}
315+
312316
/* ensure the result ends up in redbuf on vrank 0 */
313317
if (0 == (maxr%2)) {
314318
rbuf = (void *)(-gap);

0 commit comments

Comments
 (0)