[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2a2-178-g51d6c94

Service Account noreply at mpich.org
Thu Feb 26 19:31:14 CST 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  51d6c94873957ca8ccbd996db2888e39c3687ed8 (commit)
       via  eb972bf67b442b36fdcd9e2138ca0e15ed45a9f8 (commit)
       via  fe0d61dbf896be25d1d63f63aed4ff5a3d2ee484 (commit)
       via  ad489f822654fde50d187b483590ee48901a399d (commit)
      from  6523ad970475dcbe71d8529d0928aa31ed416cdf (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/51d6c94873957ca8ccbd996db2888e39c3687ed8

commit 51d6c94873957ca8ccbd996db2888e39c3687ed8
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Feb 25 12:52:31 2015 -0600

    portals4: change variable name
    
    Make it clearer that the meappend_large is passed a usable set of match_bits.
    No further conversion is needed.
    
    Signed-off-by: Antonio Pena Monferrer <apenya at mcs.anl.gov>

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 d13adae..0564ac0 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -96,7 +96,7 @@ int MPID_nem_ptl_nm_finalize(void)
 #define FUNCNAME meappend_large
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_bits_t tag, void *buf, size_t remaining)
+static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_bits_t match_bits, void *buf, size_t remaining)
 {
     int mpi_errno = MPI_SUCCESS;
     int ret;
@@ -113,7 +113,7 @@ static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_
     me.options = ( PTL_ME_OP_GET | PTL_ME_USE_ONCE | PTL_ME_IS_ACCESSIBLE |
                    PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
     me.match_id = id;
-    me.match_bits = tag;
+    me.match_bits = match_bits;
     me.ignore_bits = NPTL_MATCH_IGNORE;
     me.min_free = 0;
 
@@ -126,7 +126,7 @@ static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_
                                      &foo_me_handle);
         MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend", "**ptlmeappend %s",
                              MPID_nem_ptl_strerror(ret));
