[MPICH2-dev] RMA tests cleanup

Doug Gilmore dgilmore at cray.com
Thu Oct 2 16:19:05 CDT 2003


While bringing up the RMA implementation for Portals I noticed
that the RMA tests were not using the "mtest" utilities,
thus the test output does not conform that expected by runtests.

I updated the currently runinng tests under CH3 so that
the tests produce conforming output.

Doug

diff -c mpich2-0.94b1/Makefile.sm dev/Makefile.sm
*** mpich2-0.94b1/Makefile.sm	Wed Sep  3 15:24:39 2003
--- dev/Makefile.sm	Thu Oct  2 12:02:40 2003
***************
*** 2,13 ****
  # weak symbols are not supported)
  INCLUDES = -I../include -I${top_srcdir}/include
  EXTERNAL_LIBS = m
! LDADD = -L../../../lib
  DEPADD = ../../../lib/lib${MPILIBNAME}.a
  smvar_do_sharedlibs = 0
  #
  ircpi_SOURCES = ircpi.c
- ircpi_LDADD = -lm
  test1_SOURCES = test1.c
  test2_SOURCES = test2.c
  test3_SOURCES = test3.c
--- 2,12 ----
  # weak symbols are not supported)
  INCLUDES = -I../include -I${top_srcdir}/include
  EXTERNAL_LIBS = m
! LDADD = -L../../../lib ../util/mtest.o 
  DEPADD = ../../../lib/lib${MPILIBNAME}.a
  smvar_do_sharedlibs = 0
  #
  ircpi_SOURCES = ircpi.c
  test1_SOURCES = test1.c
  test2_SOURCES = test2.c
  test3_SOURCES = test3.c
***************
*** 23,26 ****
  fetchandadd_SOURCES = fetchandadd.c
  fetchandadd_tree_SOURCES = fetchandadd_tree.c
  winname_SOURCES = winname.c
- winname_LDADD = ../util/mtest.o
--- 22,24 ----
diff -c mpich2-0.94b1/test1.c dev/test1.c
*** mpich2-0.94b1/test1.c	Thu Jun  5 20:00:45 2003
--- dev/test1.c	Thu Oct  2 12:15:21 2003
***************
*** 9,16 ****
  { 
      int rank, nprocs, A[SIZE], B[SIZE], i;
      MPI_Win win;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 9,17 ----
  { 
      int rank, nprocs, A[SIZE], B[SIZE], i;
      MPI_Win win;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 49,65 ****
  
      if (rank == 1) {
          for (i=0; i<SIZE-1; i++) {
!             if (A[i] != B[i])
                  printf("Put/Get Error: A[i]=%d, B[i]=%d\n", A[i], B[i]);
          }
      }
      else {
!         if (B[SIZE-1] != SIZE - 1 - 3*(SIZE-1)) 
              printf("Accumulate Error: B[SIZE-1] is %d, should be %d\n", B[SIZE-1], SIZE - 1 - 3*(SIZE-1));
      }
  
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 50,70 ----
  
      if (rank == 1) {
          for (i=0; i<SIZE-1; i++) {
!             if (A[i] != B[i]) {
                  printf("Put/Get Error: A[i]=%d, B[i]=%d\n", A[i], B[i]);
+                 errs++;
+ 	    }
          }
      }
      else {
!         if (B[SIZE-1] != SIZE - 1 - 3*(SIZE-1)) {
              printf("Accumulate Error: B[SIZE-1] is %d, should be %d\n", B[SIZE-1], SIZE - 1 - 3*(SIZE-1));
+             errs++;
+ 	}
      }
  
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/test2.c dev/test2.c
*** mpich2-0.94b1/test2.c	Wed Sep  3 15:24:39 2003
--- dev/test2.c	Thu Oct  2 12:15:22 2003
***************
*** 11,18 ****
      int rank, destrank, nprocs, A[SIZE2], B[SIZE2], i;
      MPI_Group comm_group, group;
      MPI_Win win;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 11,19 ----
      int rank, destrank, nprocs, A[SIZE2], B[SIZE2], i;
      MPI_Group comm_group, group;
      MPI_Win win;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 37,44 ****
          MPI_Win_complete(win);
  
          for (i=0; i<SIZE1; i++) 
!             if (B[i] != (-4)*(i+SIZE1)) 
                  printf("Get Error: B[i] is %d, should be %d\n", B[i], (-4)*(i+SIZE1));
      }
  
      else {  /* rank=1 */
--- 38,47 ----
          MPI_Win_complete(win);
  
          for (i=0; i<SIZE1; i++) 
!             if (B[i] != (-4)*(i+SIZE1)) {
                  printf("Get Error: B[i] is %d, should be %d\n", B[i], (-4)*(i+SIZE1));
+                 errs++;
+             }
      }
  
      else {  /* rank=1 */
***************
*** 51,65 ****
          MPI_Win_wait(win);
      
          for (i=0; i<SIZE1; i++) {
!             if (B[i] != i)
                  printf("Put Error: B[i] is %d, should be %d\n", B[i], i);
          }
      }
  
      MPI_Group_free(&group);
      MPI_Group_free(&comm_group);
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize();
      return 0; 
  } 
