[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b3-169-gba2870a

Service Account noreply at mpich.org
Fri Jun 26 22:24:21 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  ba2870aa38153dc3bb37d6586c14c57896733537 (commit)
       via  c059963a75c3504df32cc51ba11662c85cfc12ea (commit)
       via  333b06cfe0861a1d1f74441a349453ec50691894 (commit)
       via  2c090612559804d1f759b92535f242a603b580bc (commit)
      from  931b5dbcb34c2e3d2c4bedc1dd5e08908a18520e (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/ba2870aa38153dc3bb37d6586c14c57896733537

commit ba2870aa38153dc3bb37d6586c14c57896733537
Author: Antonio Pena Monferrer <apenya at mcs.anl.gov>
Date:   Tue Jun 23 17:26:16 2015 -0500

    Fix a bug in GENERIC_Q_SEARCH_REMOVE + empty queue
    
    In case it's empty, it has to return with a NULL element pointer.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
index df7c30e..5068d4d 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_generic_queue.h
@@ -113,8 +113,10 @@
 #define GENERIC_Q_SEARCH_REMOVE(qp, pred, epp, el_type, next_field) do {        \
     el_type *_e;                                                                \
     el_type *_prev;                                                             \
-    if (GENERIC_Q_EMPTY(*(qp)))                                                 \
+    if (GENERIC_Q_EMPTY(*(qp))) {                                               \
         *(epp) = NULL;                                                          \
+        break;                                                                  \
+    }                                                                           \
     _e = GENERIC_Q_HEAD(*(qp));                                                 \
     if (pred)                                                                   \
     {                                                                           \

http://git.mpich.org/mpich.git/commitdiff/c059963a75c3504df32cc51ba11662c85cfc12ea

commit c059963a75c3504df32cc51ba11662c85cfc12ea
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Tue Jun 23 18:54:27 2015 -0500

    Add an RMA test for issuing large ACC following by small ACCs.
    
    This test is mainly checking if the ordering between ACCs is
    guaranteed.
    
    Signed-off-by: Antonio Pena Monferrer <apenya at mcs.anl.gov>

diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 8b3b9d5..6a7350f 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -157,7 +157,8 @@ noinst_PROGRAMS =          \
     acc-pairtype           \
     manyget                \
     derived-acc-flush_local\
-    large-acc-flush_local
+    large-acc-flush_local  \
+    large-small-acc
 
 if BUILD_MPIX_TESTS
 noinst_PROGRAMS += aint
diff --git a/test/mpi/rma/large-small-acc.c b/test/mpi/rma/large-small-acc.c
new file mode 100644
index 0000000..8748f6d
--- /dev/null
+++ b/test/mpi/rma/large-small-acc.c
@@ -0,0 +1,83 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This code tests the case when a large ACC is issued, and then
+ * several small ACCs is issued between the same origin and target.
+ * The purpose of this test is to check if the ordering of ACCs
+ * is guaranteed. */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdint.h>
+
+#define LOOP 5
+#define DATA_COUNT 8192
+
+int main(int argc, char *argv[]){
+    int rank, nprocs;
+    MPI_Win win;
+    uint64_t buf[DATA_COUNT], orig_buf[DATA_COUNT];
+    uint64_t small_orig_buf_1 = 2, small_orig_buf_2[2] = {3, 3};
+    int i, j, error = 0;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    for (j = 0; j < LOOP; j++) {
+
+        error = 0;
+
+        for (i = 0; i < DATA_COUNT; i++) {
+            buf[i] = 0;
+            orig_buf[i] = 1;
+        }
+
+        MPI_Win_create(buf, sizeof(uint64_t)*DATA_COUNT, sizeof(uint64_t),
+                       MPI_INFO_NULL, MPI_COMM_WORLD, &win);
+
+        MPI_Win_fence(0, win);
+
+        if (rank == 0) {
+            /* ACC (atomic PUT) to win_buf[0...DATA_COUNT-1] */
+            MPI_Accumulate(orig_buf, DATA_COUNT, MPI_UINT64_T, 1, 0, DATA_COUNT, MPI_UINT64_T, MPI_REPLACE, win);
+            /* ACC (atomic PUT) to win_buf[0] */
+            MPI_Accumulate(&small_orig_buf_1, 1, MPI_UINT64_T, 1, 0, 1, MPI_UINT64_T, MPI_REPLACE, win);
+            /* ACC (atomic PUT) to win_buf[1,2] */
+            MPI_Accumulate(&small_orig_buf_2, 2, MPI_UINT64_T, 1, 1, 2, MPI_UINT64_T, MPI_REPLACE, win);
+        }
+
+        MPI_Win_fence(0, win);
+
+        if (rank == 1) {
+            for (i = 0; i < DATA_COUNT; i++) {
+                if (i == 0) {
+                    if (buf[i] != 2) {
+                        error++;
+                    }
+                }
+                else if (i == 1 || i == 2) {
+                    if (buf[i] != 3) {
+                        error++;
+                    }
+                }
+                else {
+                    if (buf[i] != 1) {
+                        error++;
+                    }
+                }
+            }
+        }
+
+        MPI_Win_free(&win);
+    }
+
+    if (rank == 1 && error == 0) {
+        printf(" No Errors\n");
+    }
+
+    MPI_Finalize();
+}
diff --git a/test/mpi/rma/testlist.in b/test/mpi/rma/testlist.in
index 5f59ccd..ae7524c 100644
--- a/test/mpi/rma/testlist.in
+++ b/test/mpi/rma/testlist.in
@@ -146,6 +146,7 @@ acc-pairtype 2
 manyget 2
 derived-acc-flush_local 3 mpiversion=3.0
 large-acc-flush_local 3 mpiversion=3.0
+large-small-acc 2
 
 ## This test is not strictly correct.  This was meant to test out the
 ## case when MPI_Test is not nonblocking.  However, we ended up

http://git.mpich.org/mpich.git/commitdiff/333b06cfe0861a1d1f74441a349453ec50691894

commit 333b06cfe0861a1d1f74441a349453ec50691894
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Mon Jun 22 14:00:51 2015 -0500

    netmod/portals4: Enforce ordering in RMA
    
    The RMA delivery order involving eager and rendezvous (at netmod level)
    packets to CH3 was not enforced because Portals 4 ensures matching order
    but not the order of event delivery. This patch introduces a reordering
    queue to enforce the order of delivery to CH3.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index c06565d..2195f42 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -49,6 +49,7 @@ typedef struct {
     ptl_handle_me_t *get_me_p;
     int num_gets;
     int put_done;
+    void *recv_ptr;  /* used for reordering in ptl_nm */
     void *chunk_buffer[MPID_NEM_PTL_NUM_CHUNK_BUFFERS];
     MPIDI_msg_sz_t bytes_put;
     int found; /* used in probes with PtlMESearch() */
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
index 2fd80c4..2097003 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -17,13 +17,75 @@
 #define SENDBUF(req_) REQ_PTL(req_)->chunk_buffer[0]
 #define TMPBUF(req_) REQ_PTL(req_)->chunk_buffer[1]
 
-static char *recvbufs;
+static char *recvbufs[NUM_RECV_BUFS];
 static ptl_me_t overflow_me;
 static ptl_me_t get_me;
 static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
 static ptl_handle_me_t get_me_handle;
 
 
+/* AUX STUFF FOR REORDERING LOGIC */
+static GENERIC_Q_DECL(struct MPID_Request) reorder_queue;
+static char *expected_recv_ptr, *max_recv_ptr[NUM_RECV_BUFS];
+static int expected_recv_idx;
+
+#undef FUNCNAME
+#define FUNCNAME incr_expected_recv_ptr
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline void incr_expected_recv_ptr(size_t size)
+{
+    expected_recv_ptr += size > PTL_MAX_EAGER ? PTL_MAX_EAGER : size;
+    if (expected_recv_ptr > max_recv_ptr[expected_recv_idx]) {
+        ++expected_recv_idx;
+        if (expected_recv_idx == NUM_RECV_BUFS)
+            expected_recv_idx = 0;
+        expected_recv_ptr = recvbufs[expected_recv_idx];
+    }
+}
+
+#undef FUNCNAME
+#define FUNCNAME handle_request
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline int handle_request(MPID_Request *req)
+{
+    int mpi_errno = MPID_nem_handle_pkt(req->ch.vc, TMPBUF(req), REQ_PTL(req)->bytes_put);
+    incr_expected_recv_ptr(REQ_PTL(req)->bytes_put);
+    /* Free resources */
+    MPIU_Free(TMPBUF(req));
+    MPID_Request_release(req);
+    return mpi_errno;
+}
+
+#undef FUNCNAME
+#define FUNCNAME progress_reorder
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline int progress_reorder(void)
+{
+    MPID_Request *req;
+    int mpi_errno = MPI_SUCCESS;
+
+    GENERIC_Q_SEARCH_REMOVE(&reorder_queue,
+                            REQ_PTL(_e)->recv_ptr == expected_recv_ptr,
+                            &req, MPID_Request, dev.next);
+    while (req) {
+        mpi_errno = handle_request(req);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
+        GENERIC_Q_SEARCH_REMOVE(&reorder_queue,
+                                REQ_PTL(_e)->recv_ptr == expected_recv_ptr,
+                                &req, MPID_Request, dev.next);
+    }
+ fn_exit:
+    return mpi_errno;
+ fn_fail:
+    goto fn_exit;
+}
+/* END AUX STUFF FOR REORDERING LOGIC */
+
+
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_nm_init
 #undef FCNAME
@@ -33,6 +95,7 @@ int MPID_nem_ptl_nm_init(void)
     int mpi_errno = MPI_SUCCESS;
     int i;
     int ret;
+    char *tmp_ptr;
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_NM_INIT);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_NM_INIT);
@@ -50,14 +113,19 @@ int MPID_nem_ptl_nm_init(void)
     overflow_me.min_free = PTL_MAX_EAGER;
 
     /* allocate all overflow space at once */
-    recvbufs = MPIU_Malloc(NUM_RECV_BUFS * BUFSIZE);
+    tmp_ptr = MPIU_Malloc(NUM_RECV_BUFS * BUFSIZE);
+    expected_recv_ptr = tmp_ptr;
+    expected_recv_idx = 0;
 
     for (i = 0; i < NUM_RECV_BUFS; ++i) {
-        overflow_me.start = recvbufs + (i * BUFSIZE);
+        recvbufs[i] = tmp_ptr;
+        overflow_me.start = tmp_ptr;
         ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
                           PTL_OVERFLOW_LIST, (void *)(size_t)i, &me_handles[i]);
         MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
                              MPID_nem_ptl_strerror(ret));
+        tmp_ptr += BUFSIZE;
+        max_recv_ptr[i] = tmp_ptr - overflow_me.min_free;
     }
 
     /* register persistent ME for GET operations */