-        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, tag));
+        MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlMEAppend(req=%p tag=%#lx)", req, NPTL_MATCH_GET_TAG(match_bits)));
 
         me.start = (char *)me.start + me.length;
         remaining -= me.length;

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

commit eb972bf67b442b36fdcd9e2138ca0e15ed45a9f8
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Feb 25 09:12:22 2015 -0600

    portals4: use portals4 hdr_data for length info
    
    Moves the message length information from the payload to the message
    header to save on overhead.
    
    Signed-off-by: Antonio Pena Monferrer <apenya at mcs.anl.gov>

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 a4a2134..d13adae 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -12,17 +12,12 @@
 #define NUM_RECV_BUFS 50
 #define CTL_TAG 0
 #define GET_TAG 1
-#define PAYLOAD_SIZE  (PTL_MAX_EAGER - offsetof(buf_t, packet) - sizeof(MPIDI_CH3_Pkt_t))
-#define SENDBUF_SIZE(sent_sz_) (offsetof(buf_t, packet) + sizeof(MPIDI_CH3_Pkt_t) + (sent_sz_))
+#define PAYLOAD_SIZE  (PTL_MAX_EAGER - sizeof(MPIDI_CH3_Pkt_t))
+#define SENDBUF_SIZE(sent_sz_) (sizeof(MPIDI_CH3_Pkt_t) + (sent_sz_))
 #define SENDBUF(req_) REQ_PTL(req_)->chunk_buffer[0]
 #define TMPBUF(req_) REQ_PTL(req_)->chunk_buffer[1]
 
-typedef struct {
-    size_t remaining;
-    char packet[PTL_MAX_EAGER];
-} buf_t;
-
-static buf_t recvbufs[NUM_RECV_BUFS];
+static char recvbufs[NUM_RECV_BUFS * PTL_MAX_EAGER];
 static ptl_me_t mes[NUM_RECV_BUFS];
 static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
 static unsigned long long put_cnt = 0;  /* required to not finalizing too early */
@@ -46,8 +41,8 @@ int MPID_nem_ptl_nm_init(void)
     id_any.phys.nid = PTL_NID_ANY;
     
     for (i = 0; i < NUM_RECV_BUFS; ++i) {
-        mes[i].start = &recvbufs[i];
-        mes[i].length = sizeof(buf_t);
+        mes[i].start = &recvbufs[i * PTL_MAX_EAGER];
+        mes[i].length = PTL_MAX_EAGER;
         mes[i].ct_handle = PTL_CT_NONE;
         mes[i].uid = PTL_UID_ANY;
         mes[i].options = (PTL_ME_OP_PUT | PTL_ME_USE_ONCE | PTL_ME_EVENT_UNLINK_DISABLE |
@@ -156,9 +151,10 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     int mpi_errno = MPI_SUCCESS;
     MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
     int ret;
-    buf_t *sendbuf;
+    char *sendbuf;
     const size_t sent_sz = data_sz < PAYLOAD_SIZE ? data_sz : PAYLOAD_SIZE;
     const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz);
+    const size_t remaining = data_sz - sent_sz;
     ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
     MPIDI_STATE_DECL(MPID_STATE_SEND_PKT);
 
@@ -166,17 +162,16 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     
     sendbuf = MPIU_Malloc(sendbuf_sz);
     MPIU_Assert(sendbuf != NULL);
-    MPIU_Memcpy(sendbuf->packet, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
-    sendbuf->remaining = data_sz - sent_sz;
+    MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     TMPBUF(sreq) = NULL;
     REQ_PTL(sreq)->num_gets = 0;
     REQ_PTL(sreq)->put_done = 0;
 
     if (data_sz) {
-        MPIU_Memcpy(sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
-        if (sendbuf->remaining)  /* Post MEs for the remote gets */
+        MPIU_Memcpy(sendbuf + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
+        if (remaining)  /* Post MEs for the remote gets */
             mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank),
-                                       (char *)data_p + sent_sz, sendbuf->remaining);
+                                       (char *)data_p + sent_sz, remaining);
             if (mpi_errno)
                 goto fn_fail;
     }
@@ -185,7 +180,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
-                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, 0);
+                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
@@ -209,9 +204,10 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     int mpi_errno = MPI_SUCCESS;
     MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
     int ret;
-    buf_t *sendbuf;
+    char *sendbuf;
     const size_t sent_sz = sreq->dev.segment_size < PAYLOAD_SIZE ? sreq->dev.segment_size : PAYLOAD_SIZE;
-    size_t sendbuf_sz = SENDBUF_SIZE(sent_sz);
+    const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz);
+    const size_t remaining = sreq->dev.segment_size - sent_sz;
     ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
     MPIDI_STATE_DECL(MPID_STATE_SEND_NONCONTIG_PKT);
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_NONCONTIG_PKT);
@@ -220,24 +216,23 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
 
     sendbuf = MPIU_Malloc(sendbuf_sz);
     MPIU_Assert(sendbuf != NULL);
-    MPIU_Memcpy(sendbuf->packet, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
-    sendbuf->remaining = sreq->dev.segment_size - sent_sz;
+    MPIU_Memcpy(sendbuf, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     TMPBUF(sreq) = NULL;
     REQ_PTL(sreq)->num_gets = 0;
     REQ_PTL(sreq)->put_done = 0;
 
     if (sreq->dev.segment_size) {
         MPIDI_msg_sz_t last = sent_sz;
-        MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t));
+        MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sendbuf + sizeof(MPIDI_CH3_Pkt_t));
 
-        if (sendbuf->remaining) {  /* Post MEs for the remote gets */
-            TMPBUF(sreq) = MPIU_Malloc(sendbuf->remaining);
+        if (remaining) {  /* Post MEs for the remote gets */
+            TMPBUF(sreq) = MPIU_Malloc(remaining);
             sreq->dev.segment_first = last;
             last = sreq->dev.segment_size;
             MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, TMPBUF(sreq));
             MPIU_Assert(last == sreq->dev.segment_size);
 
-            mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), TMPBUF(sreq), sendbuf->remaining);
+            mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), TMPBUF(sreq), remaining);
             if (mpi_errno)
                 goto fn_fail;
         }
