[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1b1-36-g46dba93

mysql vizuser noreply at mpich.org
Tue Sep 17 10:37:03 CDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  46dba93ff00afede3c624e462eb3e7ac8e10dcce (commit)
      from  f22b5c90632dd86d146dd275001459b66304c145 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/46dba93ff00afede3c624e462eb3e7ac8e10dcce

commit 46dba93ff00afede3c624e462eb3e7ac8e10dcce
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Tue Sep 17 10:29:48 2013 -0500

    Improvements to large_type test
    
    - large_type now conforms to mpich test guidelines.
    - additional datatype cases that do not rely on "large MPI_Aint" (but
      32 bit platforms probably still cannot process these types)

diff --git a/test/mpi/datatype/large_type.c b/test/mpi/datatype/large_type.c
index 9449160..bfc32ac 100644
--- a/test/mpi/datatype/large_type.c
+++ b/test/mpi/datatype/large_type.c
@@ -14,10 +14,6 @@ static MPI_Datatype make_largexfer_type_struct(MPI_Offset nbytes)
     /* first pass: chunks of 1 MiB plus an additional remainder.  Does require
      * 8 byte MPI_Aint, which should have been checked for earlier */
 
-    if (sizeof(MPI_Aint) <= sizeof(int)) {
-        return MPI_DATATYPE_NULL;
-    }
-
     chunk_count = nbytes/typechunk_size;
     remainder = nbytes % typechunk_size;
     MPI_Type_contiguous(typechunk_size, MPI_BYTE, &chunktype);
@@ -25,18 +21,22 @@ static MPI_Datatype make_largexfer_type_struct(MPI_Offset nbytes)
 
     /* a zero remainder means we can just count contigs */
     if (remainder == 0) {
-        memtype = chunktype;
+	MPI_Type_contiguous(chunk_count, chunktype, &memtype);
+	MPI_Type_free(&chunktype);
     } else {
-        /* struct type: some number of chunks plus remaining bytes tacked
+	if (sizeof(MPI_Aint) <= sizeof(int)) {
+	    return MPI_DATATYPE_NULL;
+	}
+       /* struct type: some number of chunks plus remaining bytes tacked
          * on at end */
         int lens[] = {chunk_count, remainder};
         MPI_Aint disp[] = {0, (MPI_Aint) typechunk_size * (MPI_Aint)chunk_count};
         MPI_Datatype types[] = {chunktype, MPI_BYTE};
 
         MPI_Type_struct(2, lens, disp, types, &memtype);
-        MPI_Type_commit(&memtype);
         MPI_Type_free(&chunktype);
     }
+    MPI_Type_commit(&memtype);
     return memtype;
 }
 static MPI_Datatype make_largexfer_type_hindexed(MPI_Offset nbytes)
@@ -76,31 +76,31 @@ static MPI_Datatype make_largexfer_type_hindexed(MPI_Offset nbytes)
 }
 
 
-int testtype(MPI_Datatype type) {
+int testtype(MPI_Datatype type, MPI_Offset expected) {
     MPI_Count size, lb, extent;
     int nerrors=0;
     MPI_Type_size_x(type, &size);
 
-    if (size > 0)  {
-	printf("constructed type of size %lld\n", size);
-    } else  {
+    if (size < 0)  {
 	printf("ERROR: type size apparently overflowed integer\n");
 	nerrors++;
     }
 
+    if (size != expected) {
+	printf("reported type size %lld does not match expected %lld\n",
+		size, expected);
+	nerrors++;
+    }
+
     MPI_Type_get_true_extent_x(type, &lb, &extent);
     if (lb != 0) {
 	printf("ERROR: type should have lb of 0, reported %lld\n", lb);
 	nerrors ++;
-    } else {
-	printf("constructed type has lb of %lld\n", lb);
     }
 
     if (extent != size) { 
 	printf("ERROR: extent should match size, not %lld\n", extent);
 	nerrors ++;
-    } else {
-	printf("constructed type extent matches size: %lld\n", extent);
     }
     return nerrors;
 }
@@ -115,21 +115,30 @@ int main(int argc, char **argv)
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     MPI_Comm_size(MPI_COMM_WORLD, &size);
 
-#define NR_TYPES 2
+#define NR_TYPES 3
+    MPI_Offset expected_sizes[NR_TYPES] = {1024UL*1024UL*2400UL,
+	2346319872,
+	2346319872};
     MPI_Datatype types[NR_TYPES];
 
-    types[0] = make_largexfer_type_struct(2346319872);
-    types[1] = make_largexfer_type_hindexed(2346319872);
+    /* a contig type, itself large, but does not need 8 byte aints */
+    types[0] = make_largexfer_type_struct(expected_sizes[0]);
+    /* struct with addresses out past 2 GiB */
+    types[1] = make_largexfer_type_struct(expected_sizes[1]);
+    /* similar, but with hindexed type */
+    types[2] = make_largexfer_type_hindexed(expected_sizes[2]);
 
     for (i=0; i<NR_TYPES; i++) {
-	nerrors += testtype(types[i]);
-	MPI_Type_free(&(types[i]));
+	if (types[i] != MPI_DATATYPE_NULL) {
+		nerrors += testtype(types[i], expected_sizes[i]);
+	 	MPI_Type_free(&(types[i]));
+	}
     }
 
     MPI_Finalize();
     if (rank == 0) {
 	if (nerrors) {
-	    printf("foiund %d errors\n", nerrors);
+	    printf("found %d errors\n", nerrors);
 	} else {
 	    printf(" No errors\n");
 	}

-----------------------------------------------------------------------

Summary of changes:
 test/mpi/datatype/large_type.c |   51 +++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list