Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finished = inactive
authorAugustin Degomme <adegomme@gmail.com>
Mon, 8 Jun 2020 14:05:42 +0000 (16:05 +0200)
committerAugustin Degomme <adegomme@gmail.com>
Mon, 8 Jun 2020 14:05:42 +0000 (16:05 +0200)
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

index b12e4b0..07e6ba4 100644 (file)
@@ -560,7 +560,7 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) {
 
   Status::empty(status);
   *flag = 1;
 
   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());
     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");
   }
 
   (*request)->print_request("Waiting");
-  if ((*request)->flags_ & MPI_REQ_PREPARED) {
+  if ((*request)->flags_ & (MPI_REQ_PREPARED | MPI_REQ_FINISHED)) {
     Status::empty(status);
     return ret;
   }
     Status::empty(status);
     return ret;
   }