X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9201096042d3e409c3a5e795418027266d4008fc..9d8ce6c58ec7d0a682ef47fde0c8199026948bb8:/src/smpi/smpi_pmpi.c diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index d6938f5f7f..4896cd97aa 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);