Skip to content

Commit b532564

Browse files
authored
Merge pull request #8041 from brminich/topic/shmem_scoll_fix
SHMEM/SCOLL: Fix inplace reductions
2 parents 21c9c66 + dfe20e0 commit b532564

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oshmem/mca/scoll/mpi/scoll_mpi_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ int mca_scoll_mpi_reduce(struct oshmem_group_t *group,
226226
MPI_COLL_VERBOSE(20,"RUNNING MPI REDUCE");
227227
void *sbuf, *rbuf;
228228
mpi_module = (mca_scoll_mpi_module_t *) group->g_scoll.scoll_reduce_module;
229-
sbuf = (void *) source;
230-
rbuf = target;
231229
dtype = shmem_dtype_to_ompi_dtype(op);
232230
h_op = shmem_op_to_ompi_op(op->op);
233231
count = nlong/op->dt_size;
232+
rbuf = target;
233+
sbuf = (source == target) ? MPI_IN_PLACE : (void*)source;
234234

235235
/* Do nothing on zero-length request */
236236
if (OPAL_UNLIKELY(!nlong)) {

0 commit comments

Comments
 (0)