@@ -247,7 +242,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
-                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, 0);
+                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, NPTL_HEADER(0, remaining));
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
@@ -384,17 +379,18 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
         {
             int ret;
             const uint64_t buf_idx = (uint64_t) e->user_ptr;
-            const size_t packet_sz = e->mlength - offsetof(buf_t, packet);
+            const size_t packet_sz = e->mlength;
             MPIDI_VC_t *vc;
             MPID_nem_ptl_vc_area * vc_ptl;
+            ptl_size_t remaining = NPTL_HEADER_GET_LENGTH(e->hdr_data);
 
-            MPIU_Assert(e->start == &recvbufs[buf_idx]);
+            MPIU_Assert(e->start == &recvbufs[buf_idx * PTL_MAX_EAGER]);
 
             MPIDI_PG_Get_vc(MPIDI_Process.my_pg, NPTL_MATCH_GET_RANK(e->match_bits), &vc);
             vc_ptl = VC_PTL(vc);
 
-            if (recvbufs[buf_idx].remaining == 0) {
-                mpi_errno = MPID_nem_handle_pkt(vc, recvbufs[buf_idx].packet, packet_sz);
+            if (remaining == 0) {
+                mpi_errno = MPID_nem_handle_pkt(vc, &recvbufs[buf_idx * PTL_MAX_EAGER], packet_sz);
                 if (mpi_errno)
                     MPIU_ERR_POP(mpi_errno);
             }
@@ -407,17 +403,16 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 MPIU_Assert(req != NULL);
                 MPIDI_CH3U_Request_decrement_cc(req, &incomplete);  /* We'll increment it below */
                 REQ_PTL(req)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
-                REQ_PTL(req)->bytes_put = packet_sz + recvbufs[buf_idx].remaining;
+                REQ_PTL(req)->bytes_put = packet_sz + remaining;
                 TMPBUF(req) = MPIU_Malloc(REQ_PTL(req)->bytes_put);
                 MPIU_Assert(TMPBUF(req) != NULL);
-                MPIU_Memcpy(TMPBUF(req), recvbufs[buf_idx].packet, packet_sz);
+                MPIU_Memcpy(TMPBUF(req), &recvbufs[buf_idx * PTL_MAX_EAGER], packet_sz);
 
                 req->ch.vc = vc;
 
-                size = recvbufs[buf_idx].remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ?
-                           recvbufs[buf_idx].remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
+                size = remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ? remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
                 buf_ptr = (char *)TMPBUF(req) + packet_sz;
-                while (recvbufs[buf_idx].remaining) {
+                while (remaining) {
                     MPIDI_CH3U_Request_increment_cc(req, &incomplete);  /* Will be decremented - and eventually freed in REPLY */
                     ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
                                                 size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), 0, req);
@@ -428,9 +423,9 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                                                             vc_ptl->id.phys.nid,
                                                             vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG));
                     buf_ptr += size;
-                    recvbufs[buf_idx].remaining -= size;
-                    if (recvbufs[buf_idx].remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)
-                        size = recvbufs[buf_idx].remaining;
+                    remaining -= size;
+                    if (remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)
+                        size = remaining;
                 }
             }
 

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

commit fe0d61dbf896be25d1d63f63aed4ff5a3d2ee484
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Tue Feb 24 23:12:28 2015 -0600

    portals4: encode rank in match bits instead of header
    
    Use the match bits to encode a process's rank in MPI_COMM_WORLD, to be
    retrieved by the receiving process. This is the same method used by the
    2-sided Portals code, and allows the header to be used for other purposes.
    
    Signed-off-by: Antonio Pena Monferrer <apenya at mcs.anl.gov>

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 41ceaa0..a4a2134 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -53,8 +53,8 @@ int MPID_nem_ptl_nm_init(void)
         mes[i].options = (PTL_ME_OP_PUT | PTL_ME_USE_ONCE | PTL_ME_EVENT_UNLINK_DISABLE |
                          PTL_ME_EVENT_LINK_DISABLE | PTL_ME_IS_ACCESSIBLE);
         mes[i].match_id = id_any;