--- 54,70 ----
          MPI_Win_wait(win);
      
          for (i=0; i<SIZE1; i++) {
!             if (B[i] != i) {
                  printf("Put Error: B[i] is %d, should be %d\n", B[i], i);
+ 	        errs++;
+             }
          }
      }
  
      MPI_Group_free(&group);
      MPI_Group_free(&comm_group);
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize();
      return 0; 
  } 
diff -c mpich2-0.94b1/test3.c dev/test3.c
*** mpich2-0.94b1/test3.c	Wed Sep  3 15:24:39 2003
--- dev/test3.c	Thu Oct  2 12:15:24 2003
***************
*** 16,23 ****
      int rank, destrank, nprocs, *A, *B, i;
      MPI_Group comm_group, group;
      MPI_Win win;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 16,24 ----
      int rank, destrank, nprocs, *A, *B, i;
      MPI_Group comm_group, group;
      MPI_Win win;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 64,73 ****
          MPI_Win_wait(win);
          
          for (i=0; i<SIZE; i++) {
!             if (B[i] != i)
                  printf("Rank 1: Put Error: B[i] is %d, should be %d\n", B[i], i);
!             if (A[i] != SIZE + i)
!               printf("Rank 1: Send/Recv Error: A[i] is %d, should be %d\n", A[i], SIZE+i);
          }
      }
  
--- 65,78 ----
          MPI_Win_wait(win);
          
          for (i=0; i<SIZE; i++) {
!             if (B[i] != i) {
                  printf("Rank 1: Put Error: B[i] is %d, should be %d\n", B[i], i);
!                 errs++;
!             }
!             if (A[i] != SIZE + i) {
!                 printf("Rank 1: Send/Recv Error: A[i] is %d, should be %d\n", A[i], SIZE+i);
!                 errs++;
!             }
          }
      }
  
***************
*** 76,82 ****
      MPI_Win_free(&win); 
      free(A);
      free(B);
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 81,87 ----
      MPI_Win_free(&win); 
      free(A);
      free(B);
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/test5.c dev/test5.c
*** mpich2-0.94b1/test5.c	Wed Sep  3 15:24:39 2003
--- dev/test5.c	Thu Oct  2 12:15:25 2003
***************
*** 9,16 ****
  { 
      int rank, nprocs, i, A[SIZE], B[SIZE];
      MPI_Win win;
   
!     MPI_Init(&argc,&argv); 
  
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
--- 9,17 ----
  { 
      int rank, nprocs, i, A[SIZE], B[SIZE];
      MPI_Win win;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
  
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
***************
*** 32,40 ****
          }
          MPI_Win_fence(0, win); 
          for (i=0; i<SIZE; i++)
!             if (A[i] != 1000 + i)
                  printf("Rank 0: A[%d] is %d, should be %d\n", i, A[i], 1000+i);
!         printf("Done\n");
      }
  
      if (rank == 1) {
--- 33,42 ----
          }
          MPI_Win_fence(0, win); 
          for (i=0; i<SIZE; i++)
!             if (A[i] != 1000 + i) {
                  printf("Rank 0: A[%d] is %d, should be %d\n", i, A[i], 1000+i);
!                 errs++;
!             }
      }
  
      if (rank == 1) {
***************
*** 49,60 ****
          }
          MPI_Win_fence(0, win); 
          for (i=0; i<SIZE; i++)
!             if (B[i] != 500 + i)
                  printf("Rank 1: B[%d] is %d, should be %d\n", i, B[i], 500+i);
      }
  
      MPI_Win_free(&win); 
  
      MPI_Finalize(); 
      return 0; 
  } 
--- 51,65 ----
          }
          MPI_Win_fence(0, win); 
          for (i=0; i<SIZE; i++)
!             if (B[i] != 500 + i) {
                  printf("Rank 1: B[%d] is %d, should be %d\n", i, B[i], 500+i);
+                 errs++;
+             }
      }
  
      MPI_Win_free(&win); 
  
+     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose1.c dev/transpose1.c
*** mpich2-0.94b1/transpose1.c	Thu Jun  5 20:00:45 2003
--- dev/transpose1.c	Thu Oct  2 12:15:26 2003
***************
*** 13,20 ****
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 13,21 ----
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 57,69 ****
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j)
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
      }
  
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 58,72 ----
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j) {
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
+ 		    errs++;
+ 		}
      }
  
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose2.c dev/transpose2.c
*** mpich2-0.94b1/transpose2.c	Wed Sep  3 15:24:40 2003
--- dev/transpose2.c	Thu Oct  2 12:15:27 2003
***************
*** 15,22 ****
      MPI_Aint disp[2];
      MPI_Win win;
      MPI_Datatype column, column1, type[2];
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 15,23 ----
      MPI_Aint disp[2];
      MPI_Win win;
      MPI_Datatype column, column1, type[2];
