[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1.2-11-g276ca46

Service Account noreply at mpich.org
Wed Jul 23 08:53:58 CDT 2014


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  276ca460ec7a6b7f71ab53b46268eb07a2522a83 (commit)
      from  020c33d656620fd1269d9f92c7a0c424f0b0a3c3 (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/276ca460ec7a6b7f71ab53b46268eb07a2522a83

commit 276ca460ec7a6b7f71ab53b46268eb07a2522a83
Author: Pavan Balaji <balaji at anl.gov>
Date:   Wed Jul 23 08:52:58 2014 -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 2a689b0..6144ace 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_cancel.c
@@ -13,7 +13,7 @@
 #define FUNCNAME MPID_nem_mxm_cancel_send
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_cancel_send(MPIDI_VC_t *vc, MPID_Request *req)
+int MPID_nem_mxm_cancel_send(MPIDI_VC_t * vc, MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
@@ -27,17 +27,18 @@ int MPID_nem_mxm_cancel_send(MPIDI_VC_t *vc, MPID_Request *req)
             if (MPIR_STATUS_GET_CANCEL_BIT(req->status)) {
                 (VC_FIELD(req->ch.vc, pending_sends)) -= 1;
             }
-        } else {
+        }
+        else {
             mpi_errno = MPI_ERR_INTERN;
         }
     }
 
     _dbg_mxm_out_req(req);
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:  ATTRIBUTE((unused))
-    goto fn_exit;
+  fn_fail:ATTRIBUTE((unused))
+        goto fn_exit;
 }
 
 
@@ -45,7 +46,7 @@ int MPID_nem_mxm_cancel_send(MPIDI_VC_t *vc, MPID_Request *req)
 #define FUNCNAME MPID_nem_mxm_cancel_recv
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_cancel_recv(MPIDI_VC_t *vc, MPID_Request *req)
+int MPID_nem_mxm_cancel_recv(MPIDI_VC_t * vc, MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
@@ -56,15 +57,16 @@ int MPID_nem_mxm_cancel_recv(MPIDI_VC_t *vc, MPID_Request *req)
         ret = mxm_req_cancel_recv(&REQ_FIELD(req, mxm_req->item.recv));
         if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
             _mxm_req_wait(&REQ_FIELD(req, mxm_req->item.base));
-        } else {
+        }
+        else {
             mpi_errno = MPI_ERR_INTERN;
         }
     }
 
     _dbg_mxm_out_req(req);
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:  ATTRIBUTE((unused))
-    goto fn_exit;
+  fn_fail:ATTRIBUTE((unused))
+        goto fn_exit;
 }
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_finalize.c b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_finalize.c
index 5c5a515..e2c3f02 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_finalize.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_finalize.c
@@ -7,5 +7,3 @@
 
 
 #include "mxm_impl.h"
-
-
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 7aa8f2f..90ad8b8 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_impl.h
@@ -17,92 +17,97 @@
 #endif
 
 
-int MPID_nem_mxm_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
+int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
 int MPID_nem_mxm_finalize(void);
 int MPID_nem_mxm_poll(int in_blocking_progress);
 int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p);
-int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t *new_vc);
-int MPID_nem_mxm_vc_init(MPIDI_VC_t *vc);
-int MPID_nem_mxm_vc_destroy(MPIDI_VC_t *vc);
-int MPID_nem_mxm_vc_terminate(MPIDI_VC_t *vc);
+int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc);
+int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc);
+int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc);
+int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc);
 
 /* alternate interface */
-int MPID_nem_mxm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
-                void *data, MPIDI_msg_sz_t data_sz);
-int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
-                MPIDI_msg_sz_t data_sz, MPID_Request **sreq_ptr);
-int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz);
+int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
+                             void *data, MPIDI_msg_sz_t data_sz);
+int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
+                                 MPIDI_msg_sz_t data_sz, MPID_Request ** sreq_ptr);
+int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *header,
+                               MPIDI_msg_sz_t hdr_sz);
 
 /* 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, int 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, int 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, int 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, int count, MPI_Datatype datatype, int rank, int tag,
-                MPID_Comm * comm, int context_offset,MPID_Request **sreq_p);
-int MPID_nem_mxm_cancel_send(MPIDI_VC_t *vc, MPID_Request *sreq);
-int MPID_nem_mxm_cancel_recv(MPIDI_VC_t *vc, MPID_Request *rreq);
-int MPID_nem_mxm_probe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status);
-int MPID_nem_mxm_iprobe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
-int MPID_nem_mxm_improbe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, int *flag,
-            MPID_Request **message, MPI_Status *status);
-
-int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status);
-int MPID_nem_mxm_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag,
-                  MPID_Request **message,MPI_Status *status);
+int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq);
+int MPID_nem_mxm_send(MPIDI_VC_t * vc, const void *buf, int 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, int 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, int 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, int count, MPI_Datatype datatype,
+                        int rank, int tag, MPID_Comm * comm, int context_offset,
+                        MPID_Request ** sreq_p);
+int MPID_nem_mxm_cancel_send(MPIDI_VC_t * vc, MPID_Request * sreq);
+int MPID_nem_mxm_cancel_recv(MPIDI_VC_t * vc, MPID_Request * rreq);
+int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                       MPI_Status * status);
+int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                        int *flag, MPI_Status * status);
+int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                         int *flag, MPID_Request ** message, MPI_Status * status);
+
+int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
+                                  MPI_Status * status);
+int MPID_nem_mxm_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
+                                   MPID_Request ** message, MPI_Status * status);
 
 /* active message callback */
 #define MXM_MPICH_HID_ADI_MSG         1
 void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
-                                          size_t length, size_t offset, int last);
+                              size_t length, size_t offset, int last);
 
 /* any source management */
-void MPID_nem_mxm_anysource_posted(MPID_Request *req);
-int MPID_nem_mxm_anysource_matched(MPID_Request *req);
+void MPID_nem_mxm_anysource_posted(MPID_Request * req);
+int MPID_nem_mxm_anysource_matched(MPID_Request * req);
 
 /* List type as queue
  * Operations, initialization etc
  */
 typedef struct list_item list_item_t;
 struct list_item {
-    list_item_t    *next;
+    list_item_t *next;
 };
 
 typedef struct list_head list_head_t;
 struct list_head {
-    list_item_t    *head;
-    list_item_t   **ptail;
-    int             length;
+    list_item_t *head;
+    list_item_t **ptail;
+    int length;
 };
 
-static inline void list_init(list_head_t *list_head)
+static inline void list_init(list_head_t * list_head)
 {
     list_head->head = NULL;
     list_head->ptail = &list_head->head;
     list_head->length = 0;
 }
 
-static inline int list_length(list_head_t *list_head)
+static inline int list_length(list_head_t * list_head)
 {
     return list_head->length;
 }
 
-static inline int list_is_empty(list_head_t *list_head)
+static inline int list_is_empty(list_head_t * list_head)
 {
     return list_head->length == 0;
 }
 
-static inline void list_enqueue(list_head_t *list_head, list_item_t *list_item)
+static inline void list_enqueue(list_head_t * list_head, list_item_t * list_item)
 {
     *list_head->ptail = list_item;
     list_head->ptail = &list_item->next;
     ++list_head->length;
 }
 
-static inline list_item_t *list_dequeue(list_head_t *list_head)
+static inline list_item_t *list_dequeue(list_head_t * list_head)
 {
     list_item_t *list_item;
 
@@ -132,15 +137,14 @@ static inline list_item_t *list_dequeue(list_head_t *list_head)
    on the network module, facilitating dynamic module loading.
  */
 typedef struct {
-    mxm_conn_h          mxm_conn;
-    list_head_t         free_queue;
+    mxm_conn_h mxm_conn;
+    list_head_t free_queue;
 } MPID_nem_mxm_ep_t;
 
-typedef struct
-{
-    MPIDI_VC_t         *ctx;
-    MPID_nem_mxm_ep_t  *mxm_ep;
-    int                 pending_sends;
+typedef struct {
+    MPIDI_VC_t *ctx;
+    MPID_nem_mxm_ep_t *mxm_ep;
+    int pending_sends;
 } MPID_nem_mxm_vc_area;
 
 /* direct macro to private fields in VC */
@@ -159,13 +163,12 @@ typedef struct {
     } item;
 } MPID_nem_mxm_req_t;
 
-typedef struct
-{
-    MPID_Request       *ctx;
+typedef struct {
+    MPID_Request *ctx;
     MPID_nem_mxm_req_t *mxm_req;
-    mxm_req_buffer_t   *iov_buf;
-    int                 iov_count;
-    mxm_req_buffer_t    tmp_buf[MXM_MPICH_MAX_IOV];
+    mxm_req_buffer_t *iov_buf;
+    int iov_count;
+    mxm_req_buffer_t tmp_buf[MXM_MPICH_MAX_IOV];
 } MPID_nem_mxm_req_area;
 
 /* direct macro to private fields in REQ */
@@ -173,42 +176,42 @@ typedef struct
 #define REQ_BASE(reqp) ((MPID_nem_mxm_req_area *)((reqp)->ch.netmod_area.padding))
 
 typedef struct MPID_nem_mxm_module_t {
-    char                 *runtime_version;
-    char                 *compiletime_version;
-    mxm_context_opts_t   *mxm_ctx_opts;
-    mxm_ep_opts_t        *mxm_ep_opts;
-    mxm_h                 mxm_context;
-    mxm_mq_h              mxm_mq;
-    mxm_ep_h              mxm_ep;
-    char                  mxm_ep_addr[MXM_MPICH_MAX_ADDR_SIZE];
-    size_t                mxm_ep_addr_size;
-    int                   mxm_rank;
-    int                   mxm_np;
-    MPID_nem_mxm_ep_t    *endpoint;
-    list_head_t           free_queue;
+    char *runtime_version;
+    char *compiletime_version;
+    mxm_context_opts_t *mxm_ctx_opts;
+    mxm_ep_opts_t *mxm_ep_opts;
+    mxm_h mxm_context;
+    mxm_mq_h mxm_mq;
+    mxm_ep_h mxm_ep;
+    char mxm_ep_addr[MXM_MPICH_MAX_ADDR_SIZE];
+    size_t mxm_ep_addr_size;
+    int mxm_rank;
+    int mxm_np;
+    MPID_nem_mxm_ep_t *endpoint;
+    list_head_t free_queue;
     struct {
-        int               bulk_connect;    /* use bulk connect */
-        int               bulk_disconnect; /* use bulk disconnect */
+        int bulk_connect;       /* use bulk connect */
+        int bulk_disconnect;    /* use bulk disconnect */
     } conf;
 } MPID_nem_mxm_module_t;
 
 extern MPID_nem_mxm_module_t *mxm_obj;
 
-#define container_of(ptr, type, member) (type *)( (char *)(ptr) - offsetof(type,member) )
+#define container_of(ptr, type, member) (type *)((char *)(ptr) - offsetof(type,member))
 #define list_dequeue_mxm_req(head) \
     container_of(list_dequeue(head), MPID_nem_mxm_req_t, queue)
-static inline void list_grow_mxm_req(list_head_t *list_head)
+static inline void list_grow_mxm_req(list_head_t * list_head)
 {
     MPID_nem_mxm_req_t *mxm_req = NULL;
     int count = MXM_MPICH_MAX_REQ;
 
     while (count--) {
-        mxm_req = (MPID_nem_mxm_req_t *)MPIU_Malloc(sizeof(MPID_nem_mxm_req_t));
+        mxm_req = (MPID_nem_mxm_req_t *) MPIU_Malloc(sizeof(MPID_nem_mxm_req_t));
         list_enqueue(list_head, &mxm_req->queue);
     }
 }
 
-static inline void _mxm_to_mpi_status(mxm_error_t mxm_error, MPI_Status *mpi_status)
+static inline void _mxm_to_mpi_status(mxm_error_t mxm_error, MPI_Status * mpi_status)
 {
     switch (mxm_error) {
     case MXM_OK:
@@ -227,7 +230,7 @@ static inline void _mxm_to_mpi_status(mxm_error_t mxm_error, MPI_Status *mpi_sta
     }
 }
 
-static inline int _mxm_req_test(mxm_req_base_t *req)
+static inline int _mxm_req_test(mxm_req_base_t * req)
 {
     return req->state == MXM_REQ_COMPLETED;
 }
@@ -240,7 +243,7 @@ static inline void _mxm_progress_cb(void *user_data)
     MPIU_Assert(mpi_errno == MPI_SUCCESS);
 }
 
-static inline void _mxm_req_wait(mxm_req_base_t *req)
+static inline void _mxm_req_wait(mxm_req_base_t * req)
 {
     mxm_wait_t mxm_wreq;
 
@@ -284,19 +287,17 @@ static inline mxm_tag_t _mxm_tag_mask(int mpi_tag)
 
 
 static inline void _dbg_mxm_out(int level,
-                            FILE* output_id,
-                            int cr,
-                            const char* file_name,
-                            const char* func_name,
-                            int line_no,
-                            const char* format, ...)
+                                FILE * output_id,
+                                int cr,
+                                const char *file_name,
+                                const char *func_name, int line_no, const char *format, ...)
 {
     va_list args;
     char str[200];
     int ret;
 
     if (level < MXM_DEBUG) {
-        output_id = ( output_id ? output_id : stderr);
+        output_id = (output_id ? output_id : stderr);
 
         va_start(args, format);
 
@@ -305,8 +306,11 @@ static inline void _dbg_mxm_out(int level,
 
         if (cr) {
 //            ret = fprintf(output_id, "[%s #%d] %s  %s:%s:%d", MXM_DEBUG_PREFIX, MPIR_Process.comm_world->rank, str, file_name, func_name, line_no);
-            ret = fprintf(output_id, "[%s #%d] %s", MXM_DEBUG_PREFIX, MPIR_Process.comm_world->rank, str);
-        } else {
+            ret =
+                fprintf(output_id, "[%s #%d] %s", MXM_DEBUG_PREFIX, MPIR_Process.comm_world->rank,
+                        str);
+        }
+        else {
             ret = fprintf(output_id, "%s", str);
         }
         assert(-1 != ret);
@@ -317,29 +321,30 @@ static inline void _dbg_mxm_out(int level,
 
 static void _dbg_mxm_hexdump(void *ptr, int buflen)
 {
-    unsigned char *buf = (unsigned char *)ptr;
+    unsigned char *buf = (unsigned char *) ptr;
     char *str = NULL;
     int len = 0;
     int cur_len = 0;
     int i, j;
 
     if (!ptr)
-        return ;
+        return;
 
-    len = 80 * ( buflen / 16 + 1);
-    str = (char *)MPIU_Malloc(len);
-    for (i = 0; i < buflen; i += 16)
-    {
+    len = 80 * (buflen / 16 + 1);
+    str = (char *) MPIU_Malloc(len);
+    for (i = 0; i < buflen; i += 16) {
         cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "%06x: ", i);
         for (j = 0; j < 16; j++)
-        if (i + j < buflen)
-            cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "%02x ", buf[i + j]);
-        else
-            cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "   ");
+            if (i + j < buflen)
+                cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "%02x ", buf[i + j]);
+            else
+                cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "   ");
         cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, " ");
         for (j = 0; j < 16; j++)
             if (i + j < buflen)
-                cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "%c", isprint(buf[i + j]) ? buf[i + j] : '.');
+                cur_len +=
+                    MPIU_Snprintf(str + cur_len, len - cur_len, "%c",
+                                  isprint(buf[i + j]) ? buf[i + j] : '.');
         cur_len += MPIU_Snprintf(str + cur_len, len - cur_len, "\n");
     }
     _dbg_mxm_out(8, NULL, 1, NULL, NULL, -1, "%s", str);
@@ -368,7 +373,7 @@ static inline char *_rank_val_to_str(int rank, char *out, int max)
     return out;
 }
 
