[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-29-g601918c

Service Account noreply at mpich.org
Wed Jul 29 21:54:30 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  601918c88f79150fc40acfb810d00514b7a5ed53 (commit)
       via  e2338f7505da3fce5659a34d42f2f15bd6c45d65 (commit)
      from  9882227414439a4a79edd49ec10261742bb60108 (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/601918c88f79150fc40acfb810d00514b7a5ed53

commit 601918c88f79150fc40acfb810d00514b7a5ed53
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jul 29 21:52:12 2015 -0500

    White space cleanup.
    
    No reviewer.

diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
index 6628ffe..7de0229 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
@@ -59,7 +59,7 @@ int MPID_nem_mxm_cancel_recv(MPIDI_VC_t * vc, MPID_Request * req)
     if (likely(!_mxm_req_test(&req_area->mxm_req->item.base))) {
         ret = mxm_req_cancel_recv(&req_area->mxm_req->item.recv);
         if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
-            _mxm_req_wait(&req_area-> mxm_req->item.base);
+            _mxm_req_wait(&req_area->mxm_req->item.base);
         }
         else {
             mpi_errno = MPI_ERR_INTERN;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
index 770078b..faa95b8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -38,12 +38,15 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *heade
 
 /* direct interface */
 int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq);
-int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                      int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_p);
-int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                       int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_p);
-int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                       int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_p);
+int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                      int rank, int tag, MPID_Comm * comm, int context_offset,
+                      MPID_Request ** sreq_p);
+int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                       int rank, int tag, MPID_Comm * comm, int context_offset,
+                       MPID_Request ** sreq_p);
+int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                       int rank, int tag, MPID_Comm * comm, int context_offset,
+                       MPID_Request ** sreq_p);
 int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
                         int rank, int tag, MPID_Comm * comm, int context_offset,
                         MPID_Request ** sreq_p);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
index d86c307..ebbdda7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -83,7 +83,7 @@ static MPIDI_Comm_ops_t comm_ops = {
     MPID_nem_mxm_ssend, /* ssend */
     MPID_nem_mxm_isend, /* isend */
     MPID_nem_mxm_isend, /* irsend */
-    MPID_nem_mxm_issend,/* issend */
+    MPID_nem_mxm_issend,        /* issend */
 
     NULL,       /* send_init */
     NULL,       /* bsend_init */
@@ -423,8 +423,10 @@ static int _mxm_conf(void)
              "%ld.%ld", (cur_ver >> MXM_MAJOR_BIT) & 0xff, (cur_ver >> MXM_MINOR_BIT) & 0xff);
 #endif
 
-    _mxm_obj.conf.bulk_connect = cur_ver < MXM_VERSION(3, 2) ? 0 : MPIR_CVAR_NEMESIS_MXM_BULK_CONNECT;
-    _mxm_obj.conf.bulk_disconnect = cur_ver < MXM_VERSION(3, 2) ? 0 : MPIR_CVAR_NEMESIS_MXM_BULK_DISCONNECT;
+    _mxm_obj.conf.bulk_connect =
+        cur_ver < MXM_VERSION(3, 2) ? 0 : MPIR_CVAR_NEMESIS_MXM_BULK_CONNECT;
+    _mxm_obj.conf.bulk_disconnect =
+        cur_ver < MXM_VERSION(3, 2) ? 0 : MPIR_CVAR_NEMESIS_MXM_BULK_DISCONNECT;
 
     if (cur_ver < MXM_VERSION(3, 2) &&
         (_mxm_obj.conf.bulk_connect || _mxm_obj.conf.bulk_disconnect)) {
@@ -631,28 +633,28 @@ static int _mxm_add_comm(MPID_Comm * comm, void *param)
     mxm_mq_h *mq_h_v;
     MPIU_CHKPMEM_DECL(1);
 
-    MPIU_CHKPMEM_MALLOC(mq_h_v, mxm_mq_h*, sizeof(mxm_mq_h)*2, mpi_errno, "mxm_mq_h_context_ptr" );
+    MPIU_CHKPMEM_MALLOC(mq_h_v, mxm_mq_h *, sizeof(mxm_mq_h) * 2, mpi_errno,
+                        "mxm_mq_h_context_ptr");
 
     _dbg_mxm_output(6, "Add COMM comm %p (rank %d type %d context %d | %d size %d | %d) \n",
                     comm, comm->rank, comm->comm_kind,
-                    comm->context_id, comm->recvcontext_id,
-                    comm->local_size, comm->remote_size);
+                    comm->context_id, comm->recvcontext_id, comm->local_size, comm->remote_size);
 
     ret = mxm_mq_create(_mxm_obj.mxm_context, comm->recvcontext_id, &mq_h_v[0]);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
