From: degomme Date: Tue, 18 Nov 2014 07:00:13 +0000 (+0100) Subject: protect these calls to smpi_datatype_size as they are not always relevant X-Git-Tag: v3_12~732^2~206 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e586edc0e2ae33655864f7383d2e7fa3c8d1ccf1 protect these calls to smpi_datatype_size as they are not always relevant --- diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index dd66abcd2d..bbd04baaae 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -1808,7 +1808,7 @@ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, extra->send_size = sendtmpcount*dt_size_send; extra->datatype2 = encode_datatype(recvtype, &known); int dt_size_recv = 1; - if(!known) + if((smpi_comm_rank(comm)==root) && !known) dt_size_recv = smpi_datatype_size(recvtype); extra->recv_size = recvcount*dt_size_recv; @@ -2033,7 +2033,7 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, int known=0; extra->datatype1 = encode_datatype(sendtype, &known); int dt_size_send = 1; - if(!known) + if((smpi_comm_rank(comm)==root) && !known) dt_size_send = smpi_datatype_size(sendtype); extra->send_size = sendcount*dt_size_send; extra->datatype2 = encode_datatype(recvtype, &known);