Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update RMA tests
[simgrid.git] / teshsuite / smpi / mpich3-test / rma / manyrma2.c
index 571d29e..6773919 100644 (file)
@@ -17,7 +17,7 @@
 
 #define MAX_COUNT 65536*4/16
 #define MAX_RMA_SIZE 2  /* 16 in manyrma performance test */
-#define MAX_RUNS 10
+#define MAX_RUNS 8
 #define MAX_ITER_TIME  5.0      /* seconds */
 
 typedef enum { SYNC_NONE = 0,
@@ -112,6 +112,14 @@ int main(int argc, char *argv[])
     MPI_Group_free(&wgroup);
 
     arraysize = maxSz * MAX_COUNT;
+#ifdef USE_WIN_ALLOCATE
+    MPI_Win_allocate(arraysize * sizeof(int), (int) sizeof(int), MPI_INFO_NULL,
+                     MPI_COMM_WORLD, &arraybuffer, &win);
+    if (!arraybuffer) {
+        fprintf(stderr, "Unable to allocate %d words\n", arraysize);
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+#else
     arraybuffer = (int *) malloc(arraysize * sizeof(int));
     if (!arraybuffer) {
         fprintf(stderr, "Unable to allocate %d words\n", arraysize);
@@ -120,6 +128,7 @@ int main(int argc, char *argv[])
 
     MPI_Win_create(arraybuffer, arraysize * sizeof(int), (int) sizeof(int),
                    MPI_INFO_NULL, MPI_COMM_WORLD, &win);
+#endif
 
     if (maxCount > MAX_COUNT) {
         fprintf(stderr, "MaxCount must not exceed %d\n", MAX_COUNT);
@@ -212,6 +221,10 @@ int main(int argc, char *argv[])
 
     MPI_Win_free(&win);
 
+#ifndef USE_WIN_ALLOCATE
+    free(arraybuffer);
+#endif
+
     MPI_Group_free(&accessGroup);
     MPI_Group_free(&exposureGroup);