[mpich2-commits] r6649 - mpich2/trunk/test/mpi/pt2pt

thakur at mcs.anl.gov thakur at mcs.anl.gov
Fri May 14 16:53:22 CDT 2010


Author: thakur
Date: 2010-05-14 16:53:22 -0500 (Fri, 14 May 2010)
New Revision: 6649

Added:
   mpich2/trunk/test/mpi/pt2pt/large_message.c
Modified:
   mpich2/trunk/test/mpi/pt2pt/Makefile.sm
   mpich2/trunk/test/mpi/pt2pt/testlist
Log:
added test for large messages > 2GB

Modified: mpich2/trunk/test/mpi/pt2pt/Makefile.sm
===================================================================
--- mpich2/trunk/test/mpi/pt2pt/Makefile.sm	2010-05-14 20:45:02 UTC (rev 6648)
+++ mpich2/trunk/test/mpi/pt2pt/Makefile.sm	2010-05-14 21:53:22 UTC (rev 6649)
@@ -40,6 +40,7 @@
 inactivereq_SOURCES  = inactivereq.c
 waittestnull_SOURCES = waittestnull.c
 sendall_SOURCES      = sendall.c
+large_message_SOURCES = large_message.c
 
 ../util/mtest.o:
 	(cd ../util && $(MAKE) mtest.o)

Added: mpich2/trunk/test/mpi/pt2pt/large_message.c
===================================================================
--- mpich2/trunk/test/mpi/pt2pt/large_message.c	                        (rev 0)
+++ mpich2/trunk/test/mpi/pt2pt/large_message.c	2010-05-14 21:53:22 UTC (rev 6649)
@@ -0,0 +1,51 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/* tests send/recv of a message > 2GB. count=270M, type=long long */
+
+int main(int argc, char *argv[]) 
+{
+  int        ierr,i,size,rank;
+  int        cnt = 270000000;
+  MPI_Status status;
+  long long  *cols;
+  int errs = 0;
+
+
+  MTest_Init(&argc,&argv); 
+  ierr = MPI_Comm_size(MPI_COMM_WORLD,&size);
+  ierr = MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+  if (size != 2) {
+    fprintf(stderr,"[%d] usage: mpiexec -n 2 %s\n",rank,argv[0]);
+    MPI_Abort(MPI_COMM_WORLD,1);
+  }
+
+  cols = malloc(cnt*sizeof(long long));
+  if (rank == 0) {
+    for (i=0; i<cnt; i++) cols[i] = i;
+    /* printf("[%d] sending...\n",rank);*/
+    ierr = MPI_Send(cols,cnt,MPI_LONG_LONG_INT,1,0,MPI_COMM_WORLD);
+  } else {
+      /* printf("[%d] receiving...\n",rank); */
+    for (i=0; i<cnt; i++) cols[i] = -1;
+    ierr = MPI_Recv(cols,cnt,MPI_LONG_LONG_INT,0,0,MPI_COMM_WORLD,&status);
+    /* ierr = MPI_Get_count(&status,MPI_LONG_LONG_INT,&cnt);
+       Get_count still fails because status.count is not 64 bit */
+    for (i=0; i<cnt; i++) {
+        if (cols[i] != i) {
+            printf("cols[i]=%lld, should be %d\n", cols[i], i);
+            errs++;
+        }
+    }
+  }
+  MTest_Finalize(errs);
+  MPI_Finalize();
+  return 0;
+}

Modified: mpich2/trunk/test/mpi/pt2pt/testlist
===================================================================
--- mpich2/trunk/test/mpi/pt2pt/testlist	2010-05-14 20:45:02 UTC (rev 6648)
+++ mpich2/trunk/test/mpi/pt2pt/testlist	2010-05-14 21:53:22 UTC (rev 6649)
@@ -35,3 +35,4 @@
 inactivereq 1
 waittestnull 1
 waitany-null 1
+large_message 2



More information about the mpich2-commits mailing list