From: degomme Date: Mon, 31 Oct 2016 08:31:20 +0000 (+0100) Subject: handle MPI_IN_PLACE for this collective X-Git-Tag: v3_14~271^2~5 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/75556c3d1492aad51984b9fea657dcde33e44705?hp=6a7a5e668b9652e14a3e48b318743e9f9a0c720e handle MPI_IN_PLACE for this collective --- diff --git a/src/smpi/colls/reduce-scatter-gather.c b/src/smpi/colls/reduce-scatter-gather.c index 98f2a097fa..38db76025b 100644 --- a/src/smpi/colls/reduce-scatter-gather.c +++ b/src/smpi/colls/reduce-scatter-gather.c @@ -54,7 +54,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, send_ptr = (void *) smpi_get_tmp_sendbuffer(new_count * extent); recv_ptr = (void *) smpi_get_tmp_recvbuffer(new_count * extent); tmp_buf = (void *) smpi_get_tmp_sendbuffer(new_count * extent); - memcpy(send_ptr, sendbuf, extent * count); + memcpy(send_ptr, sendbuf != MPI_IN_PLACE ? sendbuf : recvbuf, extent * count); //if ((rank != root)) smpi_mpi_sendrecv(send_ptr, new_count, datatype, rank, tag, @@ -233,7 +233,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent); //if ((rank != root)) - smpi_mpi_sendrecv(sendbuf, count, datatype, rank, tag, + smpi_mpi_sendrecv(sendbuf != MPI_IN_PLACE ? sendbuf : recvbuf, count, datatype, rank, tag, recvbuf, count, datatype, rank, tag, comm, &status); rem = comm_size - pof2;