-static inline void _dbg_mxm_req(MPID_Request *req)
+static inline void _dbg_mxm_req(MPID_Request * req)
 {
     FILE *stream = stderr;
     char tag_buf[128];
@@ -376,12 +381,12 @@ static inline void _dbg_mxm_req(MPID_Request *req)
 
     if (req) {
         _dbg_mxm_out(10, NULL, 1, NULL, NULL, -1,
-                "[ctx=%#x rank=%d] req=%p ctx=%#x rank=%s tag=%s kind=%d\n",
-                MPIR_Process.comm_world->context_id, MPIR_Process.comm_world->rank,
-                req, req->dev.match.parts.context_id,
-                        _rank_val_to_str(req->dev.match.parts.rank, rank_buf, sizeof(rank_buf)),
-                        _tag_val_to_str(req->dev.match.parts.tag, tag_buf, sizeof(tag_buf)),
-                        req->kind);
+                     "[ctx=%#x rank=%d] req=%p ctx=%#x rank=%s tag=%s kind=%d\n",
+                     MPIR_Process.comm_world->context_id, MPIR_Process.comm_world->rank,
+                     req, req->dev.match.parts.context_id,
+                     _rank_val_to_str(req->dev.match.parts.rank, rank_buf, sizeof(rank_buf)),
+                     _tag_val_to_str(req->dev.match.parts.tag, tag_buf, sizeof(tag_buf)),
+                     req->kind);
     }
 }
 
@@ -397,4 +402,3 @@ static inline void _dbg_mxm_req(MPID_Request *req)
 #endif
 
 #endif
-
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 58c4489..bc6d6d4 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_init.c
@@ -33,27 +33,27 @@ MPID_nem_netmod_funcs_t MPIDI_nem_mxm_funcs = {
 };
 
 static MPIDI_Comm_ops_t comm_ops = {
-    MPID_nem_mxm_recv, /* recv_posted */
+    MPID_nem_mxm_recv,  /* recv_posted */
 
-    MPID_nem_mxm_send, /* send */
-    MPID_nem_mxm_send, /* rsend */
+    MPID_nem_mxm_send,  /* send */
+    MPID_nem_mxm_send,  /* rsend */
     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 */
-    NULL,                   /* rsend_init */
-    NULL,                   /* ssend_init */
-    NULL,                   /* startall */
+    NULL,       /* send_init */
+    NULL,       /* bsend_init */
+    NULL,       /* rsend_init */
+    NULL,       /* ssend_init */
+    NULL,       /* startall */
 
-    MPID_nem_mxm_cancel_send,/* cancel_send */
-    MPID_nem_mxm_cancel_recv, /* cancel_recv */
+    MPID_nem_mxm_cancel_send,   /* cancel_send */
+    MPID_nem_mxm_cancel_recv,   /* cancel_recv */
 
     MPID_nem_mxm_probe, /* probe */
-    MPID_nem_mxm_iprobe, /* iprobe */
-    MPID_nem_mxm_improbe /* improbe */
+    MPID_nem_mxm_iprobe,        /* iprobe */
+    MPID_nem_mxm_improbe        /* improbe */
 };
 
 
@@ -62,20 +62,20 @@ MPID_nem_mxm_module_t *mxm_obj;
 
 static int _mxm_init(int rank, int size);
 static int _mxm_fini(void);
-static int _mxm_connect(MPID_nem_mxm_ep_t *ep, const char *business_card, MPID_nem_mxm_vc_area *vc_area);
-static int _mxm_disconnect(MPID_nem_mxm_ep_t *ep);
-static int _mxm_add_comm(MPID_Comm *comm, void *param);
-static int _mxm_del_comm(MPID_Comm *comm, void *param);
+static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
+                        MPID_nem_mxm_vc_area * vc_area);
+static int _mxm_disconnect(MPID_nem_mxm_ep_t * ep);
+static int _mxm_add_comm(MPID_Comm * comm, void *param);
+static int _mxm_del_comm(MPID_Comm * comm, void *param);
 
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_post_init
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int
-MPID_nem_mxm_post_init(void)
+int MPID_nem_mxm_post_init(void)
 {
-    int mpi_errno = MPI_SUCCESS ;
+    int mpi_errno = MPI_SUCCESS;
 
 #if MXM_API >= MXM_VERSION(3,1)
     if (_mxm_obj.conf.bulk_connect) {
@@ -83,9 +83,9 @@ MPID_nem_mxm_post_init(void)
     }
 #endif
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -94,46 +94,48 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_init
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
+int MPID_nem_mxm_init(MPIDI_PG_t * pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
 {
-   int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
-   MPIDI_STATE_DECL(MPID_STATE_MXM_INIT);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_INIT);
+    MPIDI_STATE_DECL(MPID_STATE_MXM_INIT);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_INIT);
 
-   /* first make sure that our private fields in the vc and req fit into the area provided  */
-   MPIU_Assert(sizeof(MPID_nem_mxm_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN);
-   MPIU_Assert(sizeof(MPID_nem_mxm_req_area) <= MPID_NEM_REQ_NETMOD_AREA_LEN);
+    /* first make sure that our private fields in the vc and req fit into the area provided  */
+    MPIU_Assert(sizeof(MPID_nem_mxm_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN);
+    MPIU_Assert(sizeof(MPID_nem_mxm_req_area) <= MPID_NEM_REQ_NETMOD_AREA_LEN);
 
-   mpi_errno = _mxm_init(pg_rank, pg_p->size);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = _mxm_init(pg_rank, pg_p->size);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-   mpi_errno = MPID_nem_mxm_get_business_card(pg_rank, bc_val_p, val_max_sz_p);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPID_nem_mxm_get_business_card(pg_rank, bc_val_p, val_max_sz_p);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-   mpi_errno = MPIDI_CH3I_Register_anysource_notification(MPID_nem_mxm_anysource_posted, MPID_nem_mxm_anysource_matched);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno =
+        MPIDI_CH3I_Register_anysource_notification(MPID_nem_mxm_anysource_posted,
+                                                   MPID_nem_mxm_anysource_matched);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-   mpi_errno = MPID_nem_register_initcomp_cb(MPID_nem_mxm_post_init);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPID_nem_register_initcomp_cb(MPID_nem_mxm_post_init);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-   mpi_errno = MPIDI_CH3U_Comm_register_create_hook(_mxm_add_comm, NULL);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPIDI_CH3U_Comm_register_create_hook(_mxm_add_comm, NULL);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-   mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(_mxm_del_comm, NULL);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPIDI_CH3U_Comm_register_destroy_hook(_mxm_del_comm, NULL);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_INIT);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_INIT);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
@@ -142,20 +144,20 @@ fn_fail:
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPID_nem_mxm_finalize(void)
 {
-   int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
-   MPIDI_STATE_DECL(MPID_STATE_MXM_FINALIZE);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_FINALIZE);
+    MPIDI_STATE_DECL(MPID_STATE_MXM_FINALIZE);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_FINALIZE);
 
-   mpi_errno = _mxm_fini();
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = _mxm_fini();
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_FINALIZE);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_FINALIZE);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
@@ -164,161 +166,160 @@ fn_fail:
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPID_nem_mxm_get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
 {
-   int mpi_errno = MPI_SUCCESS;
-   int str_errno = MPIU_STR_SUCCESS;
-
-   MPIDI_STATE_DECL(MPID_STATE_MXM_GET_BUSINESS_CARD);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_GET_BUSINESS_CARD);
-
-   str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, MXM_MPICH_ENDPOINT_KEY,
-                                       _mxm_obj.mxm_ep_addr, _mxm_obj.mxm_ep_addr_size);
-   if (str_errno) {
-       MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
-       MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
-   }
-
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_GET_BUSINESS_CARD);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+    int mpi_errno = MPI_SUCCESS;
+    int str_errno = MPIU_STR_SUCCESS;
+
+    MPIDI_STATE_DECL(MPID_STATE_MXM_GET_BUSINESS_CARD);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_GET_BUSINESS_CARD);
+
+    str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, MXM_MPICH_ENDPOINT_KEY,
+                                        _mxm_obj.mxm_ep_addr, _mxm_obj.mxm_ep_addr_size);
+    if (str_errno) {
+        MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
+    }
+
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_GET_BUSINESS_CARD);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_connect_to_root
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t *new_vc)
+int MPID_nem_mxm_connect_to_root(const char *business_card, MPIDI_VC_t * new_vc)
 {
-   int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
-   MPIDI_STATE_DECL(MPID_STATE_MXM_CONNECT_TO_ROOT);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_CONNECT_TO_ROOT);
+    MPIDI_STATE_DECL(MPID_STATE_MXM_CONNECT_TO_ROOT);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_CONNECT_TO_ROOT);
 
