Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change the behavior of mpi_testall to loop over mpi_test and no longer mpi_testany.
[simgrid.git] / src / smpi / smpi_base.c
index 28566f5..458eb84 100644 (file)
@@ -302,7 +302,7 @@ int flag;
    else 
     flag = simcall_comm_test((*request)->action);
    if(flag) {
-        smpi_mpi_wait(request, status);
+       finish_wait(request, status);
     }
     return flag;
 }
@@ -342,6 +342,19 @@ int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
   return flag;
 }
 
+
+int smpi_mpi_testall(int count, MPI_Request requests[],
+                     MPI_Status status[])
+{
+  int flag=1;
+  int i;
+  for(i=0; i<count; i++)
+   if (smpi_mpi_test(&requests[i], &status[i])!=1)
+       flag=0;
+
+  return flag;
+}
+
 void smpi_mpi_probe(int source, int tag, MPI_Comm comm, MPI_Status* status){
   int flag=0;
   //FIXME find another wait to avoid busy waiting ?