From: Martin Quinson Date: Sun, 18 Aug 2019 10:34:26 +0000 (+0200) Subject: MPI_Scatterv: sendcounts and displs params can be NULL on non-root ranks X-Git-Tag: v3.24~170 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7719b33d06af9f4afb28440d67f26f36fea08542?ds=inline MPI_Scatterv: sendcounts and displs params can be NULL on non-root ranks --- diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index fc591d6252..2fb0a1d195 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -360,8 +360,10 @@ int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request) { CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM, "Iscatterv: the communicator cannot be MPI_COMM_NULL"); - CHECK_ARGS(sendcounts == nullptr, MPI_ERR_ARG, "Iscatterv: param 2 sendcounts cannot be NULL"); - CHECK_ARGS(displs == nullptr, MPI_ERR_ARG, "Iscatterv: param 3 displs cannot be NULL"); + CHECK_ARGS((comm->rank() == root) && (sendcounts == nullptr), MPI_ERR_ARG, + "Iscatterv: param 2 sendcounts cannot be NULL on the root rank"); + CHECK_ARGS((comm->rank() == root) && (displs == nullptr), MPI_ERR_ARG, + "Iscatterv: param 3 displs cannot be NULL on the root rank"); CHECK_ARGS((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE, "Iscatterv: The sendtype cannot be NULL on the root rank"); CHECK_ARGS((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,