-   MPIU_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
+    MPIU_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_CONNECT_TO_ROOT);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_CONNECT_TO_ROOT);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_init
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_vc_init(MPIDI_VC_t *vc)
+int MPID_nem_mxm_vc_init(MPIDI_VC_t * vc)
 {
-   int mpi_errno = MPI_SUCCESS;
-   MPIDI_CH3I_VC *vc_ch = &vc->ch;
-
-   MPIDI_STATE_DECL(MPID_STATE_MXM_VC_INIT);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_INIT);
-
-   /* local connection is used for any source communication */
-   MPIU_Assert(MPID_nem_mem_region.rank != vc->lpid);
-   MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
-                    (MPIU_DBG_FDEST,
-                            "[%i]=== connecting  to  %i  \n",
-                            MPID_nem_mem_region.rank, vc->lpid));
-   {
-       char *business_card;
-       int   val_max_sz;
+    int mpi_errno = MPI_SUCCESS;
+    MPIDI_CH3I_VC *vc_ch = &vc->ch;
+
+    MPIDI_STATE_DECL(MPID_STATE_MXM_VC_INIT);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_INIT);
+
+    /* local connection is used for any source communication */
+    MPIU_Assert(MPID_nem_mem_region.rank != vc->lpid);
+    MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
+                     (MPIU_DBG_FDEST,
+                      "[%i]=== connecting  to  %i  \n", MPID_nem_mem_region.rank, vc->lpid));
+    {
+        char *business_card;
+        int val_max_sz;
 #ifdef USE_PMI2_API
-       val_max_sz = PMI2_MAX_VALLEN;
+        val_max_sz = PMI2_MAX_VALLEN;
 #else
-       mpi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
-       if (mpi_errno)
-           MPIU_ERR_POP(mpi_errno);
+        mpi_errno = PMI_KVS_Get_value_length_max(&val_max_sz);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
 #endif
 
-       business_card = (char *)MPIU_Malloc(val_max_sz);
-       mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card, val_max_sz, vc->pg);
-       if (mpi_errno)
-           MPIU_ERR_POP(mpi_errno);
+        business_card = (char *) MPIU_Malloc(val_max_sz);
+        mpi_errno = vc->pg->getConnInfo(vc->pg_rank, business_card, val_max_sz, vc->pg);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
 
-       VC_FIELD(vc, ctx) = vc;
-       VC_FIELD(vc, mxm_ep) = &_mxm_obj.endpoint[vc->pg_rank];
-       mpi_errno = _mxm_connect(&_mxm_obj.endpoint[vc->pg_rank], business_card, VC_BASE(vc));
-       if (mpi_errno)
-           MPIU_ERR_POP(mpi_errno);
+        VC_FIELD(vc, ctx) = vc;
+        VC_FIELD(vc, mxm_ep) = &_mxm_obj.endpoint[vc->pg_rank];
+        mpi_errno = _mxm_connect(&_mxm_obj.endpoint[vc->pg_rank], business_card, VC_BASE(vc));
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
 
-       MPIU_Free(business_card);
-   }
+        MPIU_Free(business_card);
+    }
 
-   MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
+    MPIDI_CHANGE_VC_STATE(vc, ACTIVE);
 
-   VC_FIELD(vc, pending_sends) = 0;
+    VC_FIELD(vc, pending_sends) = 0;
 
-   vc->rndvSend_fn      = NULL;
-   vc->rndvRecv_fn      = NULL;
-   vc->sendNoncontig_fn = MPID_nem_mxm_SendNoncontig;
-   vc->comm_ops         = &comm_ops;
+    vc->rndvSend_fn = NULL;
+    vc->rndvRecv_fn = NULL;
+    vc->sendNoncontig_fn = MPID_nem_mxm_SendNoncontig;
+    vc->comm_ops = &comm_ops;
 
-   vc_ch->iStartContigMsg = MPID_nem_mxm_iStartContigMsg;
-   vc_ch->iSendContig     = MPID_nem_mxm_iSendContig;
+    vc_ch->iStartContigMsg = MPID_nem_mxm_iStartContigMsg;
+    vc_ch->iSendContig = MPID_nem_mxm_iSendContig;
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_INIT);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_INIT);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_destroy
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_vc_destroy(MPIDI_VC_t *vc)
+int MPID_nem_mxm_vc_destroy(MPIDI_VC_t * vc)
 {
-   int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
-   MPIDI_STATE_DECL(MPID_STATE_MXM_VC_DESTROY);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_DESTROY);
+    MPIDI_STATE_DECL(MPID_STATE_MXM_VC_DESTROY);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_DESTROY);
 
-   /* Do nothing because
-    * finalize is called before vc destroy as result it is not possible
-    * to destroy endpoint here
-    */
+    /* Do nothing because
+     * finalize is called before vc destroy as result it is not possible
+     * to destroy endpoint here
+     */
 #if 0
-   if (VC_FIELD(vc, ctx) == vc) {
-       mpi_errno = _mxm_disconnect(VC_FIELD(vc, mxm_ep));
-       if (mpi_errno)
-           MPIU_ERR_POP(mpi_errno);
-   }
+    if (VC_FIELD(vc, ctx) == vc) {
+        mpi_errno = _mxm_disconnect(VC_FIELD(vc, mxm_ep));
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
+    }
 #endif
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_DESTROY);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_DESTROY);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_vc_terminate
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_vc_terminate(MPIDI_VC_t *vc)
+int MPID_nem_mxm_vc_terminate(MPIDI_VC_t * vc)
 {
-   int mpi_errno = MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
-   MPIDI_STATE_DECL(MPID_STATE_MXM_VC_TERMINATE);
-   MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_TERMINATE);
+    MPIDI_STATE_DECL(MPID_STATE_MXM_VC_TERMINATE);
+    MPIDI_FUNC_ENTER(MPID_STATE_MXM_VC_TERMINATE);
 
-   while((VC_FIELD(vc, pending_sends)) > 0)
-       MPID_nem_mxm_poll(FALSE);
+    while ((VC_FIELD(vc, pending_sends)) > 0)
+        MPID_nem_mxm_poll(FALSE);
 
-   mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
-   if (mpi_errno)
-       MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
-fn_exit:
-   MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_TERMINATE);
-   return mpi_errno;
-fn_fail:
-   goto fn_exit;
+  fn_exit:
+    MPIDI_FUNC_EXIT(MPID_STATE_MXM_VC_TERMINATE);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
 }
 
 static int _mxm_init(int rank, int size)
@@ -331,11 +332,10 @@ static int _mxm_init(int rank, int size)
     if (cur_ver != MXM_API) {
         MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE,
                          (MPIU_DBG_FDEST,
-                                 "WARNING: MPICH was compiled with MXM version %d.%d but version %ld.%ld detected.",
-                                 MXM_VERNO_MAJOR,
-                                 MXM_VERNO_MINOR,
-                                 (cur_ver >> MXM_MAJOR_BIT) & 0xff,
-                                 (cur_ver >> MXM_MINOR_BIT) & 0xff));
+                          "WARNING: MPICH was compiled with MXM version %d.%d but version %ld.%ld detected.",
+                          MXM_VERNO_MAJOR,
+                          MXM_VERNO_MINOR,
+                          (cur_ver >> MXM_MAJOR_BIT) & 0xff, (cur_ver >> MXM_MINOR_BIT) & 0xff));
     }
 
     _mxm_obj.compiletime_version = MXM_VERNO_STRING;
@@ -344,15 +344,15 @@ static int _mxm_init(int rank, int size)
 #else
     _mxm_obj.runtime_version = MPIU_Malloc(sizeof(MXM_VERNO_STRING) + 10);
     snprintf(_mxm_obj.runtime_version, (sizeof(MXM_VERNO_STRING) + 9),
-            "%ld.%ld",
-             (cur_ver >> MXM_MAJOR_BIT) & 0xff, (cur_ver >> MXM_MINOR_BIT) & 0xff);
+             "%ld.%ld", (cur_ver >> MXM_MAJOR_BIT) & 0xff, (cur_ver >> MXM_MINOR_BIT) & 0xff);
 #endif
 
-    if (cur_ver < MXM_VERSION(3,2)) {
-        _mxm_obj.conf.bulk_connect    = 0;
+    if (cur_ver < MXM_VERSION(3, 2)) {
+        _mxm_obj.conf.bulk_connect = 0;
         _mxm_obj.conf.bulk_disconnect = 0;
-    } else {
-        _mxm_obj.conf.bulk_connect    = 1;
+    }
+    else {
+        _mxm_obj.conf.bulk_connect = 1;
         _mxm_obj.conf.bulk_disconnect = 1;
     }
 
@@ -365,37 +365,34 @@ static int _mxm_init(int rank, int size)
     ret = mxm_init(_mxm_obj.mxm_ctx_opts, &_mxm_obj.mxm_context);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_init",
-                         "**mxm_init %s", mxm_error_string(ret));
+                         "**mxm_init", "**mxm_init %s", mxm_error_string(ret));
 
-    ret = mxm_set_am_handler(_mxm_obj.mxm_context, MXM_MPICH_HID_ADI_MSG, MPID_nem_mxm_get_adi_msg, MXM_AM_FLAG_THREAD_SAFE);
-    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
-                         mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_set_am_handler",
+    ret =
+        mxm_set_am_handler(_mxm_obj.mxm_context, MXM_MPICH_HID_ADI_MSG, MPID_nem_mxm_get_adi_msg,
+                           MXM_AM_FLAG_THREAD_SAFE);
+    MPIU_ERR_CHKANDJUMP1(ret != MXM_OK, mpi_errno, MPI_ERR_OTHER, "**mxm_set_am_handler",
                          "**mxm_set_am_handler %s", mxm_error_string(ret));
 
     ret = mxm_mq_create(_mxm_obj.mxm_context, MXM_MPICH_MQ_ID, &_mxm_obj.mxm_mq);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_mq_create",
-                         "**mxm_mq_create %s", mxm_error_string(ret));
+                         "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
     ret = mxm_ep_create(_mxm_obj.mxm_context, _mxm_obj.mxm_ep_opts, &_mxm_obj.mxm_ep);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_ep_create",
-                         "**mxm_ep_create %s", mxm_error_string(ret));
+                         "**mxm_ep_create", "**mxm_ep_create %s", mxm_error_string(ret));
 
     _mxm_obj.mxm_ep_addr_size = MXM_MPICH_MAX_ADDR_SIZE;
     ret = mxm_ep_get_address(_mxm_obj.mxm_ep, &_mxm_obj.mxm_ep_addr, &_mxm_obj.mxm_ep_addr_size);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_ep_get_address",
-                         "**mxm_ep_get_address %s", mxm_error_string(ret));
+                         "**mxm_ep_get_address", "**mxm_ep_get_address %s", mxm_error_string(ret));
 
     _mxm_obj.mxm_rank = rank;
     _mxm_obj.mxm_np = size;
