Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into clean_events
[simgrid.git] / teshsuite / smpi / isp / umpire / collective-exhaustive-byte-int-mismatch.c
index 4255382..a32b1f4 100644 (file)
@@ -63,14 +63,14 @@ complex_prod (void *inp, void *inoutp, int *len, MPI_Datatype *dptr)
 
   if (*dptr == MPI_BYTE)
     stop = (*len)/(2 * sizeof(double));
-  else 
+  else
     stop = *len;
 
   for (i = 0; i < stop; i++) {
     c.real = inout->real * in->real - inout->imag * in->imag;
     c.imag = inout->real * in->imag + inout->imag * in->real;
     *inout = c;
-    in++; 
+    in++;
     inout++;
   }
 
@@ -104,7 +104,7 @@ main (int argc, char **argv)
 
   buf0 = (int *) malloc (buf_size * nprocs * sizeof(int));
   assert (buf0);
-  for (i = 0; i < buf_size * nprocs; i++) 
+  for (i = 0; i < buf_size * nprocs; i++)
     buf0[i] = rank;
 
 #ifdef RUN_ALLTOALLV
@@ -128,7 +128,7 @@ main (int argc, char **argv)
   if (rank == 0) {
     buf1 = (int *) malloc (buf_size * nprocs * sizeof(int));
     assert (buf1);
-    for (i = 0; i < buf_size * nprocs; i++) 
+    for (i = 0; i < buf_size * nprocs; i++)
       buf1[i] = i;
 
     displs = (int *) malloc (nprocs * sizeof(int));
@@ -152,286 +152,286 @@ main (int argc, char **argv)
 #endif
 
 #ifdef RUN_BARRIER
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Barrier (comm);
 #endif
 
 #ifdef RUN_BCAST
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Bcast (buf0, buf_size, MPI_INT, 0, comm);
 #endif
 
 #ifdef RUN_GATHER
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Gather (&buf0[rank*buf_size], buf_size, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Gather (&buf0[rank*buf_size], buf_size,
                  MPI_INT, buf1, buf_size, MPI_INT, 0, comm);
 #endif
 
 #ifdef RUN_SCATTER
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scatter (buf1, buf_size, MPI_INT, buf0, buf_size, MPI_INT, 0, comm);
 #endif
 
 #ifdef RUN_GATHERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Gatherv (&buf0[rank*buf_size], 
-                  (rank < buf_size) ? rank : buf_size, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Gatherv (&buf0[rank*buf_size],
+                  (rank < buf_size) ? rank : buf_size,
                   MPI_INT, buf1, rcounts, displs, MPI_INT, 0, comm);
 #endif
 
 #ifdef RUN_SCATTERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Scatterv (buf1, counts, displs, MPI_INT, buf0, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Scatterv (buf1, counts, displs, MPI_INT, buf0,
                    (rank < buf_size) ? rank : buf_size, MPI_INT, 0, comm);
 #endif
 
 #ifdef RUN_REDUCE
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_MAX, 0, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_MIN, 0, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_SUM, 0, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_PROD, 0, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_LAND, 0, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_BAND, 0, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_LOR, 0, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_BOR, 0, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_LXOR, 0, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_INT, MPI_BXOR, 0, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (a, answer, buf_size, ctype, user_op, 0, comm);
 #endif
 #endif
 
 #ifdef RUN_ALLGATHER
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allgather (buf0, buf_size, MPI_INT, buf1, buf_size, MPI_INT, comm);
 #endif
 
 #ifdef RUN_ALLTOALL
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Alltoall (buf1, buf_size, MPI_INT, buf0, buf_size, MPI_INT, comm);
 #endif
 
 #ifdef RUN_ALLGATHERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allgatherv (buf0, 
-                     (rank < buf_size) ? rank : buf_size, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allgatherv (buf0,
+                     (rank < buf_size) ? rank : buf_size,
                      MPI_INT, buf1, rcounts, displs, MPI_INT, comm);
 #endif
 
 #ifdef RUN_ALLTOALLV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Alltoallv (buf1, alltoallvcounts, displs, MPI_INT, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Alltoallv (buf1, alltoallvcounts, displs, MPI_INT,
                     buf0, alltoallvcounts, displs, MPI_INT, comm);
 #endif
 
 #ifdef RUN_ALLREDUCE
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_INT, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (a, answer, buf_size, ctype, user_op, comm);
 #endif
 #endif
 
 #ifdef RUN_REDUCE_SCATTER
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_INT, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (a, answer, rcounts, ctype, user_op, comm);
 #endif
 #endif
 
 #ifdef RUN_SCAN
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_INT, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (a, answer, buf_size, ctype, user_op, comm);
 #endif
 #endif