-    if(comm->recvcontext_id != comm->context_id){
+    if (comm->recvcontext_id != comm->context_id) {
         ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mq_h_v[1]);
         MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
-                         mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
+                             mpi_errno, MPI_ERR_OTHER,
+                             "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
     }
     else
-       memcpy(&mq_h_v[1], &mq_h_v[0], sizeof(mxm_mq_h));
+        memcpy(&mq_h_v[1], &mq_h_v[0], sizeof(mxm_mq_h));
 
-    comm->dev.ch.netmod_priv = (void *)mq_h_v;
+    comm->dev.ch.netmod_priv = (void *) mq_h_v;
 
   fn_exit:
     MPIU_CHKPMEM_COMMIT();
@@ -665,10 +667,9 @@ static int _mxm_add_comm(MPID_Comm * comm, void *param)
 static int _mxm_del_comm(MPID_Comm * comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
-    mxm_mq_h *mxm_mq = (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mxm_mq = (mxm_mq_h *) comm->dev.ch.netmod_priv;
 
-    _dbg_mxm_output(6, "Del COMM comm %p (rank %d type %d) \n",
-                    comm, comm->rank, comm->comm_kind);
+    _dbg_mxm_output(6, "Del COMM comm %p (rank %d type %d) \n", comm, comm->rank, comm->comm_kind);
 
     if (mxm_mq[1] != mxm_mq[0])
         mxm_mq_destroy(mxm_mq[1]);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
index 448715f..0b7a651 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -172,7 +172,7 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
         MPID_nem_mxm_vc_area *vc_area = NULL;
         MPID_nem_mxm_req_area *req_area = NULL;
 
-        mxm_mq_h *mq_h_v =  (mxm_mq_h*) rreq->comm->dev.ch.netmod_priv;
+        mxm_mq_h *mq_h_v = (mxm_mq_h *) rreq->comm->dev.ch.netmod_priv;
         rreq->dev.OnDataAvail = NULL;
         rreq->dev.tmpbuf = NULL;
         rreq->ch.vc = vc;
@@ -207,8 +207,8 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
 
         mpi_errno = _mxm_irecv((vc_area ? vc_area->mxm_ep : NULL), req_area,
                                tag,
-                               (rreq->comm ? mq_h_v[0] : mxm_obj->
-                                mxm_mq), _mxm_tag_mpi2mxm(tag, context_id));
+                               (rreq->comm ? mq_h_v[0] : mxm_obj->mxm_mq), _mxm_tag_mpi2mxm(tag,
+                                                                                            context_id));
         if (mpi_errno)
             MPIU_ERR_POP(mpi_errno);
     }
@@ -240,7 +240,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
     found = MPIDI_CH3U_Recvq_DP(req);
     MPIU_THREAD_CS_EXIT(MSGQUEUE, req);
     /* an MPI_ANY_SOURCE request may have been previously removed from the
-       CH3 queue by an FDP (find and dequeue posted) operation */
+     * CH3 queue by an FDP (find and dequeue posted) operation */
     if (req->dev.match.parts.rank != MPI_ANY_SOURCE) {
         MPIU_Assert(found);
     }
