[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-350-g91ca5a7

mysql vizuser noreply at mpich.org
Thu Jul 18 17:14:33 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  91ca5a73a767eb90c7307e512e8d0449bf324e70 (commit)
      from  61d01c53d9721051dc7bdd5647251257b95eca1c (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/91ca5a73a767eb90c7307e512e8d0449bf324e70

commit 91ca5a73a767eb90c7307e512e8d0449bf324e70
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date:   Thu Jul 18 13:13:10 2013 -0500

    Added a badrma test program.
    
    This program tests to make sure we can do zero-count or zero-size
    datatype RMA tests without the MPI library throwing errors.

diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 00665fe..3950aa2 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -114,7 +114,8 @@ noinst_PROGRAMS =          \
     pscw_ordering          \
     mutex_bench            \
     mutex_bench_shared     \
-    rma-contig
+    rma-contig             \
+    badrma
 
 strided_acc_indexed_LDADD       = $(LDADD) -lm
 strided_acc_onelock_LDADD       = $(LDADD) -lm
diff --git a/test/mpi/rma/badrma.c b/test/mpi/rma/badrma.c
new file mode 100644
index 0000000..8e0dfb1
--- /dev/null
+++ b/test/mpi/rma/badrma.c
@@ -0,0 +1,153 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "stdio.h"
+
+#define SIZE 100
+
+MPI_Win win;
+int win_buf[SIZE], origin_buf[SIZE], result_buf[SIZE];
+
+int do_test(int origin_count, MPI_Datatype origin_type, int result_count,
+            MPI_Datatype result_type, int target_count, MPI_Datatype target_type)
+{
+    int errs = 0, ret, origin_type_size, result_type_size;
+
+    ret = MPI_Put(origin_buf, origin_count, origin_type, 1, 0, target_count, target_type, win);
+    if (ret)
+        errs++;
+
+    ret = MPI_Get(origin_buf, origin_count, origin_type, 1, 0, target_count, target_type, win);
+    if (ret)
+        errs++;
+
+    ret = MPI_Accumulate(origin_buf, origin_count, origin_type, 1, 0, target_count,
+                         target_type, MPI_SUM, win);
+    if (ret)
+        errs++;
+
+    ret = MPI_Get_accumulate(origin_buf, origin_count, origin_type, result_buf, result_count,
+                             result_type, 1, 0, target_count, target_type, MPI_SUM, win);
+    if (ret)
+        errs++;
+
+    MPI_Type_size(origin_type, &origin_type_size);
+    MPI_Type_size(result_type, &result_type_size);
+
+    if (origin_count == 0 || origin_type_size == 0) {
+        ret = MPI_Put(NULL, origin_count, origin_type, 1, 0, target_count, target_type, win);
+        if (ret)
+            errs++;
+
+        ret = MPI_Get(NULL, origin_count, origin_type, 1, 0, target_count, target_type, win);
+        if (ret)
+            errs++;
+
+        ret = MPI_Accumulate(NULL, origin_count, origin_type, 1, 0, target_count, target_type,
+                             MPI_SUM, win);
+        if (ret)
+            errs++;
+
+        ret = MPI_Get_accumulate(NULL, origin_count, origin_type, result_buf, result_count,
+                                 result_type, 1, 0, target_count, target_type, MPI_SUM, win);
+        if (ret)
+            errs++;
+
+        if (result_count == 0 || result_type_size == 0) {
+            ret = MPI_Get_accumulate(NULL, origin_count, origin_type, NULL, result_count,
+                                     result_type, 1, 0, target_count, target_type, MPI_SUM, win);
+            if (ret)
+                errs++;
+        }
+    }
+
+    return errs;
+}
+
+int main(int argc, char *argv[])
+{
+    int rank, nprocs, i, j, k;
+    int errs = 0;
+    MPI_Datatype types[4];
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (nprocs < 2) {
+        printf("Run this program with 2 or more processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+    /* types[0] is of zero size.  Everything else is non-zero size */
+    MPI_Type_contiguous(0, MPI_INT, &types[0]);
+    MPI_Type_commit(&types[0]);
+
+    MPI_Type_contiguous(1, MPI_INT, &types[1]);
+    MPI_Type_commit(&types[1]);
+
+    types[2] = MPI_INT;
+    types[3] = MPI_DOUBLE;
+
+    MPI_Win_create(win_buf, SIZE * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
+
+    MPI_Win_fence(0, win);
+
+    if (rank == 0) {
+        /* zero-count */
+        for (i = 0; i < 4; i++)
+            for (j = 0; j < 4; j++)
+                for (k = 0; k < 4; k++)
+                    do_test(0, types[i], 0, types[j], 0, types[k]);
+
+        /* single zero-size datatype, but non-zero count */
+        for (i = 1; i < 4; i++) {
+            for (j = 1; j < 4; j++) {
+                do_test(1, types[0], 0, types[i], 0, types[j]);
+                do_test(0, types[i], 1, types[0], 0, types[j]);
+                do_test(0, types[i], 0, types[j], 1, types[0]);
+            }
+        }
+
+        /* two zero-size datatypes, but non-zero count */
+        for (i = 1; i < 4; i++) {
+            do_test(1, types[0], 1, types[0], 0, types[i]);
+            do_test(1, types[0], 0, types[i], 1, types[0]);
+            do_test(0, types[i], 1, types[0], 1, types[0]);
+
+            do_test(1, types[0], 2, types[0], 0, types[i]);
+            do_test(2, types[0], 1, types[0], 0, types[i]);
+
+            do_test(1, types[0], 0, types[i], 2, types[0]);
+            do_test(2, types[0], 0, types[i], 1, types[0]);
+
+            do_test(0, types[i], 1, types[0], 2, types[0]);
+            do_test(0, types[i], 2, types[0], 1, types[0]);
+        }
+
+        /* three zero-size datatypes, but non-zero count */
+        do_test(1, types[0], 1, types[0], 1, types[0]);
+        do_test(1, types[0], 1, types[0], 2, types[0]);
+        do_test(1, types[0], 2, types[0], 1, types[0]);
+        do_test(1, types[0], 2, types[0], 2, types[0]);
+        do_test(2, types[0], 1, types[0], 1, types[0]);
+        do_test(2, types[0], 1, types[0], 2, types[0]);
+        do_test(2, types[0], 2, types[0], 1, types[0]);
+    }
+    MPI_Win_fence(0, win);
+
+    MPI_Win_free(&win);
+    MPI_Type_free(&types[0]);
+    MPI_Type_free(&types[1]);
+
+    if (!errs && !rank)
+        printf(" No Errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/rma/testlist b/test/mpi/rma/testlist
index 0168a34..006c4f5 100644
--- a/test/mpi/rma/testlist
+++ b/test/mpi/rma/testlist
@@ -99,4 +99,5 @@ linked_list_bench_lock_shr 4 mpiversion=3.0
 linked_list_bench_lock_shr_nocheck 4 mpiversion=3.0
 mutex_bench 4 mpiversion=3.0
 mutex_bench_shared 4 mpiversion=3.0
-rma-contig 4 mpiversion=3.0 timeLimit=600
\ No newline at end of file
+rma-contig 4 mpiversion=3.0 timeLimit=600
+badrma 2 mpiversion=3.0

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

Summary of changes:
 test/mpi/rma/Makefile.am |    3 +-
 test/mpi/rma/badrma.c    |  153 ++++++++++++++++++++++++++++++++++++++++++++++
 test/mpi/rma/testlist    |    3 +-
 3 files changed, 157 insertions(+), 2 deletions(-)
 create mode 100644 test/mpi/rma/badrma.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list