X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b954df99c86d6573276700063c663f676c7cda6e..a4129e0f81724054c885e3242f05996ffa9d501b:/src/smpi/bindings/smpi_pmpi_coll.cpp diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index 415f12692c..c4f8183dca 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -417,7 +417,7 @@ int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, { if (comm == MPI_COMM_NULL) { return MPI_ERR_COMM; - } if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr)) { + } else if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr)) { return MPI_ERR_BUFFER; } else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()){ return MPI_ERR_TYPE; @@ -475,7 +475,7 @@ int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty { if (comm == MPI_COMM_NULL) { return MPI_ERR_COMM; - } if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr)) { + } else if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr)) { return MPI_ERR_BUFFER; } else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()) { return MPI_ERR_TYPE; @@ -534,6 +534,8 @@ int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, M retval = MPI_ERR_ARG; } else if (count < 0){ retval = MPI_ERR_COUNT; + } else if (sendbuf == nullptr || recvbuf == nullptr){ + retval = MPI_ERR_BUFFER; } else { int rank = simgrid::s4u::this_actor::get_pid(); void* sendtmpbuf = sendbuf; @@ -580,6 +582,8 @@ int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, retval = MPI_ERR_ARG; } else if (count < 0){ retval = MPI_ERR_COUNT; + } else if (sendbuf == nullptr || recvbuf == nullptr){ + retval = MPI_ERR_BUFFER; } else { int rank = simgrid::s4u::this_actor::get_pid(); void* sendtmpbuf = sendbuf;