@@ -252,8 +252,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
     req_area = REQ_BASE(req);
 
     _dbg_mxm_out_buf(req_area->iov_buf[0].ptr,
-                     (req_area->iov_buf[0].length >
-                      16 ? 16 : req_area->iov_buf[0].length));
+                     (req_area->iov_buf[0].length > 16 ? 16 : req_area->iov_buf[0].length));
 
     if (req->dev.recv_data_sz <= userbuf_sz) {
         data_sz = req->dev.recv_data_sz;
@@ -291,7 +290,7 @@ static int _mxm_handle_rreq(MPID_Request * req)
             tmp_buf = req->dev.tmpbuf;
         }
         else {
-            mxm_req_buffer_t * iov_buf;
+            mxm_req_buffer_t *iov_buf;
             MPID_IOV *iov;
             int n_iov = 0;
             int index;
@@ -308,7 +307,8 @@ static int _mxm_handle_rreq(MPID_Request * req)
                     iov[index].MPID_IOV_LEN = iov_buf[index].length;
                 }
 
-                MPID_Segment_unpack_vector(req->dev.segment_ptr, req->dev.segment_first, &last, iov, &n_iov);
+                MPID_Segment_unpack_vector(req->dev.segment_ptr, req->dev.segment_first, &last, iov,
+                                           &n_iov);
                 MPIU_Free(iov);
             }
             if (req_area->iov_count > MXM_MPICH_MAX_IOV) {
@@ -332,7 +332,8 @@ static int _mxm_handle_rreq(MPID_Request * req)
     MPIDI_CH3U_Handle_recv_req(req->ch.vc, req, &complete);
     MPIU_Assert(complete == TRUE);
 
-    if (tmp_buf) MPIU_Free(tmp_buf);
+    if (tmp_buf)
+        MPIU_Free(tmp_buf);
 
     return complete;
 }
@@ -463,8 +464,9 @@ static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
     MPIU_Assert(last == rreq->dev.segment_size);
 
 #if defined(MXM_DEBUG) && (MXM_DEBUG > 0)
-    _dbg_mxm_output(7, "Recv Noncontiguous data vector %i entries (free slots : %i)\n", n_iov, MXM_REQ_DATA_MAX_IOV);
-    for(index = 0; index < n_iov; index++) {
+    _dbg_mxm_output(7, "Recv Noncontiguous data vector %i entries (free slots : %i)\n", n_iov,
+                    MXM_REQ_DATA_MAX_IOV);
+    for (index = 0; index < n_iov; index++) {
         _dbg_mxm_output(7, "======= Recv iov[%i] = ptr : %p, len : %i \n",
                         index, iov[index].MPID_IOV_BUF, iov[index].MPID_IOV_LEN);
     }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
index e06416d..6cc2c02 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -19,7 +19,7 @@ int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, i
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_PROBE);
@@ -65,7 +65,7 @@ int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_IPROBE);
@@ -112,7 +112,7 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
     mxm_message_h mxm_msg;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_IMPROBE);
@@ -166,15 +166,16 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
         *message = req;
 
         /* TODO: Should we change status
-                _mxm_to_mpi_status(mxm_req.base.error, status);
-        */
+         * _mxm_to_mpi_status(mxm_req.base.error, status);
+         */
         status->MPI_SOURCE = req->status.MPI_SOURCE;
         status->MPI_TAG = req->status.MPI_TAG;
         MPIR_STATUS_SET_COUNT(*status, req->dev.recv_data_sz);
 
         _dbg_mxm_output(8,
                         "imProbe ========> Found USER msg (context %d from %d tag %d size %d) \n",
-                        comm->context_id + context_offset, status->MPI_SOURCE, status->MPI_TAG, MPIR_STATUS_GET_COUNT(*status));
+                        comm->context_id + context_offset, status->MPI_SOURCE, status->MPI_TAG,
+                        MPIR_STATUS_GET_COUNT(*status));
     }
     else if (MXM_ERR_NO_MESSAGE == err) {
         *flag = 0;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
index 6e8b9c6..7e321bd 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -177,7 +177,7 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
     _dbg_mxm_output(5,
                     "SendNoncontig ========> Sending ADI msg (to=%d type=%d) for req %p (data_size %d, %d) \n",
                     vc->pg_rank, sreq->dev.pending_pkt.type, sreq, sizeof(MPIDI_CH3_Pkt_t),
-                    sreq->dev.segment_size-sreq->dev.segment_first);
+                    sreq->dev.segment_size - sreq->dev.segment_first);
 
     vc_area = VC_BASE(vc);
     req_area = REQ_BASE(sreq);
