From fae8bb2359200e3b42825d648a0e7ffcec168bb1 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 18 Jul 2019 17:03:56 +0200 Subject: [PATCH] Fix the fix of the fix of testsome. --- src/smpi/bindings/smpi_f77_request.cpp | 2 +- src/smpi/mpi/smpi_request.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/smpi/bindings/smpi_f77_request.cpp b/src/smpi/bindings/smpi_f77_request.cpp index 485f062e81..7e128bc0a1 100644 --- a/src/smpi/bindings/smpi_f77_request.cpp +++ b/src/smpi/bindings/smpi_f77_request.cpp @@ -276,7 +276,7 @@ void mpi_testsome_ (int* incount, int* requests, int* outcount, int* indices, M } *ierr = MPI_Testsome(*incount, reqs, outcount, indices, FORT_STATUSES_IGNORE(statuses)); for(i=0;i<*incount;i++){ - if(indices[i] && reqs[indices[i]]==MPI_REQUEST_NULL){ + if(reqs[indices[i]]==MPI_REQUEST_NULL){ simgrid::smpi::Request::free_f(requests[indices[i]]); requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL; } diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 05cdc18c1e..7ae4f42bd1 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -599,10 +599,10 @@ int Request::testsome(int incount, MPI_Request requests[], int *count, int *indi if(ret!=MPI_SUCCESS) error = 1; if(flag) { - indices[i] = 1; - (*count)++; + indices[*count] = i; if (status != MPI_STATUSES_IGNORE) - status[i] = *pstat; + status[*count] = *pstat; + (*count)++; if ((requests[i] != MPI_REQUEST_NULL) && (requests[i]->flags_ & MPI_REQ_NON_PERSISTENT)) requests[i] = MPI_REQUEST_NULL; } -- 2.20.1