X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4f377cfbcae89e70585c675eb978c7c8a33dd773..7acbcaa1ca3a7a70fa4d9f7c72f2f46dae6b4820:/src/smpi/smpi_pmpi.c?ds=sidebyside diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index d6938f5f7f..bf9551c1a8 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -1263,18 +1263,18 @@ int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype, //TODO: suboptimal implementation void *recvbuf; int retval; - if ((datatype == MPI_DATATYPE_NULL)||(datatype->has_subtype==1)) { + if (datatype == MPI_DATATYPE_NULL) { retval = MPI_ERR_TYPE; } else if (count < 0) { retval = MPI_ERR_COUNT; } else { - int size = smpi_datatype_size(datatype) * count; + int size = smpi_datatype_get_extent(datatype) * count; recvbuf = xbt_new(char, size); retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status); if(retval==MPI_SUCCESS){ - memcpy(buf, recvbuf, size * sizeof(char)); + smpi_datatype_copy(recvbuf, count, datatype, buf, count, datatype); } xbt_free(recvbuf); @@ -1829,7 +1829,7 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, } else if (op == MPI_OP_NULL) { retval = MPI_ERR_OP; } else { - smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm); + mpi_coll_allreduce_fun(sendbuf, recvbuf, count, datatype, op, comm); retval = MPI_SUCCESS; } #ifdef HAVE_TRACING