@@ -236,8 +236,9 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
 #define FUNCNAME MPID_nem_mxm_send
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                      int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_ptr)
+int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                      int rank, int tag, MPID_Comm * comm, int context_offset,
+                      MPID_Request ** sreq_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPID_Request *sreq = NULL;
@@ -247,7 +248,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SEND);
@@ -318,10 +319,8 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
                            mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
-                                                                                              comm->context_id
-                                                                                              +
-                                                                                              context_offset),
-                           0);
+                                                                        comm->context_id
+                                                                        + context_offset), 0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
@@ -340,8 +339,9 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
 #define FUNCNAME MPID_nem_mxm_ssend
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                       int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_ptr)
+int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                       int rank, int tag, MPID_Comm * comm, int context_offset,
+                       MPID_Request ** sreq_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPID_Request *sreq = NULL;
@@ -351,7 +351,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SSEND);
@@ -422,10 +422,8 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
                            mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
-                                                                                              comm->context_id
-                                                                                              +
-                                                                                              context_offset),
-                           0);
+                                                                        comm->context_id
+                                                                        + context_offset), 0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
@@ -444,8 +442,9 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 #define FUNCNAME MPID_nem_mxm_isend
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype, int rank,
-                       int tag, MPID_Comm * comm, int context_offset, MPID_Request ** sreq_ptr)
+int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Datatype datatype,
+                       int rank, int tag, MPID_Comm * comm, int context_offset,
+                       MPID_Request ** sreq_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPID_Request *sreq = NULL;
@@ -455,7 +454,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISEND);
@@ -526,10 +525,8 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
                            mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
-                                                                                              comm->context_id
-                                                                                              +
-                                                                                              context_offset),
-                           0);
+                                                                        comm->context_id
+                                                                        + context_offset), 0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
@@ -560,7 +557,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
-    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mq_h_v = (mxm_mq_h *) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISSEND);
@@ -591,7 +588,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
     vc_area = VC_BASE(vc);
     req_area = REQ_BASE(sreq);
 
-    req_area-> ctx = sreq;
+    req_area->ctx = sreq;
     req_area->iov_buf = req_area->tmp_buf;
     req_area->iov_count = 0;
     req_area->iov_buf[0].ptr = NULL;
@@ -631,10 +628,8 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
                            mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
