Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / teshsuite / smpi / mpich3-test / rma / contention_putget.c
index 312cf31..4f25827 100644 (file)
@@ -7,7 +7,7 @@
 /** Contended RMA put/get test -- James Dinan <dinan@mcs.anl.gov>
   *
   * Each process issues COUNT put and get operations to non-overlapping
-  * locations on every other processs.
+  * locations on every other process.
   */
 
 #include <stdio.h>
 #define MAXELEMS      6400
 #define COUNT         1000
 
-static int me, nproc;
+
 static const int verbose = 0;
 
 void test_put(void);
 void test_put(void)
 {
+    int me, nproc;
+    MPI_Comm_size(MPI_COMM_WORLD, &nproc);
+    MPI_Comm_rank(MPI_COMM_WORLD, &me);
     MPI_Win dst_win;
     double *dst_buf;
     double src_buf[MAXELEMS];
@@ -77,6 +80,7 @@ void test_put(void)
 int main(int argc, char *argv[])
 {
     MPI_Init(&argc, &argv);
+    int me, nproc;
     MPI_Comm_size(MPI_COMM_WORLD, &nproc);
     MPI_Comm_rank(MPI_COMM_WORLD, &me);