-    _mxm_obj.endpoint = (MPID_nem_mxm_ep_t *)MPIU_Malloc(_mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
+    _mxm_obj.endpoint =
+        (MPID_nem_mxm_ep_t *) MPIU_Malloc(_mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
     memset(_mxm_obj.endpoint, 0, _mxm_obj.mxm_np * sizeof(MPID_nem_mxm_ep_t));
 
     list_init(&_mxm_obj.free_queue);
@@ -404,9 +401,9 @@ static int _mxm_init(int rank, int size)
 
     mxm_obj = &_mxm_obj;
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -448,13 +445,14 @@ static int _mxm_fini(void)
         MPIU_Free(_mxm_obj.runtime_version);
     }
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
-static int _mxm_connect(MPID_nem_mxm_ep_t *ep, const char *business_card, MPID_nem_mxm_vc_area *vc_area)
+static int _mxm_connect(MPID_nem_mxm_ep_t * ep, const char *business_card,
+                        MPID_nem_mxm_vc_area * vc_area)
 {
     int mpi_errno = MPI_SUCCESS;
     int str_errno = MPIU_STR_SUCCESS;
@@ -462,14 +460,15 @@ static int _mxm_connect(MPID_nem_mxm_ep_t *ep, const char *business_card, MPID_n
     char mxm_ep_addr[MXM_MPICH_MAX_ADDR_SIZE];
     int len = 0;
 
-    str_errno = MPIU_Str_get_binary_arg(business_card, MXM_MPICH_ENDPOINT_KEY, mxm_ep_addr, sizeof(mxm_ep_addr), &len);
+    str_errno =
+        MPIU_Str_get_binary_arg(business_card, MXM_MPICH_ENDPOINT_KEY, mxm_ep_addr,
+                                sizeof(mxm_ep_addr), &len);
     MPIU_ERR_CHKANDJUMP(str_errno, mpi_errno, MPI_ERR_OTHER, "**buscard");
 
     ret = mxm_ep_connect(_mxm_obj.mxm_ep, mxm_ep_addr, &ep->mxm_conn);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_ep_connect",
-                         "**mxm_ep_connect %s", mxm_error_string(ret));
+                         "**mxm_ep_connect", "**mxm_ep_connect %s", mxm_error_string(ret));
 
     mxm_conn_ctx_set(ep->mxm_conn, vc_area->ctx);
 
@@ -477,13 +476,13 @@ static int _mxm_connect(MPID_nem_mxm_ep_t *ep, const char *business_card, MPID_n
     list_grow_mxm_req(&ep->free_queue);
     MPIU_Assert(list_length(&ep->free_queue) == MXM_MPICH_MAX_REQ);
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
-static int _mxm_disconnect(MPID_nem_mxm_ep_t *ep)
+static int _mxm_disconnect(MPID_nem_mxm_ep_t * ep)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
@@ -502,13 +501,13 @@ static int _mxm_disconnect(MPID_nem_mxm_ep_t *ep)
         }
     }
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
-static int _mxm_add_comm(MPID_Comm *comm, void *param)
+static int _mxm_add_comm(MPID_Comm * comm, void *param)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
@@ -520,21 +519,20 @@ static int _mxm_add_comm(MPID_Comm *comm, void *param)
     ret = mxm_mq_create(_mxm_obj.mxm_context, comm->context_id, &mxm_mq);
     MPIU_ERR_CHKANDJUMP1(ret != MXM_OK,
                          mpi_errno, MPI_ERR_OTHER,
-                         "**mxm_mq_create",
-                         "**mxm_mq_create %s", mxm_error_string(ret));
+                         "**mxm_mq_create", "**mxm_mq_create %s", mxm_error_string(ret));
 
-    comm->ch.netmod_comm = (void *)mxm_mq;
+    comm->ch.netmod_comm = (void *) mxm_mq;
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
-static int _mxm_del_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->ch.netmod_comm;
+    mxm_mq_h mxm_mq = (mxm_mq_h) comm->ch.netmod_comm;
 
     _dbg_mxm_output(6, "Del COMM comm %p (context %d rank %d) \n",
                     comm, comm->context_id, comm->rank);
@@ -544,8 +542,8 @@ static int _mxm_del_comm(MPID_Comm *comm, void *param)
 
     comm->ch.netmod_comm = NULL;
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
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 6ce5f8e..50487fa 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_poll.c
@@ -9,12 +9,13 @@
 #include "mxm_impl.h"
 
 static int _mxm_poll(void);
-static int _mxm_handle_rreq(MPID_Request *req);
+static int _mxm_handle_rreq(MPID_Request * req);
 static void _mxm_recv_completion_cb(void *context);
-static int _mxm_irecv(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req, int id, mxm_mq_h mxm_mq, mxm_tag_t mxm_tag);
-static int _mxm_process_rdtype(MPID_Request **rreq_p, MPI_Datatype datatype, MPID_Datatype *dt_ptr, MPIDI_msg_sz_t data_sz,
-                               const void *buf, int count,
-                               mxm_req_buffer_t **iov_buf, int *iov_count);
+static int _mxm_irecv(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req, int id, mxm_mq_h mxm_mq,
+                      mxm_tag_t mxm_tag);
+static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
+                               MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
+                               int count, mxm_req_buffer_t ** iov_buf, int *iov_count);
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_poll
@@ -31,10 +32,10 @@ int MPID_nem_mxm_poll(int in_blocking_progress)
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_POLL);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -45,14 +46,14 @@ static int _mxm_poll(void)
     mxm_error_t ret = MXM_OK;
 
     ret = mxm_progress(mxm_obj->mxm_context);
-    if ((MXM_OK != ret) && (MXM_ERR_NO_PROGRESS != ret) ) {
+    if ((MXM_OK != ret) && (MXM_ERR_NO_PROGRESS != ret)) {
         mpi_errno = MPI_ERR_OTHER;
         goto fn_fail;
-   }
+    }
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -62,7 +63,7 @@ fn_fail:
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
-                                          size_t length, size_t offset, int last)
+                              size_t length, size_t offset, int last)
 {
     MPIDI_VC_t *vc = NULL;
 
@@ -72,7 +73,7 @@ void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
 
     vc = mxm_conn_ctx_get(conn);
 
-    MPID_nem_handle_pkt(vc, data, (MPIDI_msg_sz_t)(length));
+    MPID_nem_handle_pkt(vc, data, (MPIDI_msg_sz_t) (length));
 }
 
 
@@ -80,7 +81,7 @@ void MPID_nem_mxm_get_adi_msg(mxm_conn_h conn, mxm_imm_t imm, void *data,
 #define FUNCNAME MPID_nem_mxm_anysource_posted
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-void MPID_nem_mxm_anysource_posted(MPID_Request *req)
+void MPID_nem_mxm_anysource_posted(MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
 
@@ -102,20 +103,20 @@ void MPID_nem_mxm_anysource_posted(MPID_Request *req)
 #define FUNCNAME MPID_nem_mxm_anysource_matched
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_anysource_matched(MPID_Request *req)
+int MPID_nem_mxm_anysource_matched(MPID_Request * req)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
-    int matched   = FALSE;
+    int matched = FALSE;
 
     /* This function is called when an anysource request in the posted
-       receive queue is matched and dequeued see MPIDI_POSTED_RECV_DEQUEUE_HOOK().
-       It returns 0(FALSE) if the req was not matched by mxm and  non-zero(TRUE)
-       otherwise.
-       This happens
-       when the channel supports shared-memory and network communication
-       with a network capable of matching, and the same request is matched
-       by the network and, e.g., shared-memory.
+     * receive queue is matched and dequeued see MPIDI_POSTED_RECV_DEQUEUE_HOOK().
+     * It returns 0(FALSE) if the req was not matched by mxm and  non-zero(TRUE)
+     * otherwise.
+     * This happens
+     * when the channel supports shared-memory and network communication
+     * with a network capable of matching, and the same request is matched
+     * by the network and, e.g., shared-memory.
      */
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ANYSOURCE_MATCHED);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ANYSOURCE_MATCHED);
@@ -125,7 +126,8 @@ int MPID_nem_mxm_anysource_matched(MPID_Request *req)
     ret = mxm_req_cancel_recv(&REQ_FIELD(req, mxm_req->item.recv));
     if ((MXM_OK == ret) || (MXM_ERR_NO_PROGRESS == ret)) {
         MPID_Segment_free(req->dev.segment_ptr);
-    } else {
+    }
+    else {
         _mxm_req_wait(&REQ_FIELD(req, mxm_req->item.base));
         matched = TRUE;
     }
@@ -141,7 +143,7 @@ int MPID_nem_mxm_anysource_matched(MPID_Request *req)
 #define FUNCNAME MPID_nem_mxm_recv
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
+int MPID_nem_mxm_recv(MPIDI_VC_t * vc, MPID_Request * rreq)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
@@ -151,38 +153,42 @@ int MPID_nem_mxm_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_RECV);
 
     MPIU_Assert(rreq);
-    MPIU_Assert(((rreq->dev.match.parts.rank == MPI_ANY_SOURCE) && (vc == NULL)) || (vc && !vc->ch.is_local));
+    MPIU_Assert(((rreq->dev.match.parts.rank == MPI_ANY_SOURCE) && (vc == NULL)) ||
+                (vc && !vc->ch.is_local));
 
     {
-        MPIR_Rank_t       source     = rreq->dev.match.parts.rank;
+        MPIR_Rank_t source = rreq->dev.match.parts.rank;
         MPIR_Context_id_t context_id = rreq->dev.match.parts.context_id;
-        int               tag        = rreq->dev.match.parts.tag;
-        int               ret;
-        MPIDI_msg_sz_t    data_sz;
-        int               dt_contig;
-        MPI_Aint          dt_true_lb;
-        MPID_Datatype    *dt_ptr;
+        int tag = rreq->dev.match.parts.tag;
+        int ret;
+        MPIDI_msg_sz_t data_sz;
+        int dt_contig;
+        MPI_Aint dt_true_lb;
+        MPID_Datatype *dt_ptr;
 
         MPIU_Assert((rreq->kind == MPID_REQUEST_RECV) || (rreq->kind == MPID_PREQUEST_RECV));
-        MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz, dt_ptr,dt_true_lb);
+        MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, dt_contig, data_sz,
+                                dt_ptr, dt_true_lb);
         rreq->dev.OnDataAvail = NULL;
         rreq->dev.tmpbuf = NULL;
         rreq->ch.vc = vc;
 
-        _dbg_mxm_output(5, "Recv ========> Getting USER msg for req %p (context %d rank %d tag %d size %d) \n",
-                         rreq, context_id, source, tag, data_sz);
+        _dbg_mxm_output(5,
+                        "Recv ========> Getting USER msg for req %p (context %d rank %d tag %d size %d) \n",
+                        rreq, context_id, source, tag, data_sz);
 
         REQ_FIELD(rreq, ctx) = rreq;
         REQ_FIELD(rreq, iov_buf) = REQ_FIELD(rreq, tmp_buf);
         REQ_FIELD(rreq, iov_count) = 0;
         REQ_FIELD(rreq, iov_buf)[0].ptr = NULL;
-        REQ_FIELD(rreq, iov_buf)[0].length  = 0;
+        REQ_FIELD(rreq, iov_buf)[0].length = 0;
 
         if (dt_contig) {
             REQ_FIELD(rreq, iov_count) = 1;
-            REQ_FIELD(rreq, iov_buf)[0].ptr = (char *)(rreq->dev.user_buf) + dt_true_lb;
-            REQ_FIELD(rreq, iov_buf)[0].length  = data_sz;
-        } else {
+            REQ_FIELD(rreq, iov_buf)[0].ptr = (char *) (rreq->dev.user_buf) + dt_true_lb;
+            REQ_FIELD(rreq, iov_buf)[0].length = data_sz;
+        }
+        else {
             mpi_errno = _mxm_process_rdtype(&rreq, rreq->dev.datatype, dt_ptr, data_sz,
                                             rreq->dev.user_buf, rreq->dev.user_count,
                                             &REQ_FIELD(rreq, iov_buf), &REQ_FIELD(rreq, iov_count));
@@ -191,77 +197,82 @@ int MPID_nem_mxm_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
         }
 
         mpi_errno = _mxm_irecv((vc ? VC_FIELD(vc, mxm_ep) : NULL), REQ_BASE(rreq),
-                               tag, (rreq->comm ? (mxm_mq_h)rreq->comm->ch.netmod_comm : mxm_obj->mxm_mq), _mxm_tag_mpi2mxm(tag, context_id));
+                               tag,
+                               (rreq->comm ? (mxm_mq_h) rreq->comm->ch.netmod_comm : mxm_obj->
+                                mxm_mq), _mxm_tag_mpi2mxm(tag, context_id));
         if (mpi_errno)
             MPIU_ERR_POP(mpi_errno);
     }
 