@@ -76,6 +144,9 @@ int MPID_nem_ptl_nm_init(void)
                       &get_me_handle);
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s", MPID_nem_ptl_strerror(ret));
 
+    /* init the reorder queue */
+    reorder_queue.head = reorder_queue.tail = NULL;
+
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_INIT);
     return mpi_errno;
@@ -106,7 +177,8 @@ int MPID_nem_ptl_nm_finalize(void)
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink", "**ptlmeunlink %s",
                          MPID_nem_ptl_strerror(ret));
 
-    MPIU_Free(recvbufs);
+    /* Freeing first element because the allocation was a single contiguous buffer */
+    MPIU_Free(recvbufs[0]);
 
  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_NM_FINALIZE);
@@ -393,9 +465,26 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
             vc_ptl = VC_PTL(vc);
 
             if (remaining == 0) {
-                mpi_errno = MPID_nem_handle_pkt(vc, e->start, packet_sz);
-                if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
+                if (e->start == expected_recv_ptr) {
+                    incr_expected_recv_ptr(packet_sz);
+                    mpi_errno = MPID_nem_handle_pkt(vc, e->start, packet_sz);
+                    if (mpi_errno)
+                        MPIU_ERR_POP(mpi_errno);
+                    mpi_errno = progress_reorder();
+                    if (mpi_errno)
+                        MPIU_ERR_POP(mpi_errno);
+                }
+                else {
+                    MPID_Request *req = MPID_Request_create();
+                    /* This request is actually complete; just needs to wait to enforce ordering */
+                    TMPBUF(req) = MPIU_Malloc(packet_sz);
+                    MPIU_Assert(TMPBUF(req));
+                    MPIU_Memcpy(TMPBUF(req), e->start, packet_sz);
+                    REQ_PTL(req)->bytes_put = packet_sz;
+                    req->ch.vc = vc;
+                    REQ_PTL(req)->recv_ptr = e->start;
+                    GENERIC_Q_ENQUEUE(&reorder_queue, req, dev.next);
+                }
             }
             else {
                 int incomplete;
@@ -411,7 +500,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 TMPBUF(req) = MPIU_Malloc(REQ_PTL(req)->bytes_put);
                 MPIU_Assert(TMPBUF(req) != NULL);
                 MPIU_Memcpy(TMPBUF(req), e->start, packet_sz);
-
+                REQ_PTL(req)->recv_ptr = e->start;
                 req->ch.vc = vc;
 
                 size = remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ? remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
@@ -477,13 +566,16 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
             MPIDI_CH3U_Request_decrement_cc(req, &incomplete);
             if (!incomplete) {
-                mpi_errno = MPID_nem_handle_pkt(req->ch.vc, TMPBUF(req), REQ_PTL(req)->bytes_put);
-                if (mpi_errno)
-                    MPIU_ERR_POP(mpi_errno);
-
-                /* Free resources */
-                MPIU_Free(TMPBUF(req));
-                MPID_Request_release(req);
+                if (REQ_PTL(req)->recv_ptr == expected_recv_ptr) {
+                    mpi_errno = handle_request(req);
+                    if (mpi_errno)
+                        MPIU_ERR_POP(mpi_errno);
+                    mpi_errno = progress_reorder();
+                    if (mpi_errno)
+                        MPIU_ERR_POP(mpi_errno);
+                }
+                else
+                    GENERIC_Q_ENQUEUE(&reorder_queue, req, dev.next);
             }
         }
         break;
