Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add missing call to MPI_Finalize().
[simgrid.git] / teshsuite / smpi / mpich3-test / rma / rma-contig.c
index 4ca7127..e89b06e 100644 (file)
@@ -1,13 +1,14 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
 /*
- *  (C) 2013 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
+ * Copyright (C) by Argonne National Laboratory
+ *     See COPYRIGHT in top-level directory
  */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <string.h>
 #include <mpi.h>
+#include "mpitest.h"
 
 #define MAX_DATA_SIZE   (1024)
 #define MAX_NUM_ITERATIONS (1024)
@@ -32,15 +33,15 @@ static void run_test(int lock_mode, int lock_assert)
         printf("Synchronization mode: ");
 
         switch (lock_mode) {
-        case MPI_LOCK_EXCLUSIVE:
-            printf("Exclusive lock");
-            break;
-        case MPI_LOCK_SHARED:
-            printf("Shared lock");
-            break;
-        default:
-            printf("Unknown lock");
-            break;
+            case MPI_LOCK_EXCLUSIVE:
+                printf("Exclusive lock");
+                break;
+            case MPI_LOCK_SHARED:
+                printf("Shared lock");
+                break;
+            default:
+                printf("Unknown lock");
+                break;
         }
 
         if (lock_assert & MPI_MODE_NOCHECK)
@@ -102,7 +103,7 @@ static void run_test(int lock_mode, int lock_assert)
 
                 MPI_Win_lock(lock_mode, target_rank, lock_assert, win);
                 MPI_Accumulate(buf, data_size / sizeof(int), MPI_INT, target_rank,
-                               0, data_size / sizeof(int), MPI_INT, MPI_SUM, win);
+                               0, data_size / sizeof(int), MPI_INT, MPI_BXOR, win);
                 MPI_Win_unlock(target_rank, win);
             }
             t_acc = (MPI_Wtime() - t_acc) / num_iter;
@@ -124,17 +125,15 @@ static void run_test(int lock_mode, int lock_assert)
 
 int main(int argc, char **argv)
 {
-    MPI_Init(&argc, &argv);
+    MTest_Init(&argc, &argv);
 
     run_test(MPI_LOCK_EXCLUSIVE, 0);
     run_test(MPI_LOCK_EXCLUSIVE, MPI_MODE_NOCHECK);
     run_test(MPI_LOCK_SHARED, 0);
     run_test(MPI_LOCK_SHARED, MPI_MODE_NOCHECK);
 
+    MTest_Finalize(0);
     MPI_Finalize();
 
-    if (rank == 0)
-        printf(" No Errors\n");
-
     return 0;
 }