-    if (vc) _dbg_mxm_out_req(rreq);
+    if (vc)
+        _dbg_mxm_out_req(rreq);
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_RECV);
     return mpi_errno;
- fn_fail:  ATTRIBUTE((unused))
-    goto fn_exit;
+  fn_fail:ATTRIBUTE((unused))
+        goto fn_exit;
 }
 
 
-static int _mxm_handle_rreq(MPID_Request *req)
+static int _mxm_handle_rreq(MPID_Request * req)
 {
-    int            mpi_errno = MPI_SUCCESS;
-    int            complete = FALSE;
-    int            dt_contig;
-    MPI_Aint       dt_true_lb;
+    int mpi_errno = MPI_SUCCESS;
+    int complete = FALSE;
+    int dt_contig;
+    MPI_Aint dt_true_lb;
     MPIDI_msg_sz_t userbuf_sz;
     MPID_Datatype *dt_ptr;
     MPIDI_msg_sz_t data_sz;
-    MPIDI_VC_t    *vc = NULL;
+    MPIDI_VC_t *vc = NULL;
 
-    MPIU_THREAD_CS_ENTER(MSGQUEUE,req);
+    MPIU_THREAD_CS_ENTER(MSGQUEUE, req);
     complete = MPIDI_CH3U_Recvq_DP(req)
-    MPIU_THREAD_CS_EXIT(MSGQUEUE,req);
+        MPIU_THREAD_CS_EXIT(MSGQUEUE, req);
     if (!complete) {
         return TRUE;
     }
 
-    MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
+    MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, userbuf_sz, dt_ptr,
+                            dt_true_lb);
 
     _dbg_mxm_output(5, "========> Completing RECV req %p status %d\n", req, req->status.MPI_ERROR);
     _dbg_mxm_out_buf(REQ_FIELD(req, iov_buf)[0].ptr,
-                     (REQ_FIELD(req, iov_buf)[0].length > 16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
+                     (REQ_FIELD(req, iov_buf)[0].length >
+                      16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
 
     if (req->dev.recv_data_sz <= userbuf_sz) {
         data_sz = req->dev.recv_data_sz;
         if (req->status.MPI_ERROR == MPI_ERR_TRUNCATE) {
             req->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
-                                     MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TRUNCATE,
-                                     "**truncate", "**truncate %d %d %d %d",
-                                     req->status.MPI_SOURCE, req->status.MPI_TAG,
-                                     req->dev.recv_data_sz, userbuf_sz );
+                                                         MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+                                                         MPI_ERR_TRUNCATE, "**truncate",
+                                                         "**truncate %d %d %d %d",
+                                                         req->status.MPI_SOURCE,
+                                                         req->status.MPI_TAG, req->dev.recv_data_sz,
+                                                         userbuf_sz);
         }
     }
-    else
-    {
+    else {
         data_sz = userbuf_sz;
         MPIR_STATUS_SET_COUNT(req->status, userbuf_sz);
-        MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
-                            "receive buffer too small; message truncated, msg_sz="
-                            MPIDI_MSG_SZ_FMT ", userbuf_sz="
-                            MPIDI_MSG_SZ_FMT,
-                            req->dev.recv_data_sz, userbuf_sz));
+        MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST,
+                                              "receive buffer too small; message truncated, msg_sz="
+                                              MPIDI_MSG_SZ_FMT ", userbuf_sz="
+                                              MPIDI_MSG_SZ_FMT, req->dev.recv_data_sz, userbuf_sz));
         req->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
-                                 MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TRUNCATE,
-                                 "**truncate", "**truncate %d %d %d %d",
-                                 req->status.MPI_SOURCE, req->status.MPI_TAG,
-                                 req->dev.recv_data_sz, userbuf_sz );
+                                                     MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
+                                                     MPI_ERR_TRUNCATE, "**truncate",
+                                                     "**truncate %d %d %d %d",
+                                                     req->status.MPI_SOURCE, req->status.MPI_TAG,
+                                                     req->dev.recv_data_sz, userbuf_sz);
     }
 
-    if ((!dt_contig) && (req->dev.tmpbuf != NULL))
-    {
+    if ((!dt_contig) && (req->dev.tmpbuf != NULL)) {
         MPIDI_msg_sz_t last;
 
         last = req->dev.recv_data_sz;
-        MPID_Segment_unpack( req->dev.segment_ptr, 0, &last, req->dev.tmpbuf);
+        MPID_Segment_unpack(req->dev.segment_ptr, 0, &last, req->dev.tmpbuf);
         MPIU_Free(req->dev.tmpbuf);
         if (last != data_sz) {
             MPIR_STATUS_SET_COUNT(req->status, last);
@@ -286,7 +297,7 @@ static int _mxm_handle_rreq(MPID_Request *req)
 
 static void _mxm_recv_completion_cb(void *context)
 {
-    MPID_Request  *req = (MPID_Request *)context;
+    MPID_Request *req = (MPID_Request *) context;
     mxm_recv_req_t *mxm_rreq;
 
     MPIU_Assert(req);
@@ -296,14 +307,15 @@ static void _mxm_recv_completion_cb(void *context)
     _mxm_to_mpi_status(REQ_FIELD(req, mxm_req->item.base.error), &req->status);
 
     mxm_rreq = &REQ_FIELD(req, mxm_req->item.recv);
-    req->status.MPI_TAG    = _mxm_tag_mxm2mpi(mxm_rreq->completion.sender_tag);
+    req->status.MPI_TAG = _mxm_tag_mxm2mpi(mxm_rreq->completion.sender_tag);
     req->status.MPI_SOURCE = mxm_rreq->completion.sender_imm;
     req->dev.recv_data_sz = mxm_rreq->completion.actual_len;
     MPIR_STATUS_SET_COUNT(req->status, req->dev.recv_data_sz);
 
     if (req->ch.vc) {
         list_enqueue(&VC_FIELD(req->ch.vc, mxm_ep->free_queue), &REQ_FIELD(req, mxm_req->queue));
-    } else {
+    }
+    else {
         list_enqueue(&mxm_obj->free_queue, &REQ_FIELD(req, mxm_req->queue));
     }
 
@@ -313,12 +325,13 @@ static void _mxm_recv_completion_cb(void *context)
 }
 
 
-static int _mxm_irecv(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req, int id, mxm_mq_h mxm_mq, mxm_tag_t mxm_tag)
+static int _mxm_irecv(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req, int id, mxm_mq_h mxm_mq,
+                      mxm_tag_t mxm_tag)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
     mxm_recv_req_t *mxm_rreq;
-    list_head_t *free_queue =NULL;
+    list_head_t *free_queue = NULL;
 
     MPIU_Assert(req);
 
@@ -335,30 +348,32 @@ static int _mxm_irecv(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req, int id,
     }
     mxm_rreq = &(req->mxm_req->item.recv);
 
-    mxm_rreq->base.state            = MXM_REQ_NEW;
-    mxm_rreq->base.mq               = mxm_mq;
-    mxm_rreq->base.conn             = (ep ? ep->mxm_conn : 0);
-    mxm_rreq->base.completed_cb     = _mxm_recv_completion_cb;
-    mxm_rreq->base.context          = req->ctx;
+    mxm_rreq->base.state = MXM_REQ_NEW;
+    mxm_rreq->base.mq = mxm_mq;
+    mxm_rreq->base.conn = (ep ? ep->mxm_conn : 0);
+    mxm_rreq->base.completed_cb = _mxm_recv_completion_cb;
+    mxm_rreq->base.context = req->ctx;
 
-    mxm_rreq->tag                   = mxm_tag;
-    mxm_rreq->tag_mask              = _mxm_tag_mask(id);
+    mxm_rreq->tag = mxm_tag;
+    mxm_rreq->tag_mask = _mxm_tag_mask(id);
 
     if (likely(req->iov_count == 1)) {
-        mxm_rreq->base.data_type          = MXM_REQ_DATA_BUFFER;
-        mxm_rreq->base.data.buffer.ptr    = req->iov_buf[0].ptr;
+        mxm_rreq->base.data_type = MXM_REQ_DATA_BUFFER;
+        mxm_rreq->base.data.buffer.ptr = req->iov_buf[0].ptr;
         mxm_rreq->base.data.buffer.length = req->iov_buf[0].length;
-    } else {
-        mxm_rreq->base.data_type          = MXM_REQ_DATA_IOV;
-        mxm_rreq->base.data.iov.vector    = req->iov_buf;
-        mxm_rreq->base.data.iov.count     = req->iov_count;
+    }
+    else {
+        mxm_rreq->base.data_type = MXM_REQ_DATA_IOV;
+        mxm_rreq->base.data.iov.vector = req->iov_buf;
+        mxm_rreq->base.data.iov.count = req->iov_count;
     }
 
     ret = mxm_req_recv(mxm_rreq);
     if (MXM_OK != ret) {
         if (ep) {
             list_enqueue(&ep->free_queue, &req->mxm_req->queue);
-        } else {
+        }
+        else {
             list_enqueue(&mxm_obj->free_queue, &req->mxm_req->queue);
         }
         mpi_errno = MPI_ERR_OTHER;
@@ -366,35 +381,36 @@ static int _mxm_irecv(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req, int id,
     }
 //    list_enqueue(&ep->out_queue, &req->mxm_req->queue);
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
 
-static int _mxm_process_rdtype(MPID_Request **rreq_p, MPI_Datatype datatype, MPID_Datatype *dt_ptr, MPIDI_msg_sz_t data_sz,
-                               const void *buf, int count,
-                               mxm_req_buffer_t **iov_buf, int *iov_count)
+static int _mxm_process_rdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
+                               MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
+                               int count, mxm_req_buffer_t ** iov_buf, int *iov_count)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPID_Request  *rreq      = *rreq_p;
+    MPID_Request *rreq = *rreq_p;
     MPIDI_msg_sz_t last;
-    MPID_IOV      *iov;
-    int            n_iov     = 0;
-    int            index;
+    MPID_IOV *iov;
+    int n_iov = 0;
+    int index;
 
-    if (rreq->dev.segment_ptr == NULL)
-    {
+    if (rreq->dev.segment_ptr == NULL) {
         rreq->dev.segment_ptr = MPID_Segment_alloc();
-        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+                             "**nomem %s", "MPID_Segment_alloc");
     }
     MPID_Segment_init(buf, count, datatype, rreq->dev.segment_ptr, 0);
     rreq->dev.segment_first = 0;
     rreq->dev.segment_size = data_sz;
 
     last = rreq->dev.segment_size;
-    MPID_Segment_count_contig_blocks(rreq->dev.segment_ptr, rreq->dev.segment_first, &last, (MPI_Aint *)&n_iov);
+    MPID_Segment_count_contig_blocks(rreq->dev.segment_ptr, rreq->dev.segment_first, &last,
+                                     (MPI_Aint *) & n_iov);
     MPIU_Assert(n_iov > 0);
     iov = MPIU_Malloc(n_iov * sizeof(*iov));
     MPIU_Assert(iov);
@@ -405,32 +421,32 @@ static int _mxm_process_rdtype(MPID_Request **rreq_p, MPI_Datatype datatype, MPI
 
     if (n_iov <= MXM_REQ_DATA_MAX_IOV) {
         if (n_iov > MXM_MPICH_MAX_IOV) {
-            *iov_buf = (mxm_req_buffer_t *)MPIU_Malloc(n_iov * sizeof(**iov_buf));
+            *iov_buf = (mxm_req_buffer_t *) MPIU_Malloc(n_iov * sizeof(**iov_buf));
             MPIU_Assert(*iov_buf);
         }
 
-        for(index = 0; index < n_iov ; index++) {
+        for (index = 0; index < n_iov; index++) {
             (*iov_buf)[index].ptr = iov[index].MPID_IOV_BUF;
-            (*iov_buf)[index].length  = iov[index].MPID_IOV_LEN;
+            (*iov_buf)[index].length = iov[index].MPID_IOV_LEN;
         }
         rreq->dev.tmpbuf = NULL;
         rreq->dev.tmpbuf_sz = 0;
         *iov_count = n_iov;
-    } else {
+    }
+    else {
         int packsize = 0;
-        MPIR_Pack_size_impl(rreq->dev.user_count, rreq->dev.datatype, (MPI_Aint *)&packsize);
+        MPIR_Pack_size_impl(rreq->dev.user_count, rreq->dev.datatype, (MPI_Aint *) & packsize);
         rreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
         MPIU_Assert(rreq->dev.tmpbuf);
         rreq->dev.tmpbuf_sz = packsize;
         (*iov_buf)[0].ptr = rreq->dev.tmpbuf;
-        (*iov_buf)[0].length  = (size_t)packsize;
-        *iov_count = 1 ;
+        (*iov_buf)[0].length = (size_t) packsize;
+        *iov_count = 1;
     }
     MPIU_Free(iov);
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
-
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 355e182..a03d410 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_probe.c
@@ -13,7 +13,8 @@
 #define FUNCNAME MPID_nem_mxm_probe
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_probe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status)
+int MPID_nem_mxm_probe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                       MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
@@ -22,12 +23,12 @@ int MPID_nem_mxm_probe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, in
     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->ch.netmod_comm;
-    mxm_req.base.conn             = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
+    mxm_req.base.state = MXM_REQ_NEW;
+    mxm_req.base.mq = (mxm_mq_h) comm->ch.netmod_comm;
+    mxm_req.base.conn = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
 
-    mxm_req.tag                   = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
-    mxm_req.tag_mask              = _mxm_tag_mask(tag);
+    mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
+    mxm_req.tag_mask = _mxm_tag_mask(tag);
 
     do {
         err = mxm_req_probe(&mxm_req);
@@ -37,16 +38,17 @@ int MPID_nem_mxm_probe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, in
     if (MXM_OK == err) {
         _mxm_to_mpi_status(mxm_req.base.error, status);
         status->MPI_SOURCE = mxm_req.completion.sender_imm;
-        status->MPI_TAG    = _mxm_tag_mxm2mpi(mxm_req.completion.sender_tag);
+        status->MPI_TAG = _mxm_tag_mxm2mpi(mxm_req.completion.sender_tag);
         MPIR_STATUS_SET_COUNT(*status, mxm_req.completion.sender_len);
-    } else {
+    }
+    else {
         mpi_errno = MPI_ERR_INTERN;
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_PROBE);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -55,7 +57,8 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_iprobe
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_iprobe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
+int MPID_nem_mxm_iprobe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                        int *flag, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t err;
@@ -64,30 +67,32 @@ int MPID_nem_mxm_iprobe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, i
     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->ch.netmod_comm;
-    mxm_req.base.conn             = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
+    mxm_req.base.state = MXM_REQ_NEW;
+    mxm_req.base.mq = (mxm_mq_h) comm->ch.netmod_comm;
+    mxm_req.base.conn = (vc ? VC_FIELD(vc, mxm_ep->mxm_conn) : 0);
 
-    mxm_req.tag                   = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
-    mxm_req.tag_mask              = _mxm_tag_mask(tag);
+    mxm_req.tag = _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset);
+    mxm_req.tag_mask = _mxm_tag_mask(tag);
 
     err = mxm_req_probe(&mxm_req);
     if (MXM_OK == err) {
         *flag = 1;
         _mxm_to_mpi_status(mxm_req.base.error, status);
         status->MPI_SOURCE = mxm_req.completion.sender_imm;
-        status->MPI_TAG    = _mxm_tag_mxm2mpi(mxm_req.completion.sender_tag);
+        status->MPI_TAG = _mxm_tag_mxm2mpi(mxm_req.completion.sender_tag);
         MPIR_STATUS_SET_COUNT(*status, mxm_req.completion.sender_len);
-    } else if (MXM_ERR_NO_MESSAGE == err) {
+    }
+    else if (MXM_ERR_NO_MESSAGE == err) {
         *flag = 0;
-    } else {
+    }
+    else {
         mpi_errno = MPI_ERR_INTERN;
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_IPROBE);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -96,7 +101,8 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_improbe
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_improbe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
+int MPID_nem_mxm_improbe(MPIDI_VC_t * vc, int source, int tag, MPID_Comm * comm, int context_offset,
+                         int *flag, MPID_Request ** message, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
 
@@ -105,10 +111,10 @@ int MPID_nem_mxm_improbe(MPIDI_VC_t *vc,  int source, int tag, MPID_Comm *comm,
 
     MPIU_Assert(0 && "not currently implemented");
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MXM_IMPROBE);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -117,7 +123,8 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_anysource_iprobe
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPI_Status *status)
+int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm * comm, int context_offset, int *flag,
+                                  MPI_Status * status)
 {
     return MPID_nem_mxm_iprobe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, status);
 }
@@ -127,7 +134,9 @@ int MPID_nem_mxm_anysource_iprobe(int tag, MPID_Comm *comm, int context_offset,
 #define FUNCNAME MPID_nem_mxm_anysource_iprobe
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPID_nem_mxm_anysource_improbe(int tag, MPID_Comm *comm, int context_offset, int *flag, MPID_Request **message, MPI_Status *status)
+int MPID_nem_mxm_anysource_improbe(int tag, MPID_Comm * comm, int context_offset, int *flag,
+                                   MPID_Request ** message, MPI_Status * status)
 {
-    return MPID_nem_mxm_improbe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, message, status);
+    return MPID_nem_mxm_improbe(NULL, MPI_ANY_SOURCE, tag, comm, context_offset, flag, message,
+                                status);
 }
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 135cff4..7a8f12a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mxm/mxm_send.c
@@ -15,20 +15,21 @@ enum {
 };
 
 
-static int _mxm_handle_sreq(MPID_Request *req);
+static int _mxm_handle_sreq(MPID_Request * req);
 static void _mxm_send_completion_cb(void *context);
-static int _mxm_isend(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req,
+static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
                       int type, mxm_mq_h mxm_mq, int mxm_rank, int id, mxm_tag_t tag, int block);
-static int _mxm_process_sdtype(MPID_Request **rreq_p, MPI_Datatype datatype, MPID_Datatype *dt_ptr, MPIDI_msg_sz_t data_sz,
-                               const void *buf, int count,
-                               mxm_req_buffer_t **iov_buf, int *iov_count);
+static int _mxm_process_sdtype(MPID_Request ** rreq_p, MPI_Datatype datatype,
+                               MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
+                               int count, mxm_req_buffer_t ** iov_buf, int *iov_count);
 
 
 #undef FUNCNAME
 #define FUNCNAME MPID_nem_mxm_iSendContig
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz)
+int MPID_nem_mxm_iSendContig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
+                             void *data, MPIDI_msg_sz_t data_sz)
 {
     int mpi_errno = MPI_SUCCESS;
 
@@ -37,23 +38,24 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "mxm_iSendContig");
-    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
+    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
-    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *)hdr, sizeof(MPIDI_CH3_Pkt_t));
+    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
     sreq->dev.tmpbuf = NULL;
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 1;
-    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *)&(sreq->dev.pending_pkt);
-    REQ_FIELD(sreq, iov_buf)[0].length  = sizeof(MPIDI_CH3_Pkt_t);
+    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
+    REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
     if (data_sz) {
         REQ_FIELD(sreq, iov_count) = 2;
-        REQ_FIELD(sreq, iov_buf)[1].ptr = (void *)data;
-        REQ_FIELD(sreq, iov_buf)[1].length  = data_sz;
+        REQ_FIELD(sreq, iov_buf)[1].ptr = (void *) data;
+        REQ_FIELD(sreq, iov_buf)[1].length = data_sz;
     }
 