-                                                                                              comm->context_id
-                                                                                              +
-                                                                                              context_offset),
-                           0);
+                                                                        comm->context_id
+                                                                        + context_offset), 0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
@@ -659,8 +654,7 @@ int _mxm_handle_sreq(MPID_Request * req)
     req_area = REQ_BASE(req);
 
     _dbg_mxm_out_buf(req_area->iov_buf[0].ptr,
-                     (req_area->iov_buf[0].length >
-                      16 ? 16 : req_area->iov_buf[0].length));
+                     (req_area->iov_buf[0].length > 16 ? 16 : req_area->iov_buf[0].length));
 
     vc_area->pending_sends -= 1;
     if (req->dev.tmpbuf) {
@@ -820,8 +814,9 @@ static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
     MPIU_Assert(last == sreq->dev.segment_size);
 
 #if defined(MXM_DEBUG) && (MXM_DEBUG > 0)
-    _dbg_mxm_output(7, "Send Noncontiguous data vector %i entries (free slots : %i)\n", n_iov, MXM_REQ_DATA_MAX_IOV);
-    for(index = 0; index < n_iov; index++) {
+    _dbg_mxm_output(7, "Send Noncontiguous data vector %i entries (free slots : %i)\n", n_iov,
+                    MXM_REQ_DATA_MAX_IOV);
+    for (index = 0; index < n_iov; index++) {
         _dbg_mxm_output(7, "======= Recv iov[%i] = ptr : %p, len : %i \n",
                         index, iov[index].MPID_IOV_BUF, iov[index].MPID_IOV_LEN);
     }

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

commit e2338f7505da3fce5659a34d42f2f15bd6c45d65
Author: Lena Oden <loden at anl.gov>
Date:   Tue Jul 28 13:37:02 2015 -0500

    Use different mxm_mq_hs for send and recvme in mxm.
    
    The mxm netmode uses the context_id of communicators to create
    mxm_mq_h structurs. These are internally used for matching.
    Inter-communicators may use different context_ids for sending
    and receiving messages. This leads to a deadlock in mxm. To
    handle this, this patch uses different mxm_mq_h structures for
    sending and receiving messages.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
index bf08f40..d86c307 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -628,36 +628,54 @@ static int _mxm_add_comm(MPID_Comm * comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
-    mxm_mq_h mxm_mq;
+    mxm_mq_h *mq_h_v;
+    MPIU_CHKPMEM_DECL(1);
+
+    MPIU_CHKPMEM_MALLOC(mq_h_v, mxm_mq_h*, sizeof(mxm_mq_h)*2, mpi_errno, "mxm_mq_h_context_ptr" );
 
     _dbg_mxm_output(6, "Add COMM comm %p (rank %d type %d context %d | %d size %d | %d) \n",
                     comm, comm->rank, comm->comm_kind,
                     comm->context_id, comm->recvcontext_id,
                     comm->local_size, comm->remote_size);
 
-    ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mxm_mq);
+    ret = mxm_mq_create(_mxm_obj.mxm_context, comm->recvcontext_id, &mq_h_v[0]);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
                          "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
-    comm->dev.ch.netmod_priv = (void *) mxm_mq;
+    if(comm->recvcontext_id != comm->context_id){
+        ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mq_h_v[1]);
+        MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
+                         mpi_errno, MPI_ERR_OTHER,
+                         "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
+    }
+    else
+       memcpy(&mq_h_v[1], &mq_h_v[0], sizeof(mxm_mq_h));
+
+    comm->dev.ch.netmod_priv = (void *)mq_h_v;
 
   fn_exit:
+    MPIU_CHKPMEM_COMMIT();
     return mpi_errno;
   fn_fail:
+    MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
 
 static int _mxm_del_comm(MPID_Comm * comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
-    mxm_mq_h mxm_mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
+    mxm_mq_h *mxm_mq = (mxm_mq_h*) comm->dev.ch.netmod_priv;
 
     _dbg_mxm_output(6, "Del COMM comm %p (rank %d type %d) \n",
                     comm, comm->rank, comm->comm_kind);
 
-    if (mxm_mq)
-        mxm_mq_destroy(mxm_mq);
+    if (mxm_mq[1] != mxm_mq[0])
+        mxm_mq_destroy(mxm_mq[1]);
+    if (mxm_mq[0])
+        mxm_mq_destroy(mxm_mq[0]);
+
+    MPIU_Free(mxm_mq);
 
     comm->dev.ch.netmod_priv = NULL;
 
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
index 0a94e16..448715f 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -172,6 +172,7 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
         MPID_nem_mxm_vc_area *vc_area = NULL;
         MPID_nem_mxm_req_area *req_area = NULL;
 
+        mxm_mq_h *mq_h_v =  (mxm_mq_h*) rreq->comm->dev.ch.netmod_priv;
         rreq->dev.OnDataAvail = NULL;
         rreq->dev.tmpbuf = NULL;
         rreq->ch.vc = vc;
@@ -206,7 +207,7 @@ int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
 
         mpi_errno = _mxm_irecv((vc_area ? vc_area->mxm_ep : NULL), req_area,
                                tag,
-                               (rreq->comm ? (mxm_mq_h) rreq->comm->dev.ch.netmod_priv : mxm_obj->
+                               (rreq->comm ? mq_h_v[0] : mxm_obj->
                                 mxm_mq), _mxm_tag_mpi2mxm(tag, context_id));
         if (mpi_errno)
             MPIU_ERR_POP(mpi_errno);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
index 74cf26d..e06416d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -19,13 +19,14 @@ int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, i
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_PROBE);
     MPIDI_FUNC_ENTER(MPID_STATE_MXM_PROBE);
 
     mxm_req.base.state = MXM_REQ_NEW;
-    mxm_req.base.mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
+    mxm_req.base.mq = mq_h_v[0];
     mxm_req.base.conn = (vc_area ? vc_area->mxm_ep->mxm_conn : 0);
 
     mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
@@ -64,13 +65,14 @@ int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_IPROBE);
     MPIDI_FUNC_ENTER(MPID_STATE_MXM_IPROBE);
 
     mxm_req.base.state = MXM_REQ_NEW;
-    mxm_req.base.mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
+    mxm_req.base.mq = mq_h_v[0];
     mxm_req.base.conn = (vc_area ? vc_area->mxm_ep->mxm_conn : 0);
 
     mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
@@ -110,13 +112,14 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm,
     mxm_error_t err;
     mxm_recv_req_t mxm_req;
     mxm_message_h mxm_msg;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
     MPID_nem_mxm_vc_area *vc_area = (vc ? VC_BASE(vc) : NULL);
 
     MPIDI_STATE_DECL(MPID_STATE_MXM_IMPROBE);
     MPIDI_FUNC_ENTER(MPID_STATE_MXM_IMPROBE);
 
     mxm_req.base.state = MXM_REQ_NEW;
-    mxm_req.base.mq = (mxm_mq_h) comm->dev.ch.netmod_priv;
+    mxm_req.base.mq = mq_h_v[0];
     mxm_req.base.conn = (vc_area ? vc_area->mxm_ep->mxm_conn : 0);
 
     mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
index 841a878..6e8b9c6 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -247,6 +247,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SEND);
@@ -316,7 +317,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Data
     vc_area->pending_sends += 1;
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
-                           (mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                           mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
                                                                                               comm->context_id
                                                                                               +
                                                                                               context_offset),