-        mes[i].match_bits = CTL_TAG;
-        mes[i].ignore_bits = 0;
+        mes[i].match_bits = NPTL_MATCH(CTL_TAG, 0, MPI_ANY_SOURCE);
+        mes[i].ignore_bits = NPTL_MATCH_IGNORE;
 
         ret = MPID_nem_ptl_me_append(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_control_pt, &mes[i],
                                      PTL_PRIORITY_LIST, (void *)(uint64_t)i, &me_handles[i]);
@@ -119,7 +119,7 @@ static inline int meappend_large(ptl_process_t id, MPID_Request *req, ptl_match_
                    PTL_ME_EVENT_LINK_DISABLE | PTL_ME_EVENT_UNLINK_DISABLE );
     me.match_id = id;
     me.match_bits = tag;
-    me.ignore_bits = 0;
+    me.ignore_bits = NPTL_MATCH_IGNORE;
     me.min_free = 0;
 
     while (remaining) {
@@ -159,6 +159,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     buf_t *sendbuf;
     const size_t sent_sz = data_sz < PAYLOAD_SIZE ? data_sz : PAYLOAD_SIZE;
     const size_t sendbuf_sz = SENDBUF_SIZE(sent_sz);
+    ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
     MPIDI_STATE_DECL(MPID_STATE_SEND_PKT);
 
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_PKT);
@@ -174,7 +175,8 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     if (data_sz) {
         MPIU_Memcpy(sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
         if (sendbuf->remaining)  /* Post MEs for the remote gets */
-            mpi_errno = meappend_large(vc_ptl->id, sreq, GET_TAG, (char *)data_p + sent_sz, sendbuf->remaining);
+            mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank),
+                                       (char *)data_p + sent_sz, sendbuf->remaining);
             if (mpi_errno)
                 goto fn_fail;
     }
@@ -183,7 +185,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
-                                vc_ptl->id, vc_ptl->ptc, CTL_TAG, 0, sreq, MPIDI_Process.my_pg_rank);
+                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, 0);
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
@@ -210,6 +212,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     buf_t *sendbuf;
     const size_t sent_sz = sreq->dev.segment_size < PAYLOAD_SIZE ? sreq->dev.segment_size : PAYLOAD_SIZE;
     size_t sendbuf_sz = SENDBUF_SIZE(sent_sz);
+    ptl_match_bits_t match_bits = NPTL_MATCH(CTL_TAG, 0, MPIDI_Process.my_pg_rank);
     MPIDI_STATE_DECL(MPID_STATE_SEND_NONCONTIG_PKT);
     MPIDI_FUNC_ENTER(MPID_STATE_SEND_NONCONTIG_PKT);
 
@@ -234,7 +237,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
             MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, TMPBUF(sreq));
             MPIU_Assert(last == sreq->dev.segment_size);
 
-            mpi_errno = meappend_large(vc_ptl->id, sreq, GET_TAG, TMPBUF(sreq), sendbuf->remaining);
+            mpi_errno = meappend_large(vc_ptl->id, sreq, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), TMPBUF(sreq), sendbuf->remaining);
             if (mpi_errno)
                 goto fn_fail;
         }
@@ -244,7 +247,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     REQ_PTL(sreq)->event_handler = MPID_nem_ptl_nm_ctl_event_handler;
 
     ret = MPID_nem_ptl_rptl_put(MPIDI_nem_ptl_global_md, (ptl_size_t)sendbuf, sendbuf_sz, PTL_NO_ACK_REQ,
-                                vc_ptl->id, vc_ptl->ptc, CTL_TAG, 0, sreq, MPIDI_Process.my_pg_rank);
+                                vc_ptl->id, vc_ptl->ptc, match_bits, 0, sreq, 0);
     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlput", "**ptlput %s",
                          MPID_nem_ptl_strerror(ret));
     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "PtlPut(size=%lu id=(%#x,%#x) pt=%#x)",