-    _dbg_mxm_output(5, "iSendContig ========> Sending ADI msg for req %p (data_size %d, %d) \n", sreq, sizeof(MPIDI_CH3_Pkt_t), data_sz);
+    _dbg_mxm_output(5, "iSendContig ========> Sending ADI msg for req %p (data_size %d, %d) \n",
+                    sreq, sizeof(MPIDI_CH3_Pkt_t), data_sz);
 
     (VC_FIELD(vc, pending_sends)) += 1;
     sreq->ch.vc = vc;
@@ -64,10 +66,10 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_ISENDCONTIGMSG);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -76,38 +78,40 @@ int MPID_nem_mxm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPID
 #define FUNCNAME MPID_nem_mxm_iStartContigMsg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz, MPID_Request **sreq_ptr)
+int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t * vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data,
+                                 MPIDI_msg_sz_t data_sz, MPID_Request ** sreq_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPID_Request  *sreq = NULL;
+    MPID_Request *sreq = NULL;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISTARTCONTIGMSG);
 
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "mxm_iStartContigMsg");
-    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)hdr);
+    MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *) hdr);
 
     /* create a request */
     sreq = MPID_Request_create();
     MPIU_Assert(sreq != NULL);
     MPIU_Object_set_ref(sreq, 2);
-    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *)hdr, sizeof(MPIDI_CH3_Pkt_t));
+    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
     sreq->kind = MPID_REQUEST_SEND;
     sreq->dev.OnDataAvail = NULL;
     sreq->dev.tmpbuf = NULL;
 
-    _dbg_mxm_output(5, "iStartContigMsg ========> Sending ADI msg for req %p (data_size %d, %d) \n", sreq, sizeof(MPIDI_CH3_Pkt_t), data_sz);
+    _dbg_mxm_output(5, "iStartContigMsg ========> Sending ADI msg for req %p (data_size %d, %d) \n",
+                    sreq, sizeof(MPIDI_CH3_Pkt_t), data_sz);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 1;
-    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *)&(sreq->dev.pending_pkt);
-    REQ_FIELD(sreq, iov_buf)[0].length  = sizeof(MPIDI_CH3_Pkt_t);
+    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
+    REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
     if (data_sz) {
         REQ_FIELD(sreq, iov_count) = 2;
-        REQ_FIELD(sreq, iov_buf)[1].ptr = (void *)data;
-        REQ_FIELD(sreq, iov_buf)[1].length  = data_sz;
+        REQ_FIELD(sreq, iov_buf)[1].ptr = (void *) data;
+        REQ_FIELD(sreq, iov_buf)[1].length = data_sz;
     }
 
     (VC_FIELD(vc, pending_sends)) += 1;
@@ -119,11 +123,11 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
- fn_exit:
+  fn_exit:
     *sreq_ptr = sreq;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MX_ISTARTCONTIGMSG);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -132,7 +136,8 @@ int MPID_nem_mxm_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_s
 #define FUNCNAME MPID_nem_mxm_SendNoncontig
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz)
+int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t * vc, MPID_Request * sreq, void *hdr,
+                               MPIDI_msg_sz_t hdr_sz)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_msg_sz_t last;
@@ -143,28 +148,29 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
     MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_Pkt_t));
     MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "MPID_nem_mxm_iSendNoncontig");
 
-    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *)hdr, sizeof(MPIDI_CH3_Pkt_t));
+    MPIU_Memcpy(&(sreq->dev.pending_pkt), (char *) hdr, sizeof(MPIDI_CH3_Pkt_t));
     sreq->dev.tmpbuf = NULL;
 