@@ -493,7 +585,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
             size_t buf_idx = (size_t)e->user_ptr;
             int ret;
 
-            overflow_me.start = recvbufs + (buf_idx * BUFSIZE);
+            overflow_me.start = recvbufs[buf_idx];
 
             ret = PtlMEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &overflow_me,
                               PTL_OVERFLOW_LIST, e->user_ptr, &me_handles[buf_idx]);

http://git.mpich.org/mpich.git/commitdiff/2c090612559804d1f759b92535f242a603b580bc

commit 2c090612559804d1f759b92535f242a603b580bc
Author: Antonio Pena Monferrer <apenya at mcs.anl.gov>
Date:   Fri Jun 26 16:58:46 2015 -0500

    netmod/portals4: Remove unused field in netmod req
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index 92b840e..c06565d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -49,7 +49,6 @@ typedef struct {
     ptl_handle_me_t *get_me_p;
     int num_gets;
     int put_done;
-    ptl_size_t chunk_offset;
     void *chunk_buffer[MPID_NEM_PTL_NUM_CHUNK_BUFFERS];
     MPIDI_msg_sz_t bytes_put;
     int found; /* used in probes with PtlMESearch() */
@@ -73,7 +72,6 @@ static inline MPID_nem_ptl_req_area * REQ_PTL(MPID_Request *req) {
         REQ_PTL(req_)->num_gets      = 0;                       \
         REQ_PTL(req_)->put_done     = 0;                       \
         REQ_PTL(req_)->event_handler = NULL;                    \
-        REQ_PTL(req_)->chunk_offset  = 0;                       \
     } while (0)
 
 #define MPID_nem_ptl_request_create_sreq(sreq_, errno_, comm_) do {                                             \

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

Summary of changes:
 .../nemesis/include/mpid_nem_generic_queue.h       |    4 +-
 .../channels/nemesis/netmod/portals4/ptl_impl.h    |    3 +-
 .../ch3/channels/nemesis/netmod/portals4/ptl_nm.c  |  124 +++++++++++++++++---
 test/mpi/rma/Makefile.am                           |    3 +-
 test/mpi/rma/large-small-acc.c                     |   83 +++++++++++++
 test/mpi/rma/testlist.in                           |    1 +
 6 files changed, 198 insertions(+), 20 deletions(-)
 create mode 100644 test/mpi/rma/large-small-acc.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list