@@ -387,7 +390,7 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
             MPIU_Assert(e->start == &recvbufs[buf_idx]);
 
-            MPIDI_PG_Get_vc(MPIDI_Process.my_pg, (uint64_t)e->hdr_data, &vc);
+            MPIDI_PG_Get_vc(MPIDI_Process.my_pg, NPTL_MATCH_GET_RANK(e->match_bits), &vc);
             vc_ptl = VC_PTL(vc);
 
             if (recvbufs[buf_idx].remaining == 0) {
@@ -417,11 +420,11 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
                 while (recvbufs[buf_idx].remaining) {
                     MPIDI_CH3U_Request_increment_cc(req, &incomplete);  /* Will be decremented - and eventually freed in REPLY */
                     ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
-                                                size, vc_ptl->id, vc_ptl->ptc, GET_TAG, 0, req);
+                                                size, vc_ptl->id, vc_ptl->ptc, NPTL_MATCH(GET_TAG, 0, MPIDI_Process.my_pg_rank), 0, req);
                     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
                                          MPID_nem_ptl_strerror(ret));
                     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
-                                                            "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%#lx)", size,
+                                                            "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%d)", size,
                                                             vc_ptl->id.phys.nid,
                                                             vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG));
                     buf_ptr += size;

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

commit ad489f822654fde50d187b483590ee48901a399d
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Feb 11 16:15:26 2015 -0600

    portals4: simplify operation tags in RMA code
    
    Since we use the same portal for puts and gets in the RMA code, we
    differentiate them with the otherwise unused match_bits. This commit
    removes the sequenced tag numbers, instead relying on a simple 2 tag
    system and the natural matching order of the portal.
    
    Signed-off-by: Antonio Pena Monferrer <apenya at mcs.anl.gov>

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 1780920..41ceaa0 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_nm.c
@@ -11,19 +11,14 @@
 
 #define NUM_RECV_BUFS 50
 #define CTL_TAG 0
+#define GET_TAG 1
 #define PAYLOAD_SIZE  (PTL_MAX_EAGER - offsetof(buf_t, packet) - sizeof(MPIDI_CH3_Pkt_t))
 #define SENDBUF_SIZE(sent_sz_) (offsetof(buf_t, packet) + sizeof(MPIDI_CH3_Pkt_t) + (sent_sz_))
 #define SENDBUF(req_) REQ_PTL(req_)->chunk_buffer[0]
 #define TMPBUF(req_) REQ_PTL(req_)->chunk_buffer[1]
-#define NEW_TAG(tag_) do {       \
-    if (++global_tag == CTL_TAG) \
-        ++global_tag;            \
-    (tag_) = global_tag;         \
-} while(0)
 
 typedef struct {
     size_t remaining;
-    ptl_match_bits_t tag;
     char packet[PTL_MAX_EAGER];
 } buf_t;
 
@@ -31,8 +26,6 @@ static buf_t recvbufs[NUM_RECV_BUFS];
 static ptl_me_t mes[NUM_RECV_BUFS];
 static ptl_handle_me_t me_handles[NUM_RECV_BUFS];
 static unsigned long long put_cnt = 0;  /* required to not finalizing too early */