-    _dbg_mxm_output(5, "SendNoncontig ========> Sending ADI msg for req %p (data_size %d, %d) \n", sreq, sizeof(MPIDI_CH3_Pkt_t), sreq->dev.segment_size);
+    _dbg_mxm_output(5, "SendNoncontig ========> Sending ADI msg for req %p (data_size %d, %d) \n",
+                    sreq, sizeof(MPIDI_CH3_Pkt_t), sreq->dev.segment_size);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 1;
-    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *)&(sreq->dev.pending_pkt);
-    REQ_FIELD(sreq, iov_buf)[0].length  = sizeof(MPIDI_CH3_Pkt_t);
+    REQ_FIELD(sreq, iov_buf)[0].ptr = (void *) &(sreq->dev.pending_pkt);
+    REQ_FIELD(sreq, iov_buf)[0].length = sizeof(MPIDI_CH3_Pkt_t);
 
     MPIU_Assert(sreq->dev.segment_first == 0);
     last = sreq->dev.segment_size;
     if (last > 0) {
-        sreq->dev.tmpbuf = MPIU_Malloc((size_t)sreq->dev.segment_size);
+        sreq->dev.tmpbuf = MPIU_Malloc((size_t) sreq->dev.segment_size);
         MPIU_Assert(sreq->dev.tmpbuf);
         MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, sreq->dev.tmpbuf);
         MPIU_Assert(last == sreq->dev.segment_size);
 
         REQ_FIELD(sreq, iov_count) = 2;
         REQ_FIELD(sreq, iov_buf)[1].ptr = sreq->dev.tmpbuf;
-        REQ_FIELD(sreq, iov_buf)[1].length  = last;
+        REQ_FIELD(sreq, iov_buf)[1].length = last;
     }
 
     (VC_FIELD(vc, pending_sends)) += 1;
@@ -176,10 +182,10 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_SENDNONCONTIGMSG);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -188,15 +194,15 @@ int MPID_nem_mxm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MP
 #define FUNCNAME MPID_nem_mxm_send
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_send(MPIDI_VC_t *vc, const void * buf, int 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, int 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;
     MPID_Datatype *dt_ptr;
-    int            dt_contig;
+    int dt_contig;
     MPIDI_msg_sz_t data_sz;
-    MPI_Aint       dt_true_lb;
+    MPI_Aint dt_true_lb;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SEND);
@@ -205,7 +211,7 @@ int MPID_nem_mxm_send(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
 
     /* create a request */
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
-    MPIU_Assert (sreq != NULL);
+    MPIU_Assert(sreq != NULL);
     MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
     MPIDI_VC_FAI_send_seqnum(vc, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
@@ -219,38 +225,41 @@ int MPID_nem_mxm_send(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     sreq->ch.vc = vc;
     sreq->ch.noncontig = FALSE;
 
-    _dbg_mxm_output(5, "Send ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
+    _dbg_mxm_output(5,
+                    "Send ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
                     sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 0;
     REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
-    REQ_FIELD(sreq, iov_buf)[0].length  = 0;
+    REQ_FIELD(sreq, iov_buf)[0].length = 0;
 
     if (data_sz) {
         if (dt_contig) {
             REQ_FIELD(sreq, iov_count) = 1;
-            REQ_FIELD(sreq, iov_buf)[0].ptr = (char*)(buf) + dt_true_lb;
+            REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
             REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
-        } else {
+        }
+        else {
             MPIDI_msg_sz_t last;
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t)packsize);
+                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
 
                 REQ_FIELD(sreq, iov_count) = 1;
                 REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
-                REQ_FIELD(sreq, iov_buf)[0].length  = last;
+                REQ_FIELD(sreq, iov_buf)[0].length = last;
             }
             sreq->ch.noncontig = TRUE;
         }
@@ -259,17 +268,22 @@ int MPID_nem_mxm_send(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     (VC_FIELD(vc, pending_sends)) += 1;
 
     mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND,
-                           (mxm_mq_h)comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset), 1);
+                           (mxm_mq_h) comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                                                                                              comm->
+                                                                                              context_id
+                                                                                              +
+                                                                                              context_offset),
+                           1);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
-fn_exit:
+  fn_exit:
     *sreq_ptr = sreq;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_SEND);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -278,15 +292,15 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_ssend
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_ssend(MPIDI_VC_t *vc, const void * buf, int 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, int 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;
     MPID_Datatype *dt_ptr;
-    int            dt_contig;
+    int dt_contig;
     MPIDI_msg_sz_t data_sz;
-    MPI_Aint       dt_true_lb;
+    MPI_Aint dt_true_lb;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_SSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_SSEND);
@@ -295,7 +309,7 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
 
     /* create a request */
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
-    MPIU_Assert (sreq != NULL);
+    MPIU_Assert(sreq != NULL);
     MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
     MPIDI_VC_FAI_send_seqnum(vc, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
@@ -309,38 +323,41 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     sreq->ch.vc = vc;
     sreq->ch.noncontig = FALSE;
 
-    _dbg_mxm_output(5, "sSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
+    _dbg_mxm_output(5,
+                    "sSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
                     sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 0;
     REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
-    REQ_FIELD(sreq, iov_buf)[0].length  = 0;
+    REQ_FIELD(sreq, iov_buf)[0].length = 0;
 
     if (data_sz) {
         if (dt_contig) {
             REQ_FIELD(sreq, iov_count) = 1;
-            REQ_FIELD(sreq, iov_buf)[0].ptr = (char*)(buf) + dt_true_lb;
+            REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
             REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
-        } else {
+        }
+        else {
             MPIDI_msg_sz_t last;
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t)packsize);
+                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
 
                 REQ_FIELD(sreq, iov_count) = 1;
                 REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
-                REQ_FIELD(sreq, iov_buf)[0].length  = last;
+                REQ_FIELD(sreq, iov_buf)[0].length = last;
             }
             sreq->ch.noncontig = TRUE;
         }
@@ -349,17 +366,22 @@ int MPID_nem_mxm_ssend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     (VC_FIELD(vc, pending_sends)) += 1;
 
     mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_SYNC,
-                           (mxm_mq_h)comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset), 1);
+                           (mxm_mq_h) comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                                                                                              comm->
+                                                                                              context_id
+                                                                                              +
+                                                                                              context_offset),
+                           1);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
-fn_exit:
+  fn_exit:
     *sreq_ptr = sreq;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_SSEND);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -368,15 +390,15 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_isend
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_isend(MPIDI_VC_t *vc, const void * buf, int 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, int 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;
     MPID_Datatype *dt_ptr;
-    int            dt_contig;
+    int dt_contig;
     MPIDI_msg_sz_t data_sz;
-    MPI_Aint       dt_true_lb;
+    MPI_Aint dt_true_lb;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISEND);
@@ -385,7 +407,7 @@ int MPID_nem_mxm_isend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
 
     /* create a request */
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
-    MPIU_Assert (sreq != NULL);
+    MPIU_Assert(sreq != NULL);
     MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
     MPIDI_VC_FAI_send_seqnum(vc, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
@@ -399,38 +421,41 @@ int MPID_nem_mxm_isend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     sreq->ch.vc = vc;
     sreq->ch.noncontig = FALSE;
 
-    _dbg_mxm_output(5, "iSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
+    _dbg_mxm_output(5,
+                    "iSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
                     sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 0;
     REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
-    REQ_FIELD(sreq, iov_buf)[0].length  = 0;
+    REQ_FIELD(sreq, iov_buf)[0].length = 0;
 
     if (data_sz) {
         if (dt_contig) {
             REQ_FIELD(sreq, iov_count) = 1;
-            REQ_FIELD(sreq, iov_buf)[0].ptr = (char*)(buf) + dt_true_lb;
+            REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
             REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
-        } else {
+        }
+        else {
             MPIDI_msg_sz_t last;
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t)packsize);
+                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
 
                 REQ_FIELD(sreq, iov_count) = 1;
                 REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
-                REQ_FIELD(sreq, iov_buf)[0].length  = last;
+                REQ_FIELD(sreq, iov_buf)[0].length = last;
             }
             sreq->ch.noncontig = TRUE;
         }
@@ -439,17 +464,22 @@ int MPID_nem_mxm_isend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype
     (VC_FIELD(vc, pending_sends)) += 1;
 
     mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND,
-                           (mxm_mq_h)comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset), 0);
+                           (mxm_mq_h) comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                                                                                              comm->
+                                                                                              context_id
+                                                                                              +
+                                                                                              context_offset),
+                           0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
-fn_exit:
+  fn_exit:
     *sreq_ptr = sreq;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_ISEND);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -458,15 +488,16 @@ fn_fail:
 #define FUNCNAME MPID_nem_mxm_issend
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_nem_mxm_issend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatype datatype, int rank, int tag,
-                MPID_Comm * comm, int context_offset, MPID_Request **sreq_ptr)
+int MPID_nem_mxm_issend(MPIDI_VC_t * vc, const void *buf, int 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;
     MPID_Datatype *dt_ptr;
-    int            dt_contig;
+    int dt_contig;
     MPIDI_msg_sz_t data_sz;
-    MPI_Aint       dt_true_lb;
+    MPI_Aint dt_true_lb;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_MXM_ISSEND);
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_MXM_ISSEND);
@@ -475,7 +506,7 @@ int MPID_nem_mxm_issend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatyp
 
     /* create a request */
     MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
-    MPIU_Assert (sreq != NULL);
+    MPIU_Assert(sreq != NULL);
     MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
     MPIDI_VC_FAI_send_seqnum(vc, seqnum);
     MPIDI_Request_set_seqnum(sreq, seqnum);
@@ -489,38 +520,41 @@ int MPID_nem_mxm_issend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatyp
     sreq->ch.vc = vc;
     sreq->ch.noncontig = FALSE;
 
-    _dbg_mxm_output(5, "isSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
+    _dbg_mxm_output(5,
+                    "isSend ========> Sending USER msg for req %p (context %d rank %d tag %d size %d) \n",
                     sreq, comm->context_id + context_offset, comm->rank, tag, data_sz);
 
     REQ_FIELD(sreq, ctx) = sreq;
     REQ_FIELD(sreq, iov_buf) = REQ_FIELD(sreq, tmp_buf);
     REQ_FIELD(sreq, iov_count) = 0;
     REQ_FIELD(sreq, iov_buf)[0].ptr = NULL;
-    REQ_FIELD(sreq, iov_buf)[0].length  = 0;
+    REQ_FIELD(sreq, iov_buf)[0].length = 0;
 
     if (data_sz) {
         if (dt_contig) {
             REQ_FIELD(sreq, iov_count) = 1;
-            REQ_FIELD(sreq, iov_buf)[0].ptr = (char*)(buf) + dt_true_lb;
+            REQ_FIELD(sreq, iov_buf)[0].ptr = (char *) (buf) + dt_true_lb;
             REQ_FIELD(sreq, iov_buf)[0].length = data_sz;
-        } else {
+        }
+        else {
             MPIDI_msg_sz_t last;
             MPI_Aint packsize = 0;
 
             sreq->dev.segment_ptr = MPID_Segment_alloc();
-            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+            MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER,
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPIR_Pack_size_impl(count, datatype, &packsize);
 
             last = data_sz;
             if (packsize > 0) {
-                sreq->dev.tmpbuf = MPIU_Malloc((size_t)packsize);
+                sreq->dev.tmpbuf = MPIU_Malloc((size_t) packsize);
                 MPIU_Assert(sreq->dev.tmpbuf);
                 MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
                 MPID_Segment_pack(sreq->dev.segment_ptr, 0, &last, sreq->dev.tmpbuf);
 
                 REQ_FIELD(sreq, iov_count) = 1;
                 REQ_FIELD(sreq, iov_buf)[0].ptr = sreq->dev.tmpbuf;
-                REQ_FIELD(sreq, iov_buf)[0].length  = last;
+                REQ_FIELD(sreq, iov_buf)[0].length = last;
             }
             sreq->ch.noncontig = TRUE;
         }
@@ -529,29 +563,35 @@ int MPID_nem_mxm_issend(MPIDI_VC_t *vc, const void * buf, int count, MPI_Datatyp
     (VC_FIELD(vc, pending_sends)) += 1;
 
     mpi_errno = _mxm_isend(VC_FIELD(vc, mxm_ep), REQ_BASE(sreq), MXM_MPICH_ISEND_SYNC,
-                           (mxm_mq_h)comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag, comm->context_id + context_offset), 0);
+                           (mxm_mq_h) comm->ch.netmod_comm, comm->rank, tag, _mxm_tag_mpi2mxm(tag,
+                                                                                              comm->
+                                                                                              context_id
+                                                                                              +
+                                                                                              context_offset),
+                           0);
     if (mpi_errno)
         MPIU_ERR_POP(mpi_errno);
 
     _dbg_mxm_out_req(sreq);
 
-fn_exit:
+  fn_exit:
     *sreq_ptr = sreq;
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_MXM_ISSEND);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
 
