[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2rc1-16-g8ec9602

Service Account noreply at mpich.org
Tue Oct 27 16:54:54 CDT 2015


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  8ec9602b6ddd954250b175840d9ee778e1fbd786 (commit)
       via  89f27b12a662d055908d751b3ea92e407bfc8883 (commit)
      from  2a9d3e328b92c579f008f2b6be8b778dc36ece7d (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/8ec9602b6ddd954250b175840d9ee778e1fbd786

commit 8ec9602b6ddd954250b175840d9ee778e1fbd786
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Mon Oct 26 13:22:03 2015 -0500

    netmod/portals4: better check for datatype mismatch
    
    The previous datatype mismatch check could generate false positives
    when the received data was less than the total size of the posted recv
    op. We take a new approach to detecting mismatches in the case where
    datatypes are constructed from a single basic type. If the received
    number of bytes is not a multiple of the size of a single basic element,
    a mismatch has occurred.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
index d2787c5..08272e9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -119,7 +119,13 @@ static int handler_recv_dequeue_complete(const ptl_event_t *e)
                 MPIR_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
         }
     } else {
-        if (!is_contig && data_sz != e->mlength)
+        /* Data was placed directly into the user buffer, so datatype mismatch
+           is harder to detect. We use a simple check ensuring the received bytes
+           are a multiple of a single basic element. Currently, we do not detect
+           mismatches with datatypes constructed of more than one basic type */
+        MPI_Datatype dt_basic_type;
+        MPID_Datatype_get_basic_type(rreq->dev.datatype, dt_basic_type);
+        if (dt_basic_type != MPI_DATATYPE_NULL && (e->mlength % MPID_Datatype_get_basic_size(dt_basic_type)) != 0)
             MPIR_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
     }
     

http://git.mpich.org/mpich.git/commitdiff/89f27b12a662d055908d751b3ea92e407bfc8883

commit 89f27b12a662d055908d751b3ea92e407bfc8883
Author: Halim Amer <aamer at anl.gov>
Date:   Wed Oct 14 17:05:30 2015 -0500

    Added an Allgather test with an int+long struct DDT
    
    This test proved to trigger bugs in some implementations
    that do not respect the alignment of the struct fields.
    
    Signed-off-by: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/test/mpi/coll/Makefile.am b/test/mpi/coll/Makefile.am
index 06f1270..9955f7a 100644
--- a/test/mpi/coll/Makefile.am
+++ b/test/mpi/coll/Makefile.am
@@ -18,6 +18,7 @@ noinst_PROGRAMS =      \
     allgatherv2        \
     allgatherv3        \
     allgatherv4        \
+    allgather_struct   \
     allred             \
     allred2            \
     allred3            \
diff --git a/test/mpi/coll/allgather_struct.c b/test/mpi/coll/allgather_struct.c
new file mode 100644
index 0000000..b2a421f
--- /dev/null
+++ b/test/mpi/coll/allgather_struct.c
@@ -0,0 +1,77 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdlib.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* Allgather a two-field struct datatype. This test
+   may trigger bugs such as when the implementation
+   does not handle well misaligned types.*/
+
+typedef struct {
+    int first;
+    long second;
+} int_long_t;
+
+int main(int argc, char **argv)
+{
+    MPI_Comm comm;
+    int minsize = 2;
+    int i, errs = 0;
+    int rank, size;
+    int_long_t object;
+    MPI_Datatype type;
+    MPI_Aint begin;
+    MPI_Aint displacements[2];
+    MPI_Datatype types[] = { MPI_INT, MPI_LONG };
+    int blocklength[2] = { 1, 1 };
+    int_long_t* gathered_objects;
+
+    MTest_Init(&argc, &argv);
+
+    while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+
+        if (comm == MPI_COMM_NULL)
+            continue;
+        /* Determine the sender and receiver */
+        MPI_Comm_rank(comm, &rank);
+        MPI_Comm_size(comm, &size);
+
+        gathered_objects = (int_long_t*) malloc (size*sizeof(int_long_t));
+
+        /* Local object */
+        object.first = rank;
+        object.second = rank * 10;
+
+        /* Datatype creation */
+        MPI_Get_address(&object, &begin);
+        MPI_Get_address(&object.first, &displacements[0]);
+        MPI_Get_address(&object.second, &displacements[1]);
+
+        for (i = 0; i != 2; ++i)
+            displacements[i] -= begin;
+
+        MPI_Type_create_struct(2, &blocklength[0], &displacements[0], &types[0], &type);
+        MPI_Type_commit(&type);
+
+        MPI_Allgather(&object, 1, type, gathered_objects, 1, type, comm);
+
+        for (i = 0; i < size; i++) {
+            if (gathered_objects[i].first != i || gathered_objects[i].second != i * 10)
+                errs++;
+        }
+
+        MPI_Type_free(&type);
+        MTestFreeComm(&comm);
+        free(gathered_objects);
+    }
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+    return 0;
+}
diff --git a/test/mpi/coll/testlist.in b/test/mpi/coll/testlist.in
index fd4be71..d259043 100644
--- a/test/mpi/coll/testlist.in
+++ b/test/mpi/coll/testlist.in
@@ -29,6 +29,7 @@ allgather3 10
 allgatherv2 10
 allgatherv3 10
 allgatherv4 4 timeLimit=600
+allgather_struct 10
 bcasttest 4
 bcasttest 8
 bcasttest 10

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

Summary of changes:
 .../channels/nemesis/netmod/portals4/ptl_recv.c    |    8 ++-
 test/mpi/coll/Makefile.am                          |    1 +
 test/mpi/coll/allgather_struct.c                   |   77 ++++++++++++++++++++
 test/mpi/coll/testlist.in                          |    1 +
 4 files changed, 86 insertions(+), 1 deletions(-)
 create mode 100644 test/mpi/coll/allgather_struct.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list