Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid marking as finished and deleting requests when passing multiple times inside...
authorAugustin Degomme <degomme@idpann.imag.fr>
Mon, 8 Apr 2013 18:02:31 +0000 (20:02 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Tue, 9 Apr 2013 10:00:52 +0000 (12:00 +0200)
src/smpi/smpi_base.c
src/smpi/smpi_pmpi.c

index c1f8d3a..d7d32fc 100644 (file)
@@ -601,6 +601,7 @@ int smpi_mpi_test(MPI_Request * request, MPI_Status * status) {
     flag = simcall_comm_test((*request)->action);
   if(flag) {
     finish_wait(request, status);
+    request=MPI_REQUEST_NULL;
   }else{
     smpi_empty_status(status);
   }
@@ -806,6 +807,7 @@ int smpi_mpi_waitall(int count, MPI_Request requests[],
       index = smpi_mpi_waitany(count, requests, pstat);
       if (index == MPI_UNDEFINED)
         break;
+      requests[index]=MPI_REQUEST_NULL;
     }
     if (status != MPI_STATUSES_IGNORE) {
       status[index] = *pstat;
@@ -834,6 +836,7 @@ int smpi_mpi_waitsome(int incount, MPI_Request requests[], int *indices,
       if(status != MPI_STATUSES_IGNORE) {
         status[index] = *pstat;
       }
+     requests[index]=MPI_REQUEST_NULL;
     }else{
       return MPI_UNDEFINED;
     }
@@ -858,6 +861,8 @@ int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
          if(status != MPI_STATUSES_IGNORE) {
            status[i] = *pstat;
          }
+         requests[i]=MPI_REQUEST_NULL;
+
       }
     }else{
       count_dead++;
index 52de7c9..b173064 100644 (file)
@@ -1479,7 +1479,7 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
   int valid_count = 0;
   for (i = 0; i < count; i++) {
     MPI_Request req = requests[i];
-    if(req){
+    if(req!=MPI_REQUEST_NULL){
       srcs[valid_count] = req->src;
       dsts[valid_count] = req->dst;
       recvs[valid_count] = req->recv;