-static int _mxm_handle_sreq(MPID_Request *req)
+static int _mxm_handle_sreq(MPID_Request * req)
 {
     int complete = FALSE;
-    int (*reqFn)(MPIDI_VC_t *, MPID_Request *, int *);
+    int (*reqFn) (MPIDI_VC_t *, MPID_Request *, int *);
 
     _dbg_mxm_output(5, "========> Completing SEND req %p status %d\n", req, req->status.MPI_ERROR);
     _dbg_mxm_out_buf(REQ_FIELD(req, iov_buf)[0].ptr,
-                     (REQ_FIELD(req, iov_buf)[0].length > 16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
+                     (REQ_FIELD(req, iov_buf)[0].length >
+                      16 ? 16 : REQ_FIELD(req, iov_buf)[0].length));
 
     (VC_FIELD(req->ch.vc, pending_sends)) -= 1;
     if (((req->dev.datatype_ptr != NULL) && (req->dev.tmpbuf != NULL))) {
@@ -568,7 +608,8 @@ static int _mxm_handle_sreq(MPID_Request *req)
     if (!reqFn) {
         MPIDI_CH3U_Request_complete(req);
         MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, ".... complete");
-    } else {
+    }
+    else {
         MPIDI_VC_t *vc = req->ch.vc;
 
         reqFn(vc, req, &complete);
@@ -583,7 +624,7 @@ static int _mxm_handle_sreq(MPID_Request *req)
 
 static void _mxm_send_completion_cb(void *context)
 {
-    MPID_Request  *req = (MPID_Request *)context;
+    MPID_Request *req = (MPID_Request *) context;
 
     MPIU_Assert(req);
     MPIU_Assert((req->kind == MPID_REQUEST_SEND) || (req->kind == MPID_PREQUEST_SEND));
@@ -599,13 +640,13 @@ static void _mxm_send_completion_cb(void *context)
 }
 
 
-static int _mxm_isend(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req,
+static int _mxm_isend(MPID_nem_mxm_ep_t * ep, MPID_nem_mxm_req_area * req,
                       int type, mxm_mq_h mxm_mq, int mxm_rank, int id, mxm_tag_t mxm_tag, int block)
 {
     int mpi_errno = MPI_SUCCESS;
     mxm_error_t ret = MXM_OK;
     mxm_send_req_t *mxm_sreq;
-    list_head_t *free_queue =NULL;
+    list_head_t *free_queue = NULL;
 
     MPIU_Assert(ep);
     MPIU_Assert(req);
@@ -623,40 +664,43 @@ static int _mxm_isend(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req,
     }
     mxm_sreq = &(req->mxm_req->item.send);
 
-    mxm_sreq->base.state            = MXM_REQ_NEW;
-    mxm_sreq->base.mq               = mxm_mq;
-    mxm_sreq->base.conn             = ep->mxm_conn;
-    mxm_sreq->base.completed_cb     = _mxm_send_completion_cb;
-    mxm_sreq->base.context          = req->ctx;
+    mxm_sreq->base.state = MXM_REQ_NEW;
+    mxm_sreq->base.mq = mxm_mq;
+    mxm_sreq->base.conn = ep->mxm_conn;
+    mxm_sreq->base.completed_cb = _mxm_send_completion_cb;
+    mxm_sreq->base.context = req->ctx;
 
     if (type == MXM_MPICH_ISEND_AM) {
-        mxm_sreq->opcode                = MXM_REQ_OP_AM;
-        mxm_sreq->flags                 = 0;
-
-        mxm_sreq->op.am.hid             = id;
-        mxm_sreq->op.am.imm_data        = mxm_rank;
-    } else if (type == MXM_MPICH_ISEND_SYNC) {
-        mxm_sreq->opcode                = MXM_REQ_OP_SEND_SYNC;
-        mxm_sreq->flags                 = 0;
-
-        mxm_sreq->op.send.tag           = mxm_tag;
-        mxm_sreq->op.send.imm_data      = mxm_rank;
-    } else {
-        mxm_sreq->opcode                = MXM_REQ_OP_SEND;
-        mxm_sreq->flags                 = 0;
-
-        mxm_sreq->op.send.tag           = mxm_tag;
-        mxm_sreq->op.send.imm_data      = mxm_rank;
+        mxm_sreq->opcode = MXM_REQ_OP_AM;
+        mxm_sreq->flags = 0;
+
+        mxm_sreq->op.am.hid = id;
+        mxm_sreq->op.am.imm_data = mxm_rank;
+    }
+    else if (type == MXM_MPICH_ISEND_SYNC) {
+        mxm_sreq->opcode = MXM_REQ_OP_SEND_SYNC;
+        mxm_sreq->flags = 0;
+
+        mxm_sreq->op.send.tag = mxm_tag;
+        mxm_sreq->op.send.imm_data = mxm_rank;
+    }
+    else {
+        mxm_sreq->opcode = MXM_REQ_OP_SEND;
+        mxm_sreq->flags = 0;
+
+        mxm_sreq->op.send.tag = mxm_tag;
+        mxm_sreq->op.send.imm_data = mxm_rank;
     }
 
     if (likely(req->iov_count == 1)) {
-        mxm_sreq->base.data_type          = MXM_REQ_DATA_BUFFER;
-        mxm_sreq->base.data.buffer.ptr    = req->iov_buf[0].ptr;
+        mxm_sreq->base.data_type = MXM_REQ_DATA_BUFFER;
+        mxm_sreq->base.data.buffer.ptr = req->iov_buf[0].ptr;
         mxm_sreq->base.data.buffer.length = req->iov_buf[0].length;
-    } else {
-        mxm_sreq->base.data_type          = MXM_REQ_DATA_IOV;
-        mxm_sreq->base.data.iov.vector    = req->iov_buf;
-        mxm_sreq->base.data.iov.count     = req->iov_count;
+    }
+    else {
+        mxm_sreq->base.data_type = MXM_REQ_DATA_IOV;
+        mxm_sreq->base.data.iov.vector = req->iov_buf;
+        mxm_sreq->base.data.iov.count = req->iov_count;
     }
 
     ret = mxm_req_send(mxm_sreq);
@@ -670,34 +714,36 @@ static int _mxm_isend(MPID_nem_mxm_ep_t *ep, MPID_nem_mxm_req_area *req,
         _mxm_req_wait(&mxm_sreq->base);
 //    list_enqueue(&ep->out_queue, &req->mxm_req->queue);
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
 
-static int _mxm_process_sdtype(MPID_Request **sreq_p, MPI_Datatype datatype, MPID_Datatype *dt_ptr, MPIDI_msg_sz_t data_sz,
-                               const void *buf, int count,
-                               mxm_req_buffer_t **iov_buf, int *iov_count)
+static int _mxm_process_sdtype(MPID_Request ** sreq_p, MPI_Datatype datatype,
+                               MPID_Datatype * dt_ptr, MPIDI_msg_sz_t data_sz, const void *buf,
+                               int count, mxm_req_buffer_t ** iov_buf, int *iov_count)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPID_Request  *sreq      = *sreq_p;
+    MPID_Request *sreq = *sreq_p;
     MPIDI_msg_sz_t last;
-    MPID_IOV      *iov;
-    int            n_iov     = 0;
-    int            index;
+    MPID_IOV *iov;
+    int n_iov = 0;
+    int index;
     int size_to_copy = 0;
 
     sreq->dev.segment_ptr = MPID_Segment_alloc();
-    MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+    MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem",
+                         "**nomem %s", "MPID_Segment_alloc");
 
     MPID_Segment_init(buf, count, datatype, sreq->dev.segment_ptr, 0);
     sreq->dev.segment_first = 0;
     sreq->dev.segment_size = data_sz;
 
     last = sreq->dev.segment_size;
-    MPID_Segment_count_contig_blocks(sreq->dev.segment_ptr, sreq->dev.segment_first, &last, (MPI_Aint *)&n_iov);
+    MPID_Segment_count_contig_blocks(sreq->dev.segment_ptr, sreq->dev.segment_first, &last,
+                                     (MPI_Aint *) & n_iov);
     MPIU_Assert(n_iov > 0);
     iov = MPIU_Malloc(n_iov * sizeof(*iov));
     MPIU_Assert(iov);
@@ -707,15 +753,16 @@ static int _mxm_process_sdtype(MPID_Request **sreq_p, MPI_Datatype datatype, MPI
     MPIU_Assert(last == sreq->dev.segment_size);
 
     if (n_iov > MXM_MPICH_MAX_IOV) {
-        *iov_buf = (mxm_req_buffer_t *)MPIU_Malloc(n_iov * sizeof(**iov_buf));
+        *iov_buf = (mxm_req_buffer_t *) MPIU_Malloc(n_iov * sizeof(**iov_buf));
         MPIU_Assert(*iov_buf);
     }
 
-    for(index = 0; index < n_iov ; index++) {
+    for (index = 0; index < n_iov; index++) {
         if (index < (MXM_REQ_DATA_MAX_IOV - 1)) {
             (*iov_buf)[index].ptr = iov[index].MPID_IOV_BUF;
-            (*iov_buf)[index].length  = iov[index].MPID_IOV_LEN;
-        } else {
+            (*iov_buf)[index].length = iov[index].MPID_IOV_LEN;
+        }
+        else {
             size_to_copy += iov[index].MPID_IOV_LEN;
         }
     }
@@ -724,23 +771,25 @@ static int _mxm_process_sdtype(MPID_Request **sreq_p, MPI_Datatype datatype, MPI
         sreq->dev.tmpbuf = NULL;
         sreq->dev.tmpbuf_sz = 0;
         *iov_count = n_iov;
-    } else {
+    }
+    else {
         int offset = 0;
         sreq->dev.tmpbuf = MPIU_Malloc(size_to_copy);
         sreq->dev.tmpbuf_sz = size_to_copy;
         MPIU_Assert(sreq->dev.tmpbuf);
-        for(index = (MXM_REQ_DATA_MAX_IOV - 1); index < n_iov; index++) {
-            MPIU_Memcpy((char *)(sreq->dev.tmpbuf) + offset, iov[index].MPID_IOV_BUF, iov[index].MPID_IOV_LEN);
+        for (index = (MXM_REQ_DATA_MAX_IOV - 1); index < n_iov; index++) {
+            MPIU_Memcpy((char *) (sreq->dev.tmpbuf) + offset, iov[index].MPID_IOV_BUF,
+                        iov[index].MPID_IOV_LEN);
             offset += iov[index].MPID_IOV_LEN;
         }
         (*iov_buf)[MXM_REQ_DATA_MAX_IOV - 1].ptr = sreq->dev.tmpbuf;
-        (*iov_buf)[MXM_REQ_DATA_MAX_IOV - 1].length  = size_to_copy;
+        (*iov_buf)[MXM_REQ_DATA_MAX_IOV - 1].length = size_to_copy;
         *iov_count = MXM_REQ_DATA_MAX_IOV;
     }
     MPIU_Free(iov);
 
-fn_exit:
+  fn_exit:
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }

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

Summary of changes:
 .../ch3/channels/nemesis/netmod/mxm/mxm_cancel.c   |   22 +-
 .../ch3/channels/nemesis/netmod/mxm/mxm_finalize.c |    2 -
 .../ch3/channels/nemesis/netmod/mxm/mxm_impl.h     |  210 +++++-----
 .../ch3/channels/nemesis/netmod/mxm/mxm_init.c     |  426 ++++++++++----------
 .../ch3/channels/nemesis/netmod/mxm/mxm_poll.c     |  246 ++++++------
 .../ch3/channels/nemesis/netmod/mxm/mxm_probe.c    |   63 ++--
 .../ch3/channels/nemesis/netmod/mxm/mxm_send.c     |  351 +++++++++-------
 7 files changed, 698 insertions(+), 622 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list