+     int errs;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 67,79 ****
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j)
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
      }
  
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 68,82 ----
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j) {
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
+                     errs++;
+                 }
      }
  
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose3.c dev/transpose3.c
*** mpich2-0.94b1/transpose3.c	Thu Jun  5 20:00:45 2003
--- dev/transpose3.c	Thu Oct  2 12:15:28 2003
***************
*** 14,21 ****
      MPI_Win win;
      MPI_Datatype column, xpose;
      MPI_Group comm_group, group;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 14,22 ----
      MPI_Win win;
      MPI_Datatype column, xpose;
      MPI_Group comm_group, group;
+     int errs;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 63,77 ****
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j)
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
      }
  
      MPI_Group_free(&group);
      MPI_Group_free(&comm_group);
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 64,80 ----
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j) {
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
+                     errs++;
+                 }
      }
  
      MPI_Group_free(&group);
      MPI_Group_free(&comm_group);
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose5.c dev/transpose5.c
*** mpich2-0.94b1/transpose5.c	Wed Sep  3 15:24:40 2003
--- dev/transpose5.c	Thu Oct  2 12:02:49 2003
***************
*** 13,20 ****
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 13,21 ----
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 57,69 ****
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j + j*NCOLS + i)
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j + j*NCOLS + i);
      }
  
!     MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 58,72 ----
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j + j*NCOLS + i) {
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j + j*NCOLS + i);
+                     errs++;
+                 }
      }
  
!     MPI_Win_free(&win);
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose6.c dev/transpose6.c
*** mpich2-0.94b1/transpose6.c	Wed Sep  3 15:24:40 2003
--- dev/transpose6.c	Thu Oct  2 12:15:34 2003
***************
*** 13,20 ****
      int nprocs, A[NROWS][NCOLS], B[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
  
      if (nprocs != 1) {
--- 13,21 ----
      int nprocs, A[NROWS][NCOLS], B[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
  
      if (nprocs != 1) {
***************
*** 46,57 ****
      
      for (j=0; j<NCOLS; j++)
          for (i=0; i<NROWS; i++) 
!             if (B[j][i] != i*NCOLS + j + j*NCOLS + i)
                  printf("Error: B[%d][%d]=%d should be %d\n", j, i,
                         B[j][i], i*NCOLS + j + j*NCOLS + i);
  
      MPI_Win_free(&win); 
!     printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 47,60 ----
      
      for (j=0; j<NCOLS; j++)
          for (i=0; i<NROWS; i++) 
!             if (B[j][i] != i*NCOLS + j + j*NCOLS + i) {
                  printf("Error: B[%d][%d]=%d should be %d\n", j, i,
                         B[j][i], i*NCOLS + j + j*NCOLS + i);
+                 errs++;
+             }
  
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 
diff -c mpich2-0.94b1/transpose7.c dev/transpose7.c
*** mpich2-0.94b1/transpose7.c	Wed Sep  3 15:24:40 2003
--- dev/transpose7.c	Thu Oct  2 12:02:51 2003
***************
*** 13,20 ****
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
   
!     MPI_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
--- 13,21 ----
      int rank, nprocs, A[NROWS][NCOLS], i, j;
      MPI_Win win;
      MPI_Datatype column, xpose;
+     int errs = 0;
   
!     MTest_Init(&argc,&argv); 
      MPI_Comm_size(MPI_COMM_WORLD,&nprocs); 
      MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
  
***************
*** 47,55 ****
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j)
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
      }        
      else {  /* rank = 1 */
          for (i=0; i<NROWS; i++) 
--- 48,58 ----
  
          for (j=0; j<NCOLS; j++)
              for (i=0; i<NROWS; i++) 
!                 if (A[j][i] != i*NCOLS + j) {
                      printf("Error: A[%d][%d]=%d should be %d\n", j, i,
                             A[j][i], i*NCOLS + j);
+ 		    errs++;
+ 		}
      }        
      else {  /* rank = 1 */
          for (i=0; i<NROWS; i++) 
***************
*** 63,69 ****
      }
  
      MPI_Win_free(&win); 
!     if (rank==0) printf("Done\n");
      MPI_Finalize(); 
      return 0; 
  } 
--- 66,72 ----
      }
  
      MPI_Win_free(&win); 
!     MTest_Finalize(errs);
      MPI_Finalize(); 
      return 0; 
  } 



More information about the mpich2-dev mailing list