Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
enforce a scatter error in some cases
authorAugustin Degomme <augustin.degomme@imag.fr>
Thu, 17 Jul 2014 13:38:45 +0000 (15:38 +0200)
committerAugustin Degomme <augustin.degomme@imag.fr>
Thu, 17 Jul 2014 13:38:45 +0000 (15:38 +0200)
src/smpi/smpi_pmpi.c

index 4d8e218..d0d8b4b 100644 (file)
@@ -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;