From 5d738e328b0d1214fab07f81ffbc9b45406f98aa Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Mon, 8 Jun 2020 16:05:42 +0200 Subject: [PATCH] Finished = inactive One is allowed to call MPI_WAIT with a null or inactive request argument. In this case the operation returns immediately with empty status. --- src/smpi/mpi/smpi_request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index b12e4b0a75..07e6ba4660 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -560,7 +560,7 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) { Status::empty(status); *flag = 1; - if (((*request)->flags_ & MPI_REQ_PREPARED) == 0) { + if (((*request)->flags_ & (MPI_REQ_PREPARED | MPI_REQ_FINISHED)) == 0) { if ((*request)->action_ != nullptr && (*request)->cancelled_ != 1){ try{ *flag = simcall_comm_test((*request)->action_.get()); @@ -910,7 +910,7 @@ int Request::wait(MPI_Request * request, MPI_Status * status) } (*request)->print_request("Waiting"); - if ((*request)->flags_ & MPI_REQ_PREPARED) { + if ((*request)->flags_ & (MPI_REQ_PREPARED | MPI_REQ_FINISHED)) { Status::empty(status); return ret; } -- 2.20.1