-static ptl_match_bits_t global_tag = 0;
-
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_ptl_nm_init
@@ -174,7 +167,6 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     MPIU_Assert(sendbuf != NULL);
     MPIU_Memcpy(sendbuf->packet, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     sendbuf->remaining = data_sz - sent_sz;
-    NEW_TAG(sendbuf->tag);
     TMPBUF(sreq) = NULL;
     REQ_PTL(sreq)->num_gets = 0;
     REQ_PTL(sreq)->put_done = 0;
@@ -182,7 +174,7 @@ static inline int send_pkt(MPIDI_VC_t *vc, void *hdr_p, void *data_p, MPIDI_msg_
     if (data_sz) {
         MPIU_Memcpy(sendbuf->packet + sizeof(MPIDI_CH3_Pkt_t), data_p, sent_sz);
         if (sendbuf->remaining)  /* Post MEs for the remote gets */
-            mpi_errno = meappend_large(vc_ptl->id, sreq, sendbuf->tag, (char *)data_p + sent_sz, sendbuf->remaining);
+            mpi_errno = meappend_large(vc_ptl->id, sreq, GET_TAG, (char *)data_p + sent_sz, sendbuf->remaining);
             if (mpi_errno)
                 goto fn_fail;
     }
@@ -227,7 +219,6 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
     MPIU_Assert(sendbuf != NULL);
     MPIU_Memcpy(sendbuf->packet, hdr_p, sizeof(MPIDI_CH3_Pkt_t));
     sendbuf->remaining = sreq->dev.segment_size - sent_sz;
-    NEW_TAG(sendbuf->tag);
     TMPBUF(sreq) = NULL;
     REQ_PTL(sreq)->num_gets = 0;
     REQ_PTL(sreq)->put_done = 0;
@@ -243,7 +234,7 @@ static int send_noncontig_pkt(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr_p)
             MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, TMPBUF(sreq));
             MPIU_Assert(last == sreq->dev.segment_size);
 
-            mpi_errno = meappend_large(vc_ptl->id, sreq, sendbuf->tag, TMPBUF(sreq), sendbuf->remaining);
+            mpi_errno = meappend_large(vc_ptl->id, sreq, GET_TAG, TMPBUF(sreq), sendbuf->remaining);
             if (mpi_errno)
                 goto fn_fail;
         }
@@ -420,21 +411,19 @@ int MPID_nem_ptl_nm_ctl_event_handler(const ptl_event_t *e)
 
                 req->ch.vc = vc;
 
-                req->dev.match.parts.tag = recvbufs[buf_idx].tag;
-
                 size = recvbufs[buf_idx].remaining < MPIDI_nem_ptl_ni_limits.max_msg_size ?
                            recvbufs[buf_idx].remaining : MPIDI_nem_ptl_ni_limits.max_msg_size;
                 buf_ptr = (char *)TMPBUF(req) + packet_sz;
                 while (recvbufs[buf_idx].remaining) {
                     MPIDI_CH3U_Request_increment_cc(req, &incomplete);  /* Will be decremented - and eventually freed in REPLY */
                     ret = MPID_nem_ptl_rptl_get(MPIDI_nem_ptl_global_md, (ptl_size_t)buf_ptr,
-                                                size, vc_ptl->id, vc_ptl->ptc, recvbufs[buf_idx].tag, 0, req);
+                                                size, vc_ptl->id, vc_ptl->ptc, GET_TAG, 0, req);
                     MPIU_ERR_CHKANDJUMP1(ret, mpi_errno, MPI_ERR_OTHER, "**ptlget", "**ptlget %s",
                                          MPID_nem_ptl_strerror(ret));
                     MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST,
                                                             "PtlGet(size=%lu id=(%#x,%#x) pt=%#x tag=%#lx)", size,
                                                             vc_ptl->id.phys.nid,
-                                                            vc_ptl->id.phys.pid, vc_ptl->ptc, recvbufs[buf_idx].tag));
+                                                            vc_ptl->id.phys.pid, vc_ptl->ptc, GET_TAG));
                     buf_ptr += size;
                     recvbufs[buf_idx].remaining -= size;
                     if (recvbufs[buf_idx].remaining < MPIDI_nem_ptl_ni_limits.max_msg_size)

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

Summary of changes:
 .../ch3/channels/nemesis/netmod/portals4/ptl_nm.c  |  109 +++++++++-----------
 1 files changed, 48 insertions(+), 61 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list