From: Augustin Degomme Date: Sun, 18 Aug 2019 21:35:24 +0000 (+0200) Subject: fix request and coll failing tests X-Git-Tag: v3.24~159 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9bc8a5934f1ae9a6c7d3035098365cd19158ddf1?hp=03ddc53388cef6de01d404ee4817ceb725a7e18c fix request and coll failing tests --- diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index 014737457d..5fafd542f3 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -101,7 +101,7 @@ int PMPI_Igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; - if ((sendbuf == nullptr) || ((comm->rank() == root) && recvbuf == nullptr)) + if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr && recvcount > 0)) return MPI_ERR_BUFFER; if (((sendbuf != MPI_IN_PLACE && sendcount > 0) && (sendtype == MPI_DATATYPE_NULL)) || ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))) @@ -214,7 +214,7 @@ int PMPI_Iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, v MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM, "Iallgather: the communicator cannot be MPI_COMM_NULL"); - CHECK_ARGS(recvbuf == nullptr, MPI_ERR_BUFFER, "Iallgather: param 4 recvbuf cannot be NULL"); + CHECK_ARGS(recvbuf == nullptr && recvcount > 0, MPI_ERR_BUFFER, "Iallgather: param 4 recvbuf cannot be NULL"); CHECK_ARGS(sendbuf == nullptr && sendcount > 0, MPI_ERR_BUFFER, "Iallgather: param 1 sendbuf cannot be NULL when sendcound > 0"); CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE, diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 5090682515..571d4a2fcf 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -173,9 +173,7 @@ int PMPI_Request_free(MPI_Request * request) int retval = 0; smpi_bench_end(); - if (*request == MPI_REQUEST_NULL) { - retval = MPI_ERR_ARG; - } else { + if (*request != MPI_REQUEST_NULL) { simgrid::smpi::Request::unref(request); retval = MPI_SUCCESS; } @@ -830,12 +828,11 @@ int PMPI_Grequest_complete( MPI_Request request){ return simgrid::smpi::Request::grequest_complete(request); } - int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status){ if(request==MPI_REQUEST_NULL){ *flag=1; simgrid::smpi::Status::empty(status); - return MPI_ERR_REQUEST; + return MPI_SUCCESS; } else if (flag==NULL || status ==NULL){ return MPI_ERR_ARG; }