@@ -440,105 +440,105 @@ main (int argc, char **argv)
     int *ricounts, *rdcounts;
 
 #ifdef RUN_BARRIER
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Barrier (comm);
 #endif
 
 #ifdef RUN_BCAST
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Bcast (buf0, buf_size * sizeof(int), MPI_BYTE, 0, comm);
 #endif
 
 #ifdef RUN_GATHER
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Gather (&buf0[rank*buf_size], buf_size * sizeof(int), 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Gather (&buf0[rank*buf_size], buf_size * sizeof(int),
                  MPI_BYTE, buf1, buf_size * sizeof(int), MPI_BYTE, 0, comm);
 #endif
 
 #ifdef RUN_SCATTER
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Scatter (buf1, buf_size * sizeof(int), MPI_BYTE, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Scatter (buf1, buf_size * sizeof(int), MPI_BYTE,
                   buf0, buf_size * sizeof(int), MPI_BYTE, 0, comm);
 #endif
 
 #ifdef RUN_GATHERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Gatherv (&buf0[rank*buf_size], 
-                  ((rank < buf_size) ? rank : buf_size) * sizeof(int), 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Gatherv (&buf0[rank*buf_size],
+                  ((rank < buf_size) ? rank : buf_size) * sizeof(int),
                   MPI_BYTE, buf1, rcounts, displs, MPI_BYTE, 0, comm);
 #endif
 
 #ifdef RUN_SCATTERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Scatterv (buf1, counts, displs, MPI_BYTE, buf0, 
-                   ((rank < buf_size) ? rank : buf_size) * sizeof(int), 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Scatterv (buf1, counts, displs, MPI_BYTE, buf0,
+                   ((rank < buf_size) ? rank : buf_size) * sizeof(int),
                    MPI_BYTE, 0, comm);
 #endif
 
 #ifdef RUN_REDUCE
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MAX, 0, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MIN, 0, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_SUM, 0, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_PROD, 0, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LAND, 0, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Reduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Reduce (buf0, buf1,
                  buf_size * sizeof(int), MPI_BYTE, MPI_BAND, 0, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LOR, 0, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Reduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Reduce (buf0, buf1,
                  buf_size * sizeof(int), MPI_BYTE, MPI_BOR, 0, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LXOR, 0, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Reduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Reduce (buf0, buf1,
                  buf_size * sizeof(int), MPI_BYTE, MPI_BXOR, 0, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Reduce (a, answer, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Reduce (a, answer,
                  buf_size * 2 * sizeof(double), MPI_BYTE, user_op, 0, comm);
 #endif
 #endif
 
     buf1 = (int *) malloc (buf_size * nprocs * sizeof(int));
     assert (buf1);
-    for (i = 0; i < buf_size * nprocs; i++) 
+    for (i = 0; i < buf_size * nprocs; i++)
       buf1[i] = i;
 
     displs = (int *) malloc (nprocs * sizeof(int));
@@ -570,202 +570,202 @@ main (int argc, char **argv)
 #endif
 
 #ifdef RUN_ALLGATHER
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allgather (buf0, buf_size * sizeof(int), MPI_BYTE, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allgather (buf0, buf_size * sizeof(int), MPI_BYTE,
                     buf1, buf_size * sizeof(int), MPI_BYTE, comm);
 #endif
 
 #ifdef RUN_ALLTOALL
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Alltoall (buf1, buf_size * sizeof(int), MPI_BYTE, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Alltoall (buf1, buf_size * sizeof(int), MPI_BYTE,
                    buf0, buf_size * sizeof(int), MPI_BYTE, comm);
 #endif
 
 #ifdef RUN_ALLGATHERV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allgatherv (buf0, 
-                     ((rank < buf_size) ? rank : buf_size) * sizeof(int), 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allgatherv (buf0,
+                     ((rank < buf_size) ? rank : buf_size) * sizeof(int),
                      MPI_BYTE, buf1, rcounts, displs, MPI_BYTE, comm);
 #endif
 
 #ifdef RUN_ALLTOALLV
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Alltoallv (buf1, alltoallvcounts, displs, MPI_BYTE, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Alltoallv (buf1, alltoallvcounts, displs, MPI_BYTE,
                     buf0, alltoallvcounts, displs, MPI_BYTE, comm);
 #endif
 
 #ifdef RUN_ALLREDUCE
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allreduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allreduce (buf0, buf1,
                     buf_size * sizeof (int), MPI_BYTE, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allreduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allreduce (buf0, buf1,
                     buf_size * sizeof (int), MPI_BYTE, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Allreduce (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allreduce (buf0, buf1, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allreduce (buf0, buf1,
                     buf_size * sizeof (int), MPI_BYTE, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Allreduce (a, answer, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Allreduce (a, answer,
                     buf_size * 2 * sizeof (double), MPI_BYTE, user_op, comm);
 #endif
 #endif
 
 #ifdef RUN_REDUCE_SCATTER
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_BYTE, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_BYTE, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, ricounts, MPI_UNSIGNED, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (buf0, buf1, rcounts, MPI_BYTE, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Reduce_scatter (a, answer, rdcounts, MPI_BYTE, user_op, comm);
 #endif
 #endif
 
 #ifdef RUN_SCAN
 #ifdef RUN_MAX
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MAX, comm);
 #endif
 
 #ifdef RUN_MIN
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_MIN, comm);
 #endif
 
 #ifdef RUN_SUM
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_SUM, comm);
 #endif
 
 #ifdef RUN_PROD
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_PROD, comm);
 #endif
 
 #ifdef RUN_LAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LAND, comm);
 #endif
 
 #ifdef RUN_BAND
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size * sizeof(int), MPI_BYTE, MPI_BAND, comm);
 #endif
 
 #ifdef RUN_LOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LOR, comm);
 #endif
 
 #ifdef RUN_BOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size * sizeof(int), MPI_BYTE, MPI_BOR, comm);
 #endif
 
 #ifdef RUN_LXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size, MPI_UNSIGNED, MPI_LXOR, comm);
 #endif
 
 #ifdef RUN_BXOR
-    for (i = 0; i < OP_COUNT; i++) 
+    for (i = 0; i < OP_COUNT; i++)
       MPI_Scan (buf0, buf1, buf_size * sizeof(int), MPI_BYTE, MPI_BXOR, comm);
 #endif
 
 #ifdef RUN_USEROP
-    for (i = 0; i < OP_COUNT; i++) 
-      MPI_Scan (a, answer, 
+    for (i = 0; i < OP_COUNT; i++)
+      MPI_Scan (a, answer,
                buf_size * 2 * sizeof(double), MPI_BYTE, user_op, comm);
 #endif
 #endif