@@ -350,6 +351,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SSEND);
@@ -419,7 +421,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     vc_area->pending_sends += 1;
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
-                           (mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                           mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
                                                                                               comm->context_id
                                                                                               +
                                                                                               context_offset),
@@ -453,6 +455,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISEND);
@@ -522,7 +525,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Dat
     vc_area->pending_sends += 1;
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND,
-                           (mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                           mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
                                                                                               comm->context_id
                                                                                               +
                                                                                               context_offset),
@@ -557,6 +560,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
     MPI_Aint dt_true_lb;
     MPID_nem_mxm_vc_area *vc_area = NULL;
     MPID_nem_mxm_req_area *req_area = NULL;
+    mxm_mq_h *mq_h_v =  (mxm_mq_h*) comm->dev.ch.netmod_priv;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISSEND);
@@ -626,7 +630,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, MPI_Aint count, MPI_Da
     vc_area->pending_sends += 1;
 
     mpi_errno = _mxm_isend(vc_area->mxm_ep, req_area, MXM_MPICH_ISEND_SYNC,
-                           (mxm_mq_h) comm->dev.ch.netmod_priv, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                           mq_h_v[1], comm->rank, tag, _mxm_tag_mpi2mxm(tag,
                                                                                               comm->context_id
                                                                                               +
                                                                                               context_offset),

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

Summary of changes:
 .../ch3/channels/nemesis/netmod/mxm/mxm_cancel.c   |    2 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_impl.h     |   15 +++--
 .../ch3/channels/nemesis/netmod/mxm/mxm_init.c     |   45 ++++++++++----
 .../ch3/channels/nemesis/netmod/mxm/mxm_poll.c     |   23 ++++---
 .../ch3/channels/nemesis/netmod/mxm/mxm_probe.c    |   16 +++--
 .../ch3/channels/nemesis/netmod/mxm/mxm_send.c     |   63 ++++++++++----------
 6 files changed, 96 insertions(+), 68 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list