From e586edc0e2ae33655864f7383d2e7fa3c8d1ccf1 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 18 Nov 2014 08:00:13 +0100 Subject: [PATCH] protect these calls to smpi_datatype_size as they are not always relevant --- src/smpi/smpi_pmpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.20.1