From da4b64609d1b4d1829801004cab5ea40ec8b22f1 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 17 Jul 2014 15:38:45 +0200 Subject: [PATCH] enforce a scatter error in some cases --- src/smpi/smpi_pmpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 4d8e218ed6..d0d8b4bc0d 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -1959,7 +1959,10 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, } else if (((smpi_comm_rank(comm)==root) && (sendtype == MPI_DATATYPE_NULL)) || ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) { retval = MPI_ERR_TYPE; - } else { + } else if ((sendbuf == recvbuf) || + ((smpi_comm_rank(comm)==root) && sendcount>0 && (sendbuf == NULL))){ + retval = MPI_ERR_BUFFER; + }else { if (recvbuf == MPI_IN_PLACE) { recvtype=sendtype; -- 2.20.1