Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge remote-tracking branch 'upstream/master'
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / waittestnull.c
index d23c91d..6de71e3 100644 (file)
@@ -7,8 +7,8 @@
 #include "mpi.h"
 #include "mpitest.h"
 
-/* 
- * This program checks that the various MPI_Test and MPI_Wait routines 
+/*
+ * This program checks that the various MPI_Test and MPI_Wait routines
  * allow both null requests and in the multiple completion cases, empty
  * lists of requests.
  */
@@ -17,65 +17,65 @@ int main(int argc, char **argv)
 {
     int errs = 0;
     MPI_Status status, *status_array = 0;
-    int count = 0, flag, idx, rc, errlen, *indices=0, outcnt;
+    int count = 0, flag, idx, rc, errlen, *indices = 0, outcnt;
     MPI_Request *reqs = 0;
     char errmsg[MPI_MAX_ERROR_STRING];
 
     MTest_Init(&argc, &argv);
 
-    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
-    rc = MPI_Testall( count, reqs, &flag, status_array );
+    rc = MPI_Testall(count, reqs, &flag, status_array);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Testall returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Testall returned failure: %s\n", errmsg);
+        errs++;
     }
     else if (!flag) {
-       printf( "MPI_Testall( 0, ... ) did not return a true flag\n") ;
-       errs++;
+        printf("MPI_Testall(0, ...) did not return a true flag\n");
+        errs++;
     }
 
-    rc = MPI_Waitall( count, reqs, status_array );
+    rc = MPI_Waitall(count, reqs, status_array);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Waitall returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Waitall returned failure: %s\n", errmsg);
+        errs++;
     }
 
-    rc = MPI_Testany( count, reqs, &idx, &flag, &status );
+    rc = MPI_Testany(count, reqs, &idx, &flag, &status);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Testany returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Testany returned failure: %s\n", errmsg);
+        errs++;
     }
     else if (!flag) {
-       printf( "MPI_Testany( 0, ... ) did not return a true flag\n") ;
-       errs++;
+        printf("MPI_Testany(0, ...) did not return a true flag\n");
+        errs++;
     }
 
-    rc = MPI_Waitany( count, reqs, &idx, &status );
+    rc = MPI_Waitany(count, reqs, &idx, &status);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Waitany returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Waitany returned failure: %s\n", errmsg);
+        errs++;
     }
 
-    rc = MPI_Testsome( count, reqs, &outcnt, indices, status_array );
+    rc = MPI_Testsome(count, reqs, &outcnt, indices, status_array);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Testsome returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Testsome returned failure: %s\n", errmsg);
+        errs++;
     }
 
-    rc = MPI_Waitsome( count, reqs, &outcnt, indices, status_array );
+    rc = MPI_Waitsome(count, reqs, &outcnt, indices, status_array);
     if (rc != MPI_SUCCESS) {
-       MPI_Error_string( rc, errmsg, &errlen );
-       printf( "MPI_Waitsome returned failure: %s\n", errmsg );
-       errs ++;
+        MPI_Error_string(rc, errmsg, &errlen);
+        printf("MPI_Waitsome returned failure: %s\n", errmsg);
+        errs++;
     }
-    
-    MTest_Finalize( errs );
+
+    MTest_Finalize(errs);
     MPI_Finalize();
     return 0;
 }