[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1.3-60-gfe283e9

Service Account noreply at mpich.org
Thu Oct 30 22:20:09 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  fe283e913b045aca234290ba31495b2089edb64d (commit)
      from  9e27235aeeb4c49a3599197b225a5390a3cf2fb0 (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/fe283e913b045aca234290ba31495b2089edb64d

commit fe283e913b045aca234290ba31495b2089edb64d
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Fri Jul 18 16:12:53 2014 -0500

    Clean up white-space and code format in RMA code.
    
    No reviewer.

diff --git a/src/mpid/ch3/include/mpidpkt.h b/src/mpid/ch3/include/mpidpkt.h
index 570cd56..46f2769 100644
--- a/src/mpid/ch3/include/mpidpkt.h
+++ b/src/mpid/ch3/include/mpidpkt.h
@@ -30,14 +30,14 @@
    packet header for immediate data.  */
 typedef union {
 #define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) c_type_ cas_##type_name_;
-        MPIR_OP_TYPE_GROUP(C_INTEGER)
-        MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
-        MPIR_OP_TYPE_GROUP(LOGICAL)
-        MPIR_OP_TYPE_GROUP(BYTE)
-        MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
-        MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
-        MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
-        MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
+    MPIR_OP_TYPE_GROUP(C_INTEGER)
+    MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
+    MPIR_OP_TYPE_GROUP(LOGICAL)
+    MPIR_OP_TYPE_GROUP(BYTE)
+    MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
+    MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
+    MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
+    MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
 #undef MPIR_OP_TYPE_MACRO
 } MPIDI_CH3_CAS_Immed_u;
 
@@ -48,12 +48,16 @@ typedef union {
 #define MPIDI_RMA_FOP_IMMED_INTS 2
 #define MPIDI_RMA_FOP_RESP_IMMED_INTS 8
 
+/* *INDENT-OFF* */
+/* Indentation turned off because "indent" is getting confused with
+ * the lack of a semi-colon in the fields below */
 typedef union {
 #define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) c_type_ fop##type_name_;
-        MPIR_OP_TYPE_GROUP_ALL_BASIC
-        MPIR_OP_TYPE_GROUP_ALL_EXTRA
+    MPIR_OP_TYPE_GROUP_ALL_BASIC
+    MPIR_OP_TYPE_GROUP_ALL_EXTRA
 #undef MPIR_OP_TYPE_MACRO
 } MPIDI_CH3_FOP_Immed_u;
+/* *INDENT-ON* */
 
 /*
  * Predefined packet types.  This simplifies some of the code.
@@ -63,21 +67,20 @@ typedef union {
 /* We start with an arbitrarily chosen number (42), to help with
  * debugging when a packet type is not initialized or wrongly
  * initialized. */
-typedef enum
-{
+typedef enum {
     MPIDI_CH3_PKT_EAGER_SEND = 42,
 #if defined(USE_EAGER_SHORT)
     MPIDI_CH3_PKT_EAGERSHORT_SEND,
 #endif /* defined(USE_EAGER_SHORT) */
-    MPIDI_CH3_PKT_EAGER_SYNC_SEND,    /* FIXME: no sync eager */
+    MPIDI_CH3_PKT_EAGER_SYNC_SEND,      /* FIXME: no sync eager */
     MPIDI_CH3_PKT_EAGER_SYNC_ACK,
     MPIDI_CH3_PKT_READY_SEND,
     MPIDI_CH3_PKT_RNDV_REQ_TO_SEND,
     MPIDI_CH3_PKT_RNDV_CLR_TO_SEND,
-    MPIDI_CH3_PKT_RNDV_SEND,          /* FIXME: should be stream put */
+    MPIDI_CH3_PKT_RNDV_SEND,    /* FIXME: should be stream put */
     MPIDI_CH3_PKT_CANCEL_SEND_REQ,
     MPIDI_CH3_PKT_CANCEL_SEND_RESP,
-    MPIDI_CH3_PKT_PUT,                /* RMA Packets begin here */
+    MPIDI_CH3_PKT_PUT,  /* RMA Packets begin here */
     MPIDI_CH3_PKT_GET,
     MPIDI_CH3_PKT_GET_RESP,
     MPIDI_CH3_PKT_ACCUMULATE,
@@ -86,11 +89,11 @@ typedef enum
     MPIDI_CH3_PKT_UNLOCK,
     MPIDI_CH3_PKT_FLUSH,
     MPIDI_CH3_PKT_PT_RMA_DONE,
-    MPIDI_CH3_PKT_LOCK_PUT_UNLOCK, /* optimization for single puts */
-    MPIDI_CH3_PKT_LOCK_GET_UNLOCK, /* optimization for single gets */
-    MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK, /* optimization for single accumulates */
-                                     /* RMA Packets end here */
-    MPIDI_CH3_PKT_ACCUM_IMMED,     /* optimization for short accumulate */
+    MPIDI_CH3_PKT_LOCK_PUT_UNLOCK,      /* optimization for single puts */
+    MPIDI_CH3_PKT_LOCK_GET_UNLOCK,      /* optimization for single gets */
+    MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK,    /* optimization for single accumulates */
+    /* RMA Packets end here */
+    MPIDI_CH3_PKT_ACCUM_IMMED,  /* optimization for short accumulate */
     /* FIXME: Add PUT, GET_IMMED packet types */
     MPIDI_CH3_PKT_CAS,
     MPIDI_CH3_PKT_CAS_RESP,
@@ -98,19 +101,20 @@ typedef enum
     MPIDI_CH3_PKT_FOP_RESP,
     MPIDI_CH3_PKT_GET_ACCUM,
     MPIDI_CH3_PKT_GET_ACCUM_RESP,
-    MPIDI_CH3_PKT_FLOW_CNTL_UPDATE,  /* FIXME: Unused */
+    MPIDI_CH3_PKT_FLOW_CNTL_UPDATE,     /* FIXME: Unused */
     MPIDI_CH3_PKT_CLOSE,
     MPIDI_CH3_PKT_REVOKE,
     MPIDI_CH3_PKT_END_CH3,
     /* The channel can define additional types by defining the value
-       MPIDI_CH3_PKT_ENUM */
+     * MPIDI_CH3_PKT_ENUM */
 # if defined(MPIDI_CH3_PKT_ENUM)
     MPIDI_CH3_PKT_ENUM,
-# endif    
+# endif
     MPIDI_CH3_PKT_END_ALL,
-    MPIDI_CH3_PKT_INVALID = -1 /* forces a signed enum to quash warnings */
+    MPIDI_CH3_PKT_INVALID = -1  /* forces a signed enum to quash warnings */
 } MPIDI_CH3_Pkt_type_t;
 
+/* These flags can be "OR'ed" together */
 typedef enum {
     MPIDI_CH3_PKT_FLAG_NONE = 0,
     MPIDI_CH3_PKT_FLAG_RMA_LOCK = 1,
@@ -123,155 +127,134 @@ typedef enum {
     MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE = 128
 } MPIDI_CH3_Pkt_flags_t;
 
-typedef struct MPIDI_CH3_Pkt_send
-{
+typedef struct MPIDI_CH3_Pkt_send {
     MPIDI_CH3_Pkt_type_t type;  /* XXX - uint8_t to conserve space ??? */
     MPIDI_Message_match match;
-    MPI_Request sender_req_id;	/* needed for ssend and send cancel */
+    MPI_Request sender_req_id;  /* needed for ssend and send cancel */
     MPIDI_msg_sz_t data_sz;
 #if defined(MPID_USE_SEQUENCE_NUMBERS)
     MPID_Seqnum_t seqnum;
-#endif    
-}
-MPIDI_CH3_Pkt_send_t;
+#endif
+} MPIDI_CH3_Pkt_send_t;
 
-/* NOTE: Normal and synchronous eager sends, as well as all ready-mode sends, 
+/* NOTE: Normal and synchronous eager sends, as well as all ready-mode sends,
    use the same structure but have a different type value. */
 typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_eager_send_t;
 typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_eager_sync_send_t;
 typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_ready_send_t;
 
 #if defined(USE_EAGER_SHORT)
-typedef struct MPIDI_CH3_Pkt_eagershort_send
-{
+typedef struct MPIDI_CH3_Pkt_eagershort_send {
     MPIDI_CH3_Pkt_type_t type;  /* XXX - uint8_t to conserve space ??? */
     MPIDI_Message_match match;
     MPIDI_msg_sz_t data_sz;
 #if defined(MPID_USE_SEQUENCE_NUMBERS)
     MPID_Seqnum_t seqnum;
 #endif
-    int  data[MPIDI_EAGER_SHORT_INTS];    /* FIXME: Experimental for now */
-}
-MPIDI_CH3_Pkt_eagershort_send_t;
+    int data[MPIDI_EAGER_SHORT_INTS];   /* FIXME: Experimental for now */
+} MPIDI_CH3_Pkt_eagershort_send_t;
 #endif /* defined(USE_EAGER_SHORT) */
 
-typedef struct MPIDI_CH3_Pkt_eager_sync_ack
-{
+typedef struct MPIDI_CH3_Pkt_eager_sync_ack {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request sender_req_id;
-}
-MPIDI_CH3_Pkt_eager_sync_ack_t;
+} MPIDI_CH3_Pkt_eager_sync_ack_t;
 
 typedef MPIDI_CH3_Pkt_send_t MPIDI_CH3_Pkt_rndv_req_to_send_t;
 
-typedef struct MPIDI_CH3_Pkt_rndv_clr_to_send
-{
+typedef struct MPIDI_CH3_Pkt_rndv_clr_to_send {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request sender_req_id;
     MPI_Request receiver_req_id;
-}
-MPIDI_CH3_Pkt_rndv_clr_to_send_t;
+} MPIDI_CH3_Pkt_rndv_clr_to_send_t;
 
-typedef struct MPIDI_CH3_Pkt_rndv_send
-{
+typedef struct MPIDI_CH3_Pkt_rndv_send {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request receiver_req_id;
-}
-MPIDI_CH3_Pkt_rndv_send_t;
+} MPIDI_CH3_Pkt_rndv_send_t;
 
-typedef struct MPIDI_CH3_Pkt_cancel_send_req
-{
+typedef struct MPIDI_CH3_Pkt_cancel_send_req {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_Message_match match;
     MPI_Request sender_req_id;
-}
-MPIDI_CH3_Pkt_cancel_send_req_t;
+} MPIDI_CH3_Pkt_cancel_send_req_t;
 
-typedef struct MPIDI_CH3_Pkt_cancel_send_resp
-{
+typedef struct MPIDI_CH3_Pkt_cancel_send_resp {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request sender_req_id;
     int ack;
-}
-MPIDI_CH3_Pkt_cancel_send_resp_t;
+} MPIDI_CH3_Pkt_cancel_send_resp_t;
 
+/* *INDENT-OFF* */
+/* Indentation turned off because "indent" is getting confused with
+ * the lack of a semi-colon in the field below */
 #if defined(MPIDI_CH3_PKT_DEFS)
 MPIDI_CH3_PKT_DEFS
 #endif
+/* *INDENT-ON* */
 
-typedef struct MPIDI_CH3_Pkt_put
-{
+typedef struct MPIDI_CH3_Pkt_put {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     void *addr;
     int count;
     MPI_Datatype datatype;
-    int dataloop_size;   /* for derived datatypes */
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                               * epoch for decrementing rma op counter in
-                               * active target rma and for unlocking window 
-                               * in passive target rma. Otherwise set to NULL*/
-    MPI_Win source_win_handle; /* Used in the last RMA operation in an
-                               * epoch in the case of passive target rma
-                               * with shared locks. Otherwise set to NULL*/
-}
-MPIDI_CH3_Pkt_put_t;
-
-typedef struct MPIDI_CH3_Pkt_get
-{
+    int dataloop_size;          /* for derived datatypes */
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
+    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
+                                 * epoch in the case of passive target rma
+                                 * with shared locks. Otherwise set to NULL*/
+} MPIDI_CH3_Pkt_put_t;
+
+typedef struct MPIDI_CH3_Pkt_get {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     void *addr;
     int count;
     MPI_Datatype datatype;
-    int dataloop_size;   /* for derived datatypes */
+    int dataloop_size;          /* for derived datatypes */
     MPI_Request request_handle;
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                               * epoch for decrementing rma op counter in
-                               * active target rma and for unlocking window 
-                               * in passive target rma. Otherwise set to NULL*/
-    MPI_Win source_win_handle; /* Used in the last RMA operation in an
-                               * epoch in the case of passive target rma
-                               * with shared locks. Otherwise set to NULL*/
-}
-MPIDI_CH3_Pkt_get_t;
-
-typedef struct MPIDI_CH3_Pkt_get_resp
-{
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
+    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
+                                 * epoch in the case of passive target rma
+                                 * with shared locks. Otherwise set to NULL*/
+} MPIDI_CH3_Pkt_get_t;
+
+typedef struct MPIDI_CH3_Pkt_get_resp {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request request_handle;
-}
-MPIDI_CH3_Pkt_get_resp_t;
+} MPIDI_CH3_Pkt_get_resp_t;
 
-typedef struct MPIDI_CH3_Pkt_accum
-{
+typedef struct MPIDI_CH3_Pkt_accum {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Request request_handle; /* For get_accumulate response */
     void *addr;
     int count;
     MPI_Datatype datatype;
-    int dataloop_size;   /* for derived datatypes */
+    int dataloop_size;          /* for derived datatypes */
     MPI_Op op;
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                               * epoch for decrementing rma op counter in
-                               * active target rma and for unlocking window 
-                               * in passive target rma. Otherwise set to NULL*/
-    MPI_Win source_win_handle; /* Used in the last RMA operation in an
-                               * epoch in the case of passive target rma
-                               * with shared locks. Otherwise set to NULL*/
-}
-MPIDI_CH3_Pkt_accum_t;
-
-typedef struct MPIDI_CH3_Pkt_get_accum_resp
-{
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
+    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
+                                 * epoch in the case of passive target rma
+                                 * with shared locks. Otherwise set to NULL*/
+} MPIDI_CH3_Pkt_accum_t;
+
+typedef struct MPIDI_CH3_Pkt_get_accum_resp {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request request_handle;
-}
-MPIDI_CH3_Pkt_get_accum_resp_t;
+} MPIDI_CH3_Pkt_get_accum_resp_t;
 
-typedef struct MPIDI_CH3_Pkt_accum_immed
-{
+typedef struct MPIDI_CH3_Pkt_accum_immed {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     void *addr;
@@ -280,91 +263,77 @@ typedef struct MPIDI_CH3_Pkt_accum_immed
     MPI_Datatype datatype;
     MPI_Op op;
     /* FIXME: do we need these (use a regular accum packet if we do?) */
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                               * epoch for decrementing rma op counter in
-                               * active target rma and for unlocking window 
-                               * in passive target rma. Otherwise set to NULL*/
-    MPI_Win source_win_handle; /* Used in the last RMA operation in an
-                               * epoch in the case of passive target rma
-                               * with shared locks. Otherwise set to NULL*/
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
+    MPI_Win source_win_handle;  /* Used in the last RMA operation in an
+                                 * epoch in the case of passive target rma
+                                 * with shared locks. Otherwise set to NULL*/
     int data[MPIDI_RMA_IMMED_INTS];
-}
-MPIDI_CH3_Pkt_accum_immed_t;
+} MPIDI_CH3_Pkt_accum_immed_t;
 
-typedef struct MPIDI_CH3_Pkt_cas
-{
+typedef struct MPIDI_CH3_Pkt_cas {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Datatype datatype;
     void *addr;
     MPI_Request request_handle;
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                                * epoch for decrementing rma op counter in
-                                * active target rma and for unlocking window 
-                                * in passive target rma. Otherwise set to NULL*/
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
     MPIDI_CH3_CAS_Immed_u origin_data;
     MPIDI_CH3_CAS_Immed_u compare_data;
-}
-MPIDI_CH3_Pkt_cas_t;
+} MPIDI_CH3_Pkt_cas_t;
 
-typedef struct MPIDI_CH3_Pkt_cas_resp
-{
+typedef struct MPIDI_CH3_Pkt_cas_resp {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request request_handle;
     MPIDI_CH3_CAS_Immed_u data;
-}
-MPIDI_CH3_Pkt_cas_resp_t;
+} MPIDI_CH3_Pkt_cas_resp_t;
 
-typedef struct MPIDI_CH3_Pkt_fop
-{
+typedef struct MPIDI_CH3_Pkt_fop {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Datatype datatype;
     void *addr;
     MPI_Op op;
     MPI_Request request_handle;
-    MPI_Win target_win_handle; /* Used in the last RMA operation in each
-                                * epoch for decrementing rma op counter in
-                                * active target rma and for unlocking window 
-                                * in passive target rma. Otherwise set to NULL*/
+    MPI_Win target_win_handle;  /* Used in the last RMA operation in each
+                                 * epoch for decrementing rma op counter in
+                                 * active target rma and for unlocking window
+                                 * in passive target rma. Otherwise set to NULL*/
     int origin_data[MPIDI_RMA_FOP_IMMED_INTS];
-}
-MPIDI_CH3_Pkt_fop_t;
+} MPIDI_CH3_Pkt_fop_t;
 
-typedef struct MPIDI_CH3_Pkt_fop_resp
-{
+typedef struct MPIDI_CH3_Pkt_fop_resp {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Request request_handle;
     int data[MPIDI_RMA_FOP_RESP_IMMED_INTS];
-}
-MPIDI_CH3_Pkt_fop_resp_t;
+} MPIDI_CH3_Pkt_fop_resp_t;
 
-typedef struct MPIDI_CH3_Pkt_lock
-{
+typedef struct MPIDI_CH3_Pkt_lock {
     MPIDI_CH3_Pkt_type_t type;
     int lock_type;
     MPI_Win target_win_handle;
     MPI_Win source_win_handle;
     int target_rank;            /* Used in unluck/flush response to look up the
-                                   target state at the origin. */
-}
-MPIDI_CH3_Pkt_lock_t;
+                                 * target state at the origin. */
+} MPIDI_CH3_Pkt_lock_t;
 
-typedef struct MPIDI_CH3_Pkt_lock_granted
-{
+typedef struct MPIDI_CH3_Pkt_lock_granted {
     MPIDI_CH3_Pkt_type_t type;
     MPI_Win source_win_handle;
     int target_rank;            /* Used in pt_rma_done response to look up the
-                                   target state at the origin. */
-}
-MPIDI_CH3_Pkt_lock_granted_t;
+                                 * target state at the origin. */
+} MPIDI_CH3_Pkt_lock_granted_t;
 
 typedef MPIDI_CH3_Pkt_lock_granted_t MPIDI_CH3_Pkt_pt_rma_done_t;
 typedef MPIDI_CH3_Pkt_lock_t MPIDI_CH3_Pkt_unlock_t;
 typedef MPIDI_CH3_Pkt_lock_t MPIDI_CH3_Pkt_flush_t;
 
-typedef struct MPIDI_CH3_Pkt_lock_put_unlock
-{
+typedef struct MPIDI_CH3_Pkt_lock_put_unlock {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Win target_win_handle;
@@ -373,11 +342,9 @@ typedef struct MPIDI_CH3_Pkt_lock_put_unlock
     void *addr;
     int count;
     MPI_Datatype datatype;
-}
-MPIDI_CH3_Pkt_lock_put_unlock_t;
+} MPIDI_CH3_Pkt_lock_put_unlock_t;
 
-typedef struct MPIDI_CH3_Pkt_lock_get_unlock
-{
+typedef struct MPIDI_CH3_Pkt_lock_get_unlock {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Win target_win_handle;
@@ -387,11 +354,9 @@ typedef struct MPIDI_CH3_Pkt_lock_get_unlock
     int count;
     MPI_Datatype datatype;
     MPI_Request request_handle;
-}
-MPIDI_CH3_Pkt_lock_get_unlock_t;
+} MPIDI_CH3_Pkt_lock_get_unlock_t;
 
-typedef struct MPIDI_CH3_Pkt_lock_accum_unlock
-{
+typedef struct MPIDI_CH3_Pkt_lock_accum_unlock {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_flags_t flags;
     MPI_Win target_win_handle;
@@ -401,31 +366,25 @@ typedef struct MPIDI_CH3_Pkt_lock_accum_unlock
     int count;
     MPI_Datatype datatype;
     MPI_Op op;
-}
-MPIDI_CH3_Pkt_lock_accum_unlock_t;
+} MPIDI_CH3_Pkt_lock_accum_unlock_t;
 
 
-typedef struct MPIDI_CH3_Pkt_close
-{
+typedef struct MPIDI_CH3_Pkt_close {
     MPIDI_CH3_Pkt_type_t type;
     int ack;
-}
-MPIDI_CH3_Pkt_close_t;
+} MPIDI_CH3_Pkt_close_t;
 
-typedef struct MPIDI_CH3_Pkt_revoke
-{
+typedef struct MPIDI_CH3_Pkt_revoke {
     MPIDI_CH3_Pkt_type_t type;
     MPIR_Context_id_t revoked_comm;
-}
-MPIDI_CH3_Pkt_revoke_t;
+} MPIDI_CH3_Pkt_revoke_t;
 
-typedef union MPIDI_CH3_Pkt
-{
+typedef union MPIDI_CH3_Pkt {
     MPIDI_CH3_Pkt_type_t type;
     MPIDI_CH3_Pkt_eager_send_t eager_send;
 #if defined(USE_EAGER_SHORT)
     MPIDI_CH3_Pkt_eagershort_send_t eagershort_send;
-#endif /* defined(USE_EAGER_SHORT) */
+#endif                          /* defined(USE_EAGER_SHORT) */
     MPIDI_CH3_Pkt_eager_sync_send_t eager_sync_send;
     MPIDI_CH3_Pkt_eager_sync_ack_t eager_sync_ack;
     MPIDI_CH3_Pkt_eager_send_t ready_send;
@@ -443,7 +402,7 @@ typedef union MPIDI_CH3_Pkt
     MPIDI_CH3_Pkt_lock_granted_t lock_granted;
     MPIDI_CH3_Pkt_unlock_t unlock;
     MPIDI_CH3_Pkt_flush_t flush;
-    MPIDI_CH3_Pkt_pt_rma_done_t pt_rma_done;    
+    MPIDI_CH3_Pkt_pt_rma_done_t pt_rma_done;
     MPIDI_CH3_Pkt_lock_put_unlock_t lock_put_unlock;
     MPIDI_CH3_Pkt_lock_get_unlock_t lock_get_unlock;
     MPIDI_CH3_Pkt_lock_accum_unlock_t lock_accum_unlock;
@@ -455,18 +414,15 @@ typedef union MPIDI_CH3_Pkt
     MPIDI_CH3_Pkt_get_accum_resp_t get_accum_resp;
     MPIDI_CH3_Pkt_revoke_t revoke;
 # if defined(MPIDI_CH3_PKT_DECL)
-    MPIDI_CH3_PKT_DECL
+     MPIDI_CH3_PKT_DECL
 # endif
-}
-MPIDI_CH3_Pkt_t;
+} MPIDI_CH3_Pkt_t;
 
 #if defined(MPID_USE_SEQUENCE_NUMBERS)
-typedef struct MPIDI_CH3_Pkt_send_container
-{
+typedef struct MPIDI_CH3_Pkt_send_container {
     MPIDI_CH3_Pkt_send_t pkt;
-    struct MPIDI_CH3_Pkt_send_container_s * next;
-}
-MPIDI_CH3_Pkt_send_container_t;
+    struct MPIDI_CH3_Pkt_send_container_s *next;
+} MPIDI_CH3_Pkt_send_container_t;
 #endif
 
 #endif
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 8024bf2..3048056 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -14,28 +14,28 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_winfree_rs);
 MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_winfree_complete);
 
 typedef enum MPIDI_RMA_Op_type {
-    MPIDI_RMA_PUT               = 23,
-    MPIDI_RMA_GET               = 24,
-    MPIDI_RMA_ACCUMULATE        = 25,
- /* REMOVED: MPIDI_RMA_LOCK     = 26, */
-    MPIDI_RMA_ACC_CONTIG        = 27,
-    MPIDI_RMA_GET_ACCUMULATE    = 28,
-    MPIDI_RMA_COMPARE_AND_SWAP  = 29,
-    MPIDI_RMA_FETCH_AND_OP      = 30
+    MPIDI_RMA_PUT = 23,
+    MPIDI_RMA_GET = 24,
+    MPIDI_RMA_ACCUMULATE = 25,
+    /* REMOVED: MPIDI_RMA_LOCK     = 26, */
+    MPIDI_RMA_ACC_CONTIG = 27,
+    MPIDI_RMA_GET_ACCUMULATE = 28,
+    MPIDI_RMA_COMPARE_AND_SWAP = 29,
+    MPIDI_RMA_FETCH_AND_OP = 30
 } MPIDI_RMA_Op_type_t;
 
 /* Special case RMA operations */
 
 enum MPIDI_RMA_Datatype {
-    MPIDI_RMA_DATATYPE_BASIC    = 50,
-    MPIDI_RMA_DATATYPE_DERIVED  = 51
+    MPIDI_RMA_DATATYPE_BASIC = 50,
+    MPIDI_RMA_DATATYPE_DERIVED = 51
 };
 
 /* We start with an arbitrarily chosen number (42), to help with
  * debugging when a packet type is not initialized or wrongly
  * initialized. */
 enum MPID_Lock_state {
-    MPID_LOCK_NONE              = 42,
+    MPID_LOCK_NONE = 42,
     MPID_LOCK_SHARED_ALL
 };
 
@@ -45,18 +45,18 @@ enum MPID_Lock_state {
  */
 
 /* to send derived datatype across in RMA ops */
-typedef struct MPIDI_RMA_dtype_info { /* for derived datatypes */
-    int           is_contig; 
-    int           max_contig_blocks;
-    MPI_Aint      size;
-    MPI_Aint      extent;   
-    int           dataloop_size; /* not needed because this info is sent in 
-				    packet header. remove it after lock/unlock 
-				    is implemented in the device */
-    void          *dataloop;  /* pointer needed to update pointers
-                                 within dataloop on remote side */
-    int           dataloop_depth; 
-    int           eltype;
+typedef struct MPIDI_RMA_dtype_info {   /* for derived datatypes */
+    int is_contig;
+    int max_contig_blocks;
+    MPI_Aint size;
+    MPI_Aint extent;
+    int dataloop_size;          /* not needed because this info is sent in
+                                 * packet header. remove it after lock/unlock
+                                 * is implemented in the device */
+    void *dataloop;             /* pointer needed to update pointers
+                                 * within dataloop on remote side */
+    int dataloop_depth;
+    int eltype;
     MPI_Aint ub, lb, true_ub, true_lb;
     int has_sticky_ub, has_sticky_lb;
 } MPIDI_RMA_dtype_info;
@@ -65,10 +65,10 @@ typedef struct MPIDI_RMA_dtype_info { /* for derived datatypes */
 typedef struct MPIDI_RMA_Op {
     struct MPIDI_RMA_Op *prev;  /* pointer to next element in list */
     struct MPIDI_RMA_Op *next;  /* pointer to next element in list */
-    /* FIXME: It would be better to setup the packet that will be sent, at 
-       least in most cases (if, as a result of the sync/ops/sync sequence,
-       a different packet type is needed, it can be extracted from the 
-       information otherwise stored). */
+    /* FIXME: It would be better to setup the packet that will be sent, at
+     * least in most cases (if, as a result of the sync/ops/sync sequence,
+     * a different packet type is needed, it can be extracted from the
+     * information otherwise stored). */
     MPIDI_RMA_Op_type_t type;
     void *origin_addr;
     int origin_count;
@@ -77,7 +77,7 @@ typedef struct MPIDI_RMA_Op {
     MPI_Aint target_disp;
     int target_count;
     MPI_Datatype target_datatype;
-    MPI_Op op;  /* for accumulate */
+    MPI_Op op;                  /* for accumulate */
     /* Used to complete operations */
     struct MPID_Request *request;
     MPIDI_RMA_dtype_info dtype_info;
@@ -91,14 +91,14 @@ typedef struct MPIDI_RMA_Op {
 } MPIDI_RMA_Op_t;
 
 typedef struct MPIDI_PT_single_op {
-    int type;  /* put, get, or accum. */
+    int type;                   /* put, get, or accum. */
     void *addr;
     int count;
     MPI_Datatype datatype;
     MPI_Op op;
-    void *data;  /* for queued puts and accumulates, data is copied here */
-    MPI_Request request_handle;  /* for gets */
-    int data_recd;  /* to indicate if the data has been received */
+    void *data;                 /* for queued puts and accumulates, data is copied here */
+    MPI_Request request_handle; /* for gets */
+    int data_recd;              /* to indicate if the data has been received */
     MPIDI_CH3_Pkt_flags_t flags;
 } MPIDI_PT_single_op;
 
@@ -106,17 +106,17 @@ typedef struct MPIDI_Win_lock_queue {
     struct MPIDI_Win_lock_queue *next;
     int lock_type;
     MPI_Win source_win_handle;
-    MPIDI_VC_t * vc;
-    struct MPIDI_PT_single_op *pt_single_op;  /* to store info for 
-						 lock-put-unlock optimization */
+    MPIDI_VC_t *vc;
+    struct MPIDI_PT_single_op *pt_single_op;    /* to store info for
+                                                 * lock-put-unlock optimization */
 } MPIDI_Win_lock_queue;
 
 /* Routine use to tune RMA optimizations */
-void MPIDI_CH3_RMA_SetAccImmed( int flag );
+void MPIDI_CH3_RMA_SetAccImmed(int flag);
 
 /*** RMA OPS LIST HELPER ROUTINES ***/
 
-typedef MPIDI_RMA_Op_t * MPIDI_RMA_Ops_list_t;
+typedef MPIDI_RMA_Op_t *MPIDI_RMA_Ops_list_t;
 
 /* Return nonzero if the RMA operations list is empty.
  */
@@ -124,7 +124,7 @@ typedef MPIDI_RMA_Op_t * MPIDI_RMA_Ops_list_t;
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_isempty
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_RMA_Ops_isempty(MPIDI_RMA_Ops_list_t *list)
+static inline int MPIDI_CH3I_RMA_Ops_isempty(MPIDI_RMA_Ops_list_t * list)
 {
     return *list == NULL;
 }
@@ -136,7 +136,7 @@ static inline int MPIDI_CH3I_RMA_Ops_isempty(MPIDI_RMA_Ops_list_t *list)
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_head
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_head(MPIDI_RMA_Ops_list_t *list)
+static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_head(MPIDI_RMA_Ops_list_t * list)
 {
     return *list;
 }
@@ -148,7 +148,7 @@ static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_head(MPIDI_RMA_Ops_list_t *list
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_tail
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_tail(MPIDI_RMA_Ops_list_t *list)
+static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_tail(MPIDI_RMA_Ops_list_t * list)
 {
     return (*list) ? (*list)->prev : NULL;
 }
@@ -163,8 +163,7 @@ static inline MPIDI_RMA_Op_t *MPIDI_CH3I_RMA_Ops_tail(MPIDI_RMA_Ops_list_t *list
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_append
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline void MPIDI_CH3I_RMA_Ops_append(MPIDI_RMA_Ops_list_t *list,
-                                             MPIDI_RMA_Op_t *elem)
+static inline void MPIDI_CH3I_RMA_Ops_append(MPIDI_RMA_Ops_list_t * list, MPIDI_RMA_Op_t * elem)
 {
     MPL_DL_APPEND(*list, elem);
 }
@@ -180,8 +179,8 @@ static inline void MPIDI_CH3I_RMA_Ops_append(MPIDI_RMA_Ops_list_t *list,
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_alloc_tail
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_RMA_Ops_alloc_tail(MPIDI_RMA_Ops_list_t *list,
-                                                MPIDI_RMA_Op_t **new_elem)
+static inline int MPIDI_CH3I_RMA_Ops_alloc_tail(MPIDI_RMA_Ops_list_t * list,
+                                                MPIDI_RMA_Op_t ** new_elem)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_RMA_Op_t *tmp_ptr;
@@ -199,10 +198,10 @@ static inline int MPIDI_CH3I_RMA_Ops_alloc_tail(MPIDI_RMA_Ops_list_t *list,
 
     *new_elem = tmp_ptr;
 
- fn_exit:
+  fn_exit:
     MPIU_CHKPMEM_COMMIT();
     return mpi_errno;
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     *new_elem = NULL;
     goto fn_exit;
@@ -218,8 +217,7 @@ static inline int MPIDI_CH3I_RMA_Ops_alloc_tail(MPIDI_RMA_Ops_list_t *list,
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_unlink
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline void MPIDI_CH3I_RMA_Ops_unlink(MPIDI_RMA_Ops_list_t *list,
-                                             MPIDI_RMA_Op_t *elem)
+static inline void MPIDI_CH3I_RMA_Ops_unlink(MPIDI_RMA_Ops_list_t * list, MPIDI_RMA_Op_t * elem)
 {
     MPL_DL_DELETE(*list, elem);
 }
@@ -234,8 +232,8 @@ static inline void MPIDI_CH3I_RMA_Ops_unlink(MPIDI_RMA_Ops_list_t *list,
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_free_elem
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPIDI_RMA_Ops_list_t *list,
-                                                MPIDI_RMA_Op_t *curr_ptr)
+static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPIDI_RMA_Ops_list_t * list,
+                                                MPIDI_RMA_Op_t * curr_ptr)
 {
     MPIDI_RMA_Op_t *tmp_ptr = curr_ptr;
 
@@ -246,7 +244,7 @@ static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPIDI_RMA_Ops_list_t *list,
     /* Check if we allocated a dataloop for this op (see send/recv_rma_msg) */
     if (tmp_ptr->dataloop != NULL)
         MPIU_Free(tmp_ptr->dataloop);
-    MPIU_Free( tmp_ptr );
+    MPIU_Free(tmp_ptr);
 }
 
 
@@ -261,8 +259,8 @@ static inline void MPIDI_CH3I_RMA_Ops_free_elem(MPIDI_RMA_Ops_list_t *list,
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_free_and_next
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline void MPIDI_CH3I_RMA_Ops_free_and_next(MPIDI_RMA_Ops_list_t *list,
-                                                    MPIDI_RMA_Op_t **curr_ptr)
+static inline void MPIDI_CH3I_RMA_Ops_free_and_next(MPIDI_RMA_Ops_list_t * list,
+                                                    MPIDI_RMA_Op_t ** curr_ptr)
 {
     MPIDI_RMA_Op_t *next_ptr = (*curr_ptr)->next;
 
@@ -277,7 +275,7 @@ static inline void MPIDI_CH3I_RMA_Ops_free_and_next(MPIDI_RMA_Ops_list_t *list,
 #define FUNCNAME MPIDI_CH3I_RMA_Ops_free
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline void MPIDI_CH3I_RMA_Ops_free(MPIDI_RMA_Ops_list_t *list)
+static inline void MPIDI_CH3I_RMA_Ops_free(MPIDI_RMA_Ops_list_t * list)
 {
     MPIDI_RMA_Op_t *curr_ptr, *tmp_ptr;
 
@@ -296,13 +294,10 @@ static inline void MPIDI_CH3I_RMA_Ops_free(MPIDI_RMA_Ops_list_t *list)
 #define FUNCNAME MPIDI_CH3I_RMA_Get_ops_list
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline MPIDI_RMA_Ops_list_t *MPIDI_CH3I_RMA_Get_ops_list(MPID_Win *win_ptr,
-                                                                int target)
+static inline MPIDI_RMA_Ops_list_t *MPIDI_CH3I_RMA_Get_ops_list(MPID_Win * win_ptr, int target)
 {
     if (win_ptr->epoch_state == MPIDI_EPOCH_FENCE ||
-        win_ptr->epoch_state == MPIDI_EPOCH_START ||
-        win_ptr->epoch_state == MPIDI_EPOCH_PSCW)
-    {
+        win_ptr->epoch_state == MPIDI_EPOCH_START || win_ptr->epoch_state == MPIDI_EPOCH_PSCW) {
         return &win_ptr->at_rma_ops_list;
     }
     else {
@@ -347,203 +342,205 @@ static inline int shm_copy(const void *src, int scount, MPI_Datatype stype,
         /* The below list of datatypes is based on those specified in the MPI-3
          * standard on page 665. */
         switch (stype) {
-            case MPI_CHAR:
-                ASSIGN_COPY(src, dest, scount, char);
+        case MPI_CHAR:
+            ASSIGN_COPY(src, dest, scount, char);
 
-            case MPI_SHORT:
-                ASSIGN_COPY(src, dest, scount, signed short int);
+        case MPI_SHORT:
+            ASSIGN_COPY(src, dest, scount, signed short int);
 
-            case MPI_INT:
-                ASSIGN_COPY(src, dest, scount, signed int);
+        case MPI_INT:
+            ASSIGN_COPY(src, dest, scount, signed int);
 
-            case MPI_LONG:
-                ASSIGN_COPY(src, dest, scount, signed long int);
+        case MPI_LONG:
+            ASSIGN_COPY(src, dest, scount, signed long int);
 
-            case MPI_LONG_LONG_INT:  /* covers MPI_LONG_LONG too */
-                ASSIGN_COPY(src, dest, scount, signed long long int);
+        case MPI_LONG_LONG_INT:        /* covers MPI_LONG_LONG too */
+            ASSIGN_COPY(src, dest, scount, signed long long int);
 
-            case MPI_SIGNED_CHAR:
-                ASSIGN_COPY(src, dest, scount, signed char);
+        case MPI_SIGNED_CHAR:
+            ASSIGN_COPY(src, dest, scount, signed char);
 
-            case MPI_UNSIGNED_CHAR:
-                ASSIGN_COPY(src, dest, scount, unsigned char);
+        case MPI_UNSIGNED_CHAR:
+            ASSIGN_COPY(src, dest, scount, unsigned char);
 
-            case MPI_UNSIGNED_SHORT:
-                ASSIGN_COPY(src, dest, scount, unsigned short int);
+        case MPI_UNSIGNED_SHORT:
+            ASSIGN_COPY(src, dest, scount, unsigned short int);
 
-            case MPI_UNSIGNED:
-                ASSIGN_COPY(src, dest, scount, unsigned int);
+        case MPI_UNSIGNED:
+            ASSIGN_COPY(src, dest, scount, unsigned int);
 
-            case MPI_UNSIGNED_LONG:
-                ASSIGN_COPY(src, dest, scount, unsigned long int);
+        case MPI_UNSIGNED_LONG:
+            ASSIGN_COPY(src, dest, scount, unsigned long int);
 
-            case MPI_UNSIGNED_LONG_LONG:
-                ASSIGN_COPY(src, dest, scount, unsigned long long int);
+        case MPI_UNSIGNED_LONG_LONG:
+            ASSIGN_COPY(src, dest, scount, unsigned long long int);
 
-            case MPI_FLOAT:
-                ASSIGN_COPY(src, dest, scount, float);
+        case MPI_FLOAT:
+            ASSIGN_COPY(src, dest, scount, float);
 
-            case MPI_DOUBLE:
-                ASSIGN_COPY(src, dest, scount, double);
+        case MPI_DOUBLE:
+            ASSIGN_COPY(src, dest, scount, double);
 
-            case MPI_LONG_DOUBLE:
-                ASSIGN_COPY(src, dest, scount, long double);
+        case MPI_LONG_DOUBLE:
+            ASSIGN_COPY(src, dest, scount, long double);
 
 #if 0
             /* FIXME: we need a configure check to define HAVE_WCHAR_T before
              * this can be enabled */
-            case MPI_WCHAR:
-                ASSIGN_COPY(src, dest, scount, wchar_t);
+        case MPI_WCHAR:
+            ASSIGN_COPY(src, dest, scount, wchar_t);
 #endif
 
 #if 0
             /* FIXME: we need a configure check to define HAVE_C_BOOL before
              * this can be enabled */
-            case MPI_C_BOOL:
-                ASSIGN_COPY(src, dest, scount, _Bool);
+        case MPI_C_BOOL:
+            ASSIGN_COPY(src, dest, scount, _Bool);
 #endif
 
 #if HAVE_INT8_T
-            case MPI_INT8_T:
-                ASSIGN_COPY(src, dest, scount, int8_t);
+        case MPI_INT8_T:
+            ASSIGN_COPY(src, dest, scount, int8_t);
 #endif /* HAVE_INT8_T */
 
 #if HAVE_INT16_T
-            case MPI_INT16_T:
-                ASSIGN_COPY(src, dest, scount, int16_t);
+        case MPI_INT16_T:
+            ASSIGN_COPY(src, dest, scount, int16_t);
 #endif /* HAVE_INT16_T */
 
 #if HAVE_INT32_T
-            case MPI_INT32_T:
-                ASSIGN_COPY(src, dest, scount, int32_t);
+        case MPI_INT32_T:
+            ASSIGN_COPY(src, dest, scount, int32_t);
 #endif /* HAVE_INT32_T */
 
 #if HAVE_INT64_T
-            case MPI_INT64_T:
-                ASSIGN_COPY(src, dest, scount, int64_t);
+        case MPI_INT64_T:
+            ASSIGN_COPY(src, dest, scount, int64_t);
 #endif /* HAVE_INT64_T */
 
 #if HAVE_UINT8_T
-            case MPI_UINT8_T:
-                ASSIGN_COPY(src, dest, scount, uint8_t);
+        case MPI_UINT8_T:
+            ASSIGN_COPY(src, dest, scount, uint8_t);
 #endif /* HAVE_UINT8_T */
 
 #if HAVE_UINT16_T
-            case MPI_UINT16_T:
-                ASSIGN_COPY(src, dest, scount, uint16_t);
+        case MPI_UINT16_T:
+            ASSIGN_COPY(src, dest, scount, uint16_t);
 #endif /* HAVE_UINT16_T */
 
 #if HAVE_UINT32_T
-            case MPI_UINT32_T:
-                ASSIGN_COPY(src, dest, scount, uint32_t);
+        case MPI_UINT32_T:
+            ASSIGN_COPY(src, dest, scount, uint32_t);
 #endif /* HAVE_UINT32_T */
 
 #if HAVE_UINT64_T
-            case MPI_UINT64_T:
-                ASSIGN_COPY(src, dest, scount, uint64_t);
+        case MPI_UINT64_T:
+            ASSIGN_COPY(src, dest, scount, uint64_t);
 #endif /* HAVE_UINT64_T */
 
-            case MPI_AINT:
-                ASSIGN_COPY(src, dest, scount, MPI_Aint);
+        case MPI_AINT:
+            ASSIGN_COPY(src, dest, scount, MPI_Aint);
 
-            case MPI_COUNT:
-                ASSIGN_COPY(src, dest, scount, MPI_Count);
+        case MPI_COUNT:
+            ASSIGN_COPY(src, dest, scount, MPI_Count);
 
-            case MPI_OFFSET:
-                ASSIGN_COPY(src, dest, scount, MPI_Offset);
+        case MPI_OFFSET:
+            ASSIGN_COPY(src, dest, scount, MPI_Offset);
 
 #if 0
             /* FIXME: we need a configure check to define HAVE_C_COMPLEX before
              * this can be enabled */
-            case MPI_C_COMPLEX:  /* covers MPI_C_FLOAT_COMPLEX as well */
-                ASSIGN_COPY(src, dest, scount, float _Complex);
+        case MPI_C_COMPLEX:    /* covers MPI_C_FLOAT_COMPLEX as well */
+            ASSIGN_COPY(src, dest, scount, float _Complex);
 #endif
 
 #if 0
             /* FIXME: we need a configure check to define HAVE_C_DOUPLE_COMPLEX
              * before this can be enabled */
-            case MPI_C_DOUBLE_COMPLEX:
-                ASSIGN_COPY(src, dest, scount, double _Complex);
+        case MPI_C_DOUBLE_COMPLEX:
+            ASSIGN_COPY(src, dest, scount, double _Complex);
 #endif
 
 #if 0
             /* FIXME: we need a configure check to define
              * HAVE_C_LONG_DOUPLE_COMPLEX before this can be enabled */
-            case MPI_C_LONG_DOUBLE_COMPLEX:
-                ASSIGN_COPY(src, dest, scount, long double _Complex);
+        case MPI_C_LONG_DOUBLE_COMPLEX:
+            ASSIGN_COPY(src, dest, scount, long double _Complex);
 #endif
 
 #if 0
             /* Types that don't have a direct equivalent */
-            case MPI_BYTE:
-            case MPI_PACKED:
+        case MPI_BYTE:
+        case MPI_PACKED:
 #endif
 
-#if 0 /* Fortran types */
-            case MPI_INTEGER:
-            case MPI_REAL:
-            case MPI_DOUBLE_PRECISION:
-            case MPI_COMPLEX:
-            case MPI_LOGICAL:
-            case MPI_CHARACTER:
+#if 0   /* Fortran types */
+        case MPI_INTEGER:
+        case MPI_REAL:
+        case MPI_DOUBLE_PRECISION:
+        case MPI_COMPLEX:
+        case MPI_LOGICAL:
+        case MPI_CHARACTER:
 #endif
 
-#if 0 /* C++ types */
-            case MPI_CXX_BOOL:
-            case MPI_CXX_FLOAT_COMPLEX:
-            case MPI_CXX_DOUBLE_COMPLEX:
-            case MPI_CXX_LONG_DOUBLE_COMPLEX:
+#if 0   /* C++ types */
+        case MPI_CXX_BOOL:
+        case MPI_CXX_FLOAT_COMPLEX:
+        case MPI_CXX_DOUBLE_COMPLEX:
+        case MPI_CXX_LONG_DOUBLE_COMPLEX:
 #endif
 
-#if 0 /* Optional Fortran types */
-            case MPI_DOUBLE_COMPLEX:
-            case MPI_INTEGER1:
-            case MPI_INTEGER2:
-            case MPI_INTEGER4:
-            case MPI_INTEGER8:
-            case MPI_INTEGER16:
-            case MPI_REAL2:
-            case MPI_REAL4:
-            case MPI_REAL8:
-            case MPI_REAL16:
-            case MPI_COMPLEX4:
-            case MPI_COMPLEX8:
-            case MPI_COMPLEX16:
-            case MPI_COMPLEX32:
+#if 0   /* Optional Fortran types */
+        case MPI_DOUBLE_COMPLEX:
+        case MPI_INTEGER1:
+        case MPI_INTEGER2:
+        case MPI_INTEGER4:
+        case MPI_INTEGER8:
+        case MPI_INTEGER16:
+        case MPI_REAL2:
+        case MPI_REAL4:
+        case MPI_REAL8:
+        case MPI_REAL16:
+        case MPI_COMPLEX4:
+        case MPI_COMPLEX8:
+        case MPI_COMPLEX16:
+        case MPI_COMPLEX32:
 #endif
 
-#if 0 /* C datatypes for reduction functions */
-            case MPI_FLOAT_INT:
-            case MPI_DOUBLE_INT:
-            case MPI_LONG_INT:
-            case MPI_2INT:
-            case MPI_LONG_DOUBLE_INT:
+#if 0   /* C datatypes for reduction functions */
+        case MPI_FLOAT_INT:
+        case MPI_DOUBLE_INT:
+        case MPI_LONG_INT:
+        case MPI_2INT:
+        case MPI_LONG_DOUBLE_INT:
 #endif
 
-#if 0 /* Fortran datatypes for reduction functions */
-            case MPI_2REAL:
-            case MPI_2DOUBLE_PRECISION:
-            case MPI_2INTEGER:
+#if 0   /* Fortran datatypes for reduction functions */
+        case MPI_2REAL:
+        case MPI_2DOUBLE_PRECISION:
+        case MPI_2INTEGER:
 #endif
 
-#if 0 /* Random types not present in the standard */
-            case MPI_2COMPLEX:
-            case MPI_2DOUBLE_COMPLEX:
+#if 0   /* Random types not present in the standard */
+        case MPI_2COMPLEX:
+        case MPI_2DOUBLE_COMPLEX:
 #endif
 
-            default:
-                /* Just to make sure the switch statement is not empty */
-                ;
+        default:
+            /* Just to make sure the switch statement is not empty */
+            ;
         }
     }
 
     mpi_errno = MPIR_Localcopy(src, scount, stype, dest, dcount, dtype);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -555,7 +552,7 @@ static inline int shm_copy(const void *src, int scount, MPI_Datatype stype,
 static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_count, MPI_Datatype
                                         origin_datatype, int target_rank, MPI_Aint target_disp,
                                         int target_count, MPI_Datatype target_datatype,
-                                        MPID_Win *win_ptr)
+                                        MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     void *base = NULL;
@@ -575,13 +572,15 @@ static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_coun
 
     mpi_errno = shm_copy(origin_addr, origin_count, origin_datatype,
                          (char *) base + disp_unit * target_disp, target_count, target_datatype);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_PUT_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -594,7 +593,7 @@ static inline int MPIDI_CH3I_Shm_put_op(const void *origin_addr, int origin_coun
 static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_count, MPI_Datatype
                                         origin_datatype, int target_rank, MPI_Aint target_disp,
                                         int target_count, MPI_Datatype target_datatype, MPI_Op op,
-                                        MPID_Win *win_ptr)
+                                        MPID_Win * win_ptr)
 {
     void *base = NULL;
     int disp_unit, shm_op = 0;
@@ -616,34 +615,38 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         disp_unit = win_ptr->disp_unit;
     }
 
-    if (op == MPI_REPLACE)
-    {
-        if (shm_op) MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
+    if (op == MPI_REPLACE) {
+        if (shm_op)
+            MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
         mpi_errno = shm_copy(origin_addr, origin_count, origin_datatype,
-                             (char *) base + disp_unit * target_disp, target_count, target_datatype);
-        if (shm_op) MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                             (char *) base + disp_unit * target_disp, target_count,
+                             target_datatype);
+        if (shm_op)
+            MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
         goto fn_exit;
     }
 
     MPIU_ERR_CHKANDJUMP1((HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN),
-                         mpi_errno, MPI_ERR_OP, "**opnotpredefined",
-                         "**opnotpredefined %d", op );
+                         mpi_errno, MPI_ERR_OP, "**opnotpredefined", "**opnotpredefined %d", op);
 
     /* get the function by indexing into the op table */
     uop = MPIR_OP_HDL_TO_FN(op);
 
-    if (MPIR_DATATYPE_IS_PREDEFINED(origin_datatype) && MPIR_DATATYPE_IS_PREDEFINED(target_datatype))
-    {
+    if (MPIR_DATATYPE_IS_PREDEFINED(origin_datatype) &&
+        MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
         /* Cast away const'ness for origin_address in order to
          * avoid changing the prototype for MPI_User_function */
-        if (shm_op) MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
-        (*uop)((void *) origin_addr, (char *) base + disp_unit*target_disp,
-               &target_count, &target_datatype);
-        if (shm_op) MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+        if (shm_op)
+            MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
+        (*uop) ((void *) origin_addr, (char *) base + disp_unit * target_disp,
+                &target_count, &target_datatype);
+        if (shm_op)
+            MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     }
-    else
-    {
+    else {
         /* derived datatype */
 
         MPID_Segment *segp;
@@ -652,82 +655,85 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
         int vec_len, i, type_size, count;
         MPI_Datatype type;
         MPI_Aint true_lb, true_extent, extent;
-        void *tmp_buf=NULL, *target_buf;
+        void *tmp_buf = NULL, *target_buf;
         const void *source_buf;
 
-        if (origin_datatype != target_datatype)
-        {
+        if (origin_datatype != target_datatype) {
             /* first copy the data into a temporary buffer with
-               the same datatype as the target. Then do the
-               accumulate operation. */
+             * the same datatype as the target. Then do the
+             * accumulate operation. */
 
             MPIR_Type_get_true_extent_impl(target_datatype, &true_lb, &true_extent);
             MPID_Datatype_get_extent_macro(target_datatype, extent);
 
             MPIU_CHKLMEM_MALLOC(tmp_buf, void *,
-                                target_count * (MPIR_MAX(extent,true_extent)),
+                                target_count * (MPIR_MAX(extent, true_extent)),
                                 mpi_errno, "temporary buffer");
             /* adjust for potential negative lower bound in datatype */
-            tmp_buf = (void *)((char*)tmp_buf - true_lb);
+            tmp_buf = (void *) ((char *) tmp_buf - true_lb);
 
             mpi_errno = MPIR_Localcopy(origin_addr, origin_count,
-                                       origin_datatype, tmp_buf,
-                                       target_count, target_datatype);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                                       origin_datatype, tmp_buf, target_count, target_datatype);
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
 
         if (MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
             /* target predefined type, origin derived datatype */
 
-            if (shm_op) MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
-            (*uop)(tmp_buf, (char *) base + disp_unit * target_disp,
-                   &target_count, &target_datatype);
-            if (shm_op) MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+            if (shm_op)
+                MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
+            (*uop) (tmp_buf, (char *) base + disp_unit * target_disp,
+                    &target_count, &target_datatype);
+            if (shm_op)
+                MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         }
         else {
 
             segp = MPID_Segment_alloc();
             MPIU_ERR_CHKANDJUMP1((!segp), mpi_errno, MPI_ERR_OTHER,
-                                 "**nomem","**nomem %s","MPID_Segment_alloc");
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(NULL, target_count, target_datatype, segp, 0);
             first = 0;
-            last  = SEGMENT_IGNORE_LAST;
+            last = SEGMENT_IGNORE_LAST;
 
             MPID_Datatype_get_ptr(target_datatype, dtp);
             vec_len = dtp->max_contig_blocks * target_count + 1;
             /* +1 needed because Rob says so */
             MPIU_CHKLMEM_MALLOC(dloop_vec, DLOOP_VECTOR *,
-                                vec_len * sizeof(DLOOP_VECTOR),
-                                mpi_errno, "dloop vector");
+                                vec_len * sizeof(DLOOP_VECTOR), mpi_errno, "dloop vector");
 
             MPID_Segment_pack_vector(segp, first, &last, dloop_vec, &vec_len);
 
-            source_buf = (tmp_buf != NULL) ? (const void *)tmp_buf : origin_addr;
+            source_buf = (tmp_buf != NULL) ? (const void *) tmp_buf : origin_addr;
             target_buf = (char *) base + disp_unit * target_disp;
             type = dtp->eltype;
             type_size = MPID_Datatype_get_basic_size(type);
-            if (shm_op) MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
-            for (i=0; i<vec_len; i++)
-            {
-		MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
-
-                (*uop)((char *)source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
-                       (char *)target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
-                       &count, &type);
+            if (shm_op)
+                MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
+            for (i = 0; i < vec_len; i++) {
+                MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN) / type_size, int);
+
+                (*uop) ((char *) source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+                        (char *) target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+                        &count, &type);
             }
-            if (shm_op) MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+            if (shm_op)
+                MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
             MPID_Segment_free(segp);
         }
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_ACC_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
-    if (shm_op) MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
+  fn_fail:
+    if (shm_op)
+        MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -740,8 +746,9 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
 static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_count, MPI_Datatype
                                             origin_datatype, void *result_addr, int result_count,
                                             MPI_Datatype result_datatype, int target_rank, MPI_Aint
-                                            target_disp, int target_count, MPI_Datatype target_datatype,
-                                            MPI_Op op, MPID_Win *win_ptr)
+                                            target_disp, int target_count,
+                                            MPI_Datatype target_datatype, MPI_Op op,
+                                            MPID_Win * win_ptr)
 {
     int disp_unit, shm_locked = 0;
     void *base = NULL;
@@ -767,7 +774,9 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
     /* Perform the local get first, then the accumulate */
     mpi_errno = shm_copy((char *) base + disp_unit * target_disp, target_count, target_datatype,
                          result_addr, result_count, result_datatype);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
     /* NO_OP: Don't perform the accumulate */
     if (op == MPI_NO_OP) {
@@ -781,9 +790,12 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
 
     if (op == MPI_REPLACE) {
         mpi_errno = shm_copy(origin_addr, origin_count, origin_datatype,
-                             (char *) base + disp_unit * target_disp, target_count, target_datatype);
+                             (char *) base + disp_unit * target_disp, target_count,
+                             target_datatype);
 
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         if (shm_locked) {
             MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
@@ -794,8 +806,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
     }
 
     MPIU_ERR_CHKANDJUMP1((HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN),
-                          mpi_errno, MPI_ERR_OP, "**opnotpredefined",
-                          "**opnotpredefined %d", op );
+                         mpi_errno, MPI_ERR_OP, "**opnotpredefined", "**opnotpredefined %d", op);
 
     /* get the function by indexing into the op table */
     uop = MPIR_OP_HDL_TO_FN(op);
@@ -804,8 +815,8 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
         /* Cast away const'ness for origin_address in order to
          * avoid changing the prototype for MPI_User_function */
-        (*uop)((void *) origin_addr, (char *) base + disp_unit*target_disp,
-               &target_count, &target_datatype);
+        (*uop) ((void *) origin_addr, (char *) base + disp_unit * target_disp,
+                &target_count, &target_datatype);
     }
     else {
         /* derived datatype */
@@ -816,63 +827,63 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         int vec_len, i, type_size, count;
         MPI_Datatype type;
         MPI_Aint true_lb, true_extent, extent;
-        void *tmp_buf=NULL, *target_buf;
+        void *tmp_buf = NULL, *target_buf;
         const void *source_buf;
 
         if (origin_datatype != target_datatype) {
             /* first copy the data into a temporary buffer with
-               the same datatype as the target. Then do the
-               accumulate operation. */
+             * the same datatype as the target. Then do the
+             * accumulate operation. */
 
             MPIR_Type_get_true_extent_impl(target_datatype, &true_lb, &true_extent);
             MPID_Datatype_get_extent_macro(target_datatype, extent);
 
             MPIU_CHKLMEM_MALLOC(tmp_buf, void *,
-                                target_count * (MPIR_MAX(extent,true_extent)),
+                                target_count * (MPIR_MAX(extent, true_extent)),
                                 mpi_errno, "temporary buffer");
             /* adjust for potential negative lower bound in datatype */
-            tmp_buf = (void *)((char*)tmp_buf - true_lb);
+            tmp_buf = (void *) ((char *) tmp_buf - true_lb);
 
             mpi_errno = MPIR_Localcopy(origin_addr, origin_count,
-                                       origin_datatype, tmp_buf,
-                                       target_count, target_datatype);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                                       origin_datatype, tmp_buf, target_count, target_datatype);
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
 
         if (MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
             /* target predefined type, origin derived datatype */
 
-            (*uop)(tmp_buf, (char *) base + disp_unit * target_disp,
-                   &target_count, &target_datatype);
+            (*uop) (tmp_buf, (char *) base + disp_unit * target_disp,
+                    &target_count, &target_datatype);
         }
         else {
 
             segp = MPID_Segment_alloc();
             MPIU_ERR_CHKANDJUMP1((!segp), mpi_errno, MPI_ERR_OTHER,
-                                 "**nomem","**nomem %s","MPID_Segment_alloc");
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
             MPID_Segment_init(NULL, target_count, target_datatype, segp, 0);
             first = 0;
-            last  = SEGMENT_IGNORE_LAST;
+            last = SEGMENT_IGNORE_LAST;
 
             MPID_Datatype_get_ptr(target_datatype, dtp);
             vec_len = dtp->max_contig_blocks * target_count + 1;
             /* +1 needed because Rob says so */
             MPIU_CHKLMEM_MALLOC(dloop_vec, DLOOP_VECTOR *,
-                                vec_len * sizeof(DLOOP_VECTOR),
-                                mpi_errno, "dloop vector");
+                                vec_len * sizeof(DLOOP_VECTOR), mpi_errno, "dloop vector");
 
             MPID_Segment_pack_vector(segp, first, &last, dloop_vec, &vec_len);
 
-            source_buf = (tmp_buf != NULL) ? (const void *)tmp_buf : origin_addr;
+            source_buf = (tmp_buf != NULL) ? (const void *) tmp_buf : origin_addr;
             target_buf = (char *) base + disp_unit * target_disp;
             type = dtp->eltype;
             type_size = MPID_Datatype_get_basic_size(type);
 
-            for (i=0; i<vec_len; i++) {
-		MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
-                (*uop)((char *)source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
-                       (char *)target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
-                       &count, &type);
+            for (i = 0; i < vec_len; i++) {
+                MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN) / type_size, int);
+                (*uop) ((char *) source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+                        (char *) target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
+                        &count, &type);
             }
 
             MPID_Segment_free(segp);
@@ -884,12 +895,12 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
         shm_locked = 0;
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_GET_ACC_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     if (shm_locked) {
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     }
@@ -902,9 +913,10 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
 #define FUNCNAME MPIDI_CH3I_Shm_get_op
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
-                                        int target_rank, MPI_Aint target_disp, int target_count,
-                                        MPI_Datatype target_datatype, MPID_Win *win_ptr)
+static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count,
+                                        MPI_Datatype origin_datatype, int target_rank,
+                                        MPI_Aint target_disp, int target_count,
+                                        MPI_Datatype target_datatype, MPID_Win * win_ptr)
 {
     void *base = NULL;
     int disp_unit;
@@ -924,13 +936,15 @@ static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count, MPI
 
     mpi_errno = shm_copy((char *) base + disp_unit * target_disp, target_count, target_datatype,
                          origin_addr, origin_count, origin_datatype);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_GET_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -942,7 +956,7 @@ static inline int MPIDI_CH3I_Shm_get_op(void *origin_addr, int origin_count, MPI
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *compare_addr,
                                         void *result_addr, MPI_Datatype datatype, int target_rank,
-                                        MPI_Aint target_disp, MPID_Win *win_ptr)
+                                        MPI_Aint target_disp, MPID_Win * win_ptr)
 {
     void *base = NULL, *dest_addr = NULL;
     int disp_unit;
@@ -979,11 +993,11 @@ static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *com
         shm_locked = 0;
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_CAS_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     if (shm_locked) {
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     }
@@ -998,7 +1012,7 @@ static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *com
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 static inline int MPIDI_CH3I_Shm_fop_op(const void *origin_addr, void *result_addr,
                                         MPI_Datatype datatype, int target_rank,
-                                        MPI_Aint target_disp, MPI_Op op, MPID_Win *win_ptr)
+                                        MPI_Aint target_disp, MPI_Op op, MPID_Win * win_ptr)
 {
     void *base = NULL, *dest_addr = NULL;
     MPI_User_function *uop = NULL;
@@ -1030,18 +1044,18 @@ static inline int MPIDI_CH3I_Shm_fop_op(const void *origin_addr, void *result_ad
     uop = MPIR_OP_HDL_TO_FN(op);
     one = 1;
 
-    (*uop)((void *) origin_addr, dest_addr, &one, &datatype);
+    (*uop) ((void *) origin_addr, dest_addr, &one, &datatype);
 
     if (shm_locked) {
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
         shm_locked = 0;
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SHM_FOP_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     if (shm_locked) {
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
     }
@@ -1054,7 +1068,7 @@ static inline int MPIDI_CH3I_Shm_fop_op(const void *origin_addr, void *result_ad
 #define FUNCNAME MPIDI_CH3I_Wait_for_pt_ops_finish
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static inline int MPIDI_CH3I_Wait_for_pt_ops_finish(MPID_Win *win_ptr)
+static inline int MPIDI_CH3I_Wait_for_pt_ops_finish(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS, total_pt_rma_puts_accs;
     MPID_Comm *comm_ptr;
@@ -1068,36 +1082,35 @@ static inline int MPIDI_CH3I_Wait_for_pt_ops_finish(MPID_Win *win_ptr)
     mpi_errno = MPIR_Reduce_scatter_block_impl(win_ptr->pt_rma_puts_accs,
                                                &total_pt_rma_puts_accs, 1,
                                                MPI_INT, MPI_SUM, comm_ptr, &errflag);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
     MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
     MPIR_T_PVAR_TIMER_END(RMA, rma_winfree_rs);
 
-    if (total_pt_rma_puts_accs != win_ptr->my_pt_rma_puts_accs)
-    {
-	MPID_Progress_state progress_state;
-
-	/* poke the progress engine until the two are equal */
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winfree_complete);
-	MPID_Progress_start(&progress_state);
-	while (total_pt_rma_puts_accs != win_ptr->my_pt_rma_puts_accs)
-	{
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS)
-	    {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-	    }
-	    /* --END ERROR HANDLING-- */
-	}
-	MPID_Progress_end(&progress_state);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winfree_complete);
+    if (total_pt_rma_puts_accs != win_ptr->my_pt_rma_puts_accs) {
+        MPID_Progress_state progress_state;
+
+        /* poke the progress engine until the two are equal */
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winfree_complete);
+        MPID_Progress_start(&progress_state);
+        while (total_pt_rma_puts_accs != win_ptr->my_pt_rma_puts_accs) {
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+            }
+            /* --END ERROR HANDLING-- */
+        }
+        MPID_Progress_end(&progress_state);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winfree_complete);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_WAIT_FOR_PT_OPS_FINISH);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
diff --git a/src/mpid/ch3/src/ch3u_rma_acc_ops.c b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
index b0b5e54..a7edf6a 100644
--- a/src/mpid/ch3/src/ch3u_rma_acc_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_acc_ops.c
@@ -16,7 +16,8 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
 int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
                          MPI_Datatype origin_datatype, void *result_addr, int result_count,
                          MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
-                         int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win_ptr)
+                         int target_count, MPI_Datatype target_datatype, MPI_Op op,
+                         MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_msg_sz_t data_sz;
@@ -40,8 +41,7 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIDI_Datatype_get_info(target_count, target_datatype, dt_contig, data_sz,
-                            dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(target_count, target_datatype, dt_contig, data_sz, dtp, dt_true_lb);
 
     if (data_sz == 0) {
         goto fn_exit;
@@ -49,29 +49,30 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
 
     rank = win_ptr->comm_ptr->rank;
 
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
 
     /* Do =! rank first (most likely branch?) */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
         mpi_errno = MPIDI_CH3I_Shm_get_acc_op(origin_addr, origin_count, origin_datatype,
                                               result_addr, result_count, result_datatype,
-                                              target_rank, target_disp, target_count, target_datatype,
-                                              op, win_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                                              target_rank, target_disp, target_count,
+                                              target_datatype, op, win_ptr);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
     else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
@@ -81,7 +82,9 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         /* TODO: Can we use the MPIDI_RMA_ACC_CONTIG optimization? */
 
@@ -103,7 +106,7 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
 
         /* if source or target datatypes are derived, increment their
-           reference counts */
+         * reference counts */
         if (op != MPI_NO_OP && !MPIR_DATATYPE_IS_PREDEFINED(origin_datatype)) {
             MPID_Datatype_get_ptr(origin_datatype, dtp);
             MPID_Datatype_add_ref(dtp);
@@ -118,7 +121,7 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
         }
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_GET_ACCUMULATE);
     return mpi_errno;
 
@@ -134,8 +137,8 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
-                          void *result_addr, MPI_Datatype datatype, int target_rank,
-                          MPI_Aint target_disp, MPID_Win *win_ptr)
+                           void *result_addr, MPI_Datatype datatype, int target_rank,
+                           MPI_Aint target_disp, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int rank;
@@ -157,16 +160,17 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
 
     rank = win_ptr->comm_ptr->rank;
 
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
@@ -178,11 +182,11 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
     /* FIXME: For shared memory windows, we should provide an implementation
      * that uses a processor atomic operation. */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
         mpi_errno = MPIDI_CH3I_Shm_cas_op(origin_addr, compare_addr, result_addr,
                                           datatype, target_rank, target_disp, win_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
     else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
@@ -192,7 +196,9 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
         new_ptr->type = MPIDI_RMA_COMPARE_AND_SWAP;
@@ -212,11 +218,11 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_COMPARE_AND_SWAP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -228,7 +234,7 @@ fn_fail:
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
                        MPI_Datatype datatype, int target_rank,
-                       MPI_Aint target_disp, MPI_Op op, MPID_Win *win_ptr)
+                       MPI_Aint target_disp, MPI_Op op, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int rank;
@@ -250,16 +256,17 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
 
     rank = win_ptr->comm_ptr->rank;
 
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
@@ -270,11 +277,11 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
     /* FIXME: For shared memory windows, we should provide an implementation
      * that uses a processor atomic operation. */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
         mpi_errno = MPIDI_CH3I_Shm_fop_op(origin_addr, result_addr, datatype,
                                           target_rank, target_disp, op, win_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
     else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
@@ -284,7 +291,9 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
         new_ptr->type = MPIDI_RMA_FETCH_AND_OP;
@@ -302,11 +311,11 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_FETCH_AND_OP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c
index f30c464..3d4e273 100644
--- a/src/mpid/ch3/src/ch3u_rma_ops.c
+++ b/src/mpid/ch3/src/ch3u_rma_ops.c
@@ -6,7 +6,7 @@
 
 #include "mpidrma.h"
 
-static int enableShortACC=1;
+static int enableShortACC = 1;
 
 MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
 MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
@@ -14,7 +14,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
 #define MPIDI_PASSIVE_TARGET_DONE_TAG  348297
 #define MPIDI_PASSIVE_TARGET_RMA_TAG 563924
 
-/* 
+/*
  * TODO:
  * Explore use of alternate allocation mechanisms for the RMA queue elements
  * (Because profiling has shown that queue element allocation/deallocation
@@ -35,24 +35,26 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
 #define FUNCNAME MPIDI_Win_free
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_free(MPID_Win **win_ptr)
+int MPIDI_Win_free(MPID_Win ** win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     int in_use;
     MPID_Comm *comm_ptr;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_FREE);
-        
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_FREE);
 
     MPIU_ERR_CHKANDJUMP((*win_ptr)->epoch_state != MPIDI_EPOCH_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     mpi_errno = MPIDI_CH3I_Wait_for_pt_ops_finish(*win_ptr);
-    if(mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     comm_ptr = (*win_ptr)->comm_ptr;
     mpi_errno = MPIR_Comm_free_impl(comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     MPIU_Free((*win_ptr)->targets);
     MPIU_Free((*win_ptr)->base_addrs);
@@ -62,7 +64,8 @@ int MPIDI_Win_free(MPID_Win **win_ptr)
     MPIU_Free((*win_ptr)->pt_rma_puts_accs);
 
     /* Free the attached buffer for windows created with MPI_Win_allocate() */
-    if ((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_ALLOCATE || (*win_ptr)->create_flavor == MPI_WIN_FLAVOR_SHARED) {
+    if ((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_ALLOCATE ||
+        (*win_ptr)->create_flavor == MPI_WIN_FLAVOR_SHARED) {
         if ((*win_ptr)->shm_allocated == FALSE && (*win_ptr)->size > 0) {
             MPIU_Free((*win_ptr)->base);
         }
@@ -71,13 +74,13 @@ int MPIDI_Win_free(MPID_Win **win_ptr)
     MPIU_Object_release_ref(*win_ptr, &in_use);
     /* MPI windows don't have reference count semantics, so this should always be true */
     MPIU_Assert(!in_use);
-    MPIU_Handle_obj_free( &MPID_Win_mem, *win_ptr );
+    MPIU_Handle_obj_free(&MPID_Win_mem, *win_ptr);
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FREE);
     return mpi_errno;
 
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -86,7 +89,7 @@ int MPIDI_Win_free(MPID_Win **win_ptr)
 #define FUNCNAME MPIDI_Win_shared_query
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_shared_query(MPID_Win *win_ptr, int target_rank, MPI_Aint *size,
+int MPIDI_Win_shared_query(MPID_Win * win_ptr, int target_rank, MPI_Aint * size,
                            int *disp_unit, void *baseptr)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -94,15 +97,15 @@ int MPIDI_Win_shared_query(MPID_Win *win_ptr, int target_rank, MPI_Aint *size,
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_SHARED_QUERY);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_SHARED_QUERY);
 
-    *(void**) baseptr = win_ptr->base;
-    *size             = win_ptr->size;
-    *disp_unit        = win_ptr->disp_unit;
+    *(void **) baseptr = win_ptr->base;
+    *size = win_ptr->size;
+    *disp_unit = win_ptr->disp_unit;
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_SHARED_QUERY);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -113,8 +116,8 @@ int MPIDI_Win_shared_query(MPID_Win *win_ptr, int target_rank, MPI_Aint *size,
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
-            origin_datatype, int target_rank, MPI_Aint target_disp,
-            int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr)
+              origin_datatype, int target_rank, MPI_Aint target_disp,
+              int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int dt_contig ATTRIBUTE((unused)), rank;
@@ -123,7 +126,7 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
     MPIDI_msg_sz_t data_sz;
     MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_PUT);
-        
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_PUT);
 
     if (target_rank == MPI_PROC_NULL) {
@@ -137,79 +140,78 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-			    dt_contig, data_sz, dtp,dt_true_lb); 
-    
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
+
     if (data_sz == 0) {
-	goto fn_exit;
+        goto fn_exit;
     }
 
     rank = win_ptr->comm_ptr->rank;
-    
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
 
     /* If the put is a local operation, do it here */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
         mpi_errno = MPIDI_CH3I_Shm_put_op(origin_addr, origin_count, origin_datatype, target_rank,
                                           target_disp, target_count, target_datatype, win_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
-    else
-    {
+    else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
         MPIDI_RMA_Op_t *new_ptr = NULL;
 
-	/* queue it up */
+        /* queue it up */
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
-	MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
-	/* FIXME: For contig and very short operations, use a streamlined op */
-	new_ptr->type = MPIDI_RMA_PUT;
+        MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
+        /* FIXME: For contig and very short operations, use a streamlined op */
+        new_ptr->type = MPIDI_RMA_PUT;
         /* Cast away const'ness for the origin address, as the
          * MPIDI_RMA_Op_t structure is used for both PUT and GET like
          * operations */
-	new_ptr->origin_addr = (void *) origin_addr;
-	new_ptr->origin_count = origin_count;
-	new_ptr->origin_datatype = origin_datatype;
-	new_ptr->target_rank = target_rank;
-	new_ptr->target_disp = target_disp;
-	new_ptr->target_count = target_count;
-	new_ptr->target_datatype = target_datatype;
-	MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
-
-	/* if source or target datatypes are derived, increment their
-	   reference counts */
-	if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype))
-	{
-	    MPID_Datatype_get_ptr(origin_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
-	if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype))
-	{
-	    MPID_Datatype_get_ptr(target_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
+        new_ptr->origin_addr = (void *) origin_addr;
+        new_ptr->origin_count = origin_count;
+        new_ptr->origin_datatype = origin_datatype;
+        new_ptr->target_rank = target_rank;
+        new_ptr->target_disp = target_disp;
+        new_ptr->target_count = target_count;
+        new_ptr->target_datatype = target_datatype;
+        MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
+
+        /* if source or target datatypes are derived, increment their
+         * reference counts */
+        if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype)) {
+            MPID_Datatype_get_ptr(origin_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
+        if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
+            MPID_Datatype_get_ptr(target_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
     }
 
   fn_exit:
-    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_PUT);    
+    MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_PUT);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
@@ -225,8 +227,8 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
-            origin_datatype, int target_rank, MPI_Aint target_disp,
-            int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr)
+              origin_datatype, int target_rank, MPI_Aint target_disp,
+              int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_msg_sz_t data_sz;
@@ -235,7 +237,7 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
     MPID_Datatype *dtp;
     MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_GET);
-        
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET);
 
     if (target_rank == MPI_PROC_NULL) {
@@ -249,72 +251,71 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-			    dt_contig, data_sz, dtp, dt_true_lb); 
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
 
     if (data_sz == 0) {
-	goto fn_exit;
+        goto fn_exit;
     }
 
     rank = win_ptr->comm_ptr->rank;
 
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
-    
+
     /* If the get is a local operation, do it here */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
         mpi_errno = MPIDI_CH3I_Shm_get_op(origin_addr, origin_count, origin_datatype, target_rank,
                                           target_disp, target_count, target_datatype, win_ptr);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
-    else
-    {
+    else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
         MPIDI_RMA_Op_t *new_ptr = NULL;
 
-	/* queue it up */
+        /* queue it up */
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
-
-	MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
-	/* FIXME: For contig and very short operations, use a streamlined op */
-	new_ptr->type = MPIDI_RMA_GET;
-	new_ptr->origin_addr = origin_addr;
-	new_ptr->origin_count = origin_count;
-	new_ptr->origin_datatype = origin_datatype;
-	new_ptr->target_rank = target_rank;
-	new_ptr->target_disp = target_disp;
-	new_ptr->target_count = target_count;
-	new_ptr->target_datatype = target_datatype;
-	MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
-	
-	/* if source or target datatypes are derived, increment their
-	   reference counts */
-	if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype))
-	{
-	    MPID_Datatype_get_ptr(origin_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
-	if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype))
-	{
-	    MPID_Datatype_get_ptr(target_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
+        /* FIXME: For contig and very short operations, use a streamlined op */
+        new_ptr->type = MPIDI_RMA_GET;
+        new_ptr->origin_addr = origin_addr;
+        new_ptr->origin_count = origin_count;
+        new_ptr->origin_datatype = origin_datatype;
+        new_ptr->target_rank = target_rank;
+        new_ptr->target_disp = target_disp;
+        new_ptr->target_count = target_count;
+        new_ptr->target_datatype = target_datatype;
+        MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
+
+        /* if source or target datatypes are derived, increment their
+         * reference counts */
+        if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype)) {
+            MPID_Datatype_get_ptr(origin_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
+        if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
+            MPID_Datatype_get_ptr(target_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
     }
 
   fn_exit:
@@ -334,18 +335,17 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
-                    origin_datatype, int target_rank, MPI_Aint target_disp,
-                    int target_count, MPI_Datatype target_datatype, MPI_Op op,
-                    MPID_Win *win_ptr)
+                     origin_datatype, int target_rank, MPI_Aint target_disp,
+                     int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win * win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     MPIDI_msg_sz_t data_sz;
     int dt_contig ATTRIBUTE((unused)), rank;
     MPI_Aint dt_true_lb ATTRIBUTE((unused));
     MPID_Datatype *dtp;
     MPIDI_VC_t *orig_vc = NULL, *target_vc = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_ACCUMULATE);
-    
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_ACCUMULATE);
 
     if (target_rank == MPI_PROC_NULL) {
@@ -359,98 +359,97 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_NONE,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-			    dt_contig, data_sz, dtp, dt_true_lb);  
-    
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
+
     if (data_sz == 0) {
-	goto fn_exit;
+        goto fn_exit;
     }
 
     rank = win_ptr->comm_ptr->rank;
-    
-    if (win_ptr->shm_allocated == TRUE && target_rank != rank && win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
+
+    if (win_ptr->shm_allocated == TRUE && target_rank != rank &&
+        win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
         /* check if target is local and shared memory is allocated on window,
-           if so, we directly perform this operation on shared memory region. */
+         * if so, we directly perform this operation on shared memory region. */
 
         /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-           the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-           not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-           which is only set to TRUE when SHM region is allocated in nemesis.
-           In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-        */
+         * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+         * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+         * which is only set to TRUE when SHM region is allocated in nemesis.
+         * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+         */
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, rank, &orig_vc);
         MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc);
     }
 
     /* Do =! rank first (most likely branch?) */
     if (target_rank == rank || win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
-        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id))
-    {
-	mpi_errno = MPIDI_CH3I_Shm_acc_op(origin_addr, origin_count, origin_datatype,
-					  target_rank, target_disp, target_count, target_datatype,
-					  op, win_ptr);
-	if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id)) {
+        mpi_errno = MPIDI_CH3I_Shm_acc_op(origin_addr, origin_count, origin_datatype,
+                                          target_rank, target_disp, target_count, target_datatype,
+                                          op, win_ptr);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
-    else
-    {
+    else {
         MPIDI_RMA_Ops_list_t *ops_list = MPIDI_CH3I_RMA_Get_ops_list(win_ptr, target_rank);
         MPIDI_RMA_Op_t *new_ptr = NULL;
 
-	/* queue it up */
+        /* queue it up */
         MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
         mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
-	/* If predefined and contiguous, use a simplified element */
-	if (MPIR_DATATYPE_IS_PREDEFINED(origin_datatype) &&
+        /* If predefined and contiguous, use a simplified element */
+        if (MPIR_DATATYPE_IS_PREDEFINED(origin_datatype) &&
             MPIR_DATATYPE_IS_PREDEFINED(target_datatype) && enableShortACC) {
-	    MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
-	    new_ptr->type = MPIDI_RMA_ACC_CONTIG;
-	    /* Only the information needed for the contig/predefined acc */
+            MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
+            new_ptr->type = MPIDI_RMA_ACC_CONTIG;
+            /* Only the information needed for the contig/predefined acc */
             /* Cast away const'ness for origin_address as
              * MPIDI_RMA_Op_t contain both PUT and GET like ops */
-	    new_ptr->origin_addr = (void *) origin_addr;
-	    new_ptr->origin_count = origin_count;
-	    new_ptr->origin_datatype = origin_datatype;
-	    new_ptr->target_rank = target_rank;
-	    new_ptr->target_disp = target_disp;
-	    new_ptr->target_count = target_count;
-	    new_ptr->target_datatype = target_datatype;
-	    new_ptr->op = op;
-	    MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
-	    goto fn_exit;
-	}
-
-	MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
-	new_ptr->type = MPIDI_RMA_ACCUMULATE;
+            new_ptr->origin_addr = (void *) origin_addr;
+            new_ptr->origin_count = origin_count;
+            new_ptr->origin_datatype = origin_datatype;
+            new_ptr->target_rank = target_rank;
+            new_ptr->target_disp = target_disp;
+            new_ptr->target_count = target_count;
+            new_ptr->target_datatype = target_datatype;
+            new_ptr->op = op;
+            MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
+            goto fn_exit;
+        }
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
+        new_ptr->type = MPIDI_RMA_ACCUMULATE;
         /* Cast away const'ness for origin_address as MPIDI_RMA_Op_t
          * contain both PUT and GET like ops */
-	new_ptr->origin_addr = (void *) origin_addr;
-	new_ptr->origin_count = origin_count;
-	new_ptr->origin_datatype = origin_datatype;
-	new_ptr->target_rank = target_rank;
-	new_ptr->target_disp = target_disp;
-	new_ptr->target_count = target_count;
-	new_ptr->target_datatype = target_datatype;
-	new_ptr->op = op;
-	MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
-	
-	/* if source or target datatypes are derived, increment their
-	   reference counts */
-	if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype))
-	{
-	    MPID_Datatype_get_ptr(origin_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
-	if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype))
-	{
-	    MPID_Datatype_get_ptr(target_datatype, dtp);
-	    MPID_Datatype_add_ref(dtp);
-	}
+        new_ptr->origin_addr = (void *) origin_addr;
+        new_ptr->origin_count = origin_count;
+        new_ptr->origin_datatype = origin_datatype;
+        new_ptr->target_rank = target_rank;
+        new_ptr->target_disp = target_disp;
+        new_ptr->target_count = target_count;
+        new_ptr->target_datatype = target_datatype;
+        new_ptr->op = op;
+        MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
+
+        /* if source or target datatypes are derived, increment their
+         * reference counts */
+        if (!MPIR_DATATYPE_IS_PREDEFINED(origin_datatype)) {
+            MPID_Datatype_get_ptr(origin_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
+        if (!MPIR_DATATYPE_IS_PREDEFINED(target_datatype)) {
+            MPID_Datatype_get_ptr(target_datatype, dtp);
+            MPID_Datatype_add_ref(dtp);
+        }
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_ACCUMULATE);
     return mpi_errno;
 
@@ -465,7 +464,7 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
 #define FUNCNAME MPIDI_Alloc_mem
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-void *MPIDI_Alloc_mem( size_t size, MPID_Info *info_ptr )
+void *MPIDI_Alloc_mem(size_t size, MPID_Info * info_ptr)
 {
     void *ap;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_ALLOC_MEM);
@@ -473,7 +472,7 @@ void *MPIDI_Alloc_mem( size_t size, MPID_Info *info_ptr )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_ALLOC_MEM);
 
     ap = MPIU_Malloc(size);
-    
+
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_ALLOC_MEM);
     return ap;
 }
@@ -483,7 +482,7 @@ void *MPIDI_Alloc_mem( size_t size, MPID_Info *info_ptr )
 #define FUNCNAME MPIDI_Free_mem
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Free_mem( void *ptr )
+int MPIDI_Free_mem(void *ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_FREE_MEM);
@@ -491,7 +490,7 @@ int MPIDI_Free_mem( void *ptr )
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_FREE_MEM);
 
     MPIU_Free(ptr);
-    
+
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_FREE_MEM);
     return mpi_errno;
 }
diff --git a/src/mpid/ch3/src/ch3u_rma_reqops.c b/src/mpid/ch3/src/ch3u_rma_reqops.c
index f83f893..13a51f0 100644
--- a/src/mpid/ch3/src/ch3u_rma_reqops.c
+++ b/src/mpid/ch3/src/ch3u_rma_reqops.c
@@ -14,8 +14,8 @@
 
 typedef struct {
     MPID_Request *request;
-    MPID_Win     *win_ptr;
-    int           target_rank;
+    MPID_Win *win_ptr;
+    int target_rank;
 } MPIDI_CH3I_Rma_req_state_t;
 
 
@@ -23,10 +23,10 @@ typedef struct {
 #define FUNCNAME MPIDI_CH3I_Rma_req_poll
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int MPIDI_CH3I_Rma_req_poll(void *state, MPI_Status *status)
+static int MPIDI_CH3I_Rma_req_poll(void *state, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPIDI_CH3I_Rma_req_state_t *req_state = (MPIDI_CH3I_Rma_req_state_t*) state;
+    MPIDI_CH3I_Rma_req_state_t *req_state = (MPIDI_CH3I_Rma_req_state_t *) state;
 
     MPIU_UNREFERENCED_ARG(status);
 
@@ -35,19 +35,20 @@ static int MPIDI_CH3I_Rma_req_poll(void *state, MPI_Status *status)
      * unlock. */
     /* FIXME: We need per-operation completion to make this more efficient. */
     if (req_state->win_ptr->targets[req_state->target_rank].remote_lock_state
-        != MPIDI_CH3_WIN_LOCK_NONE)
-    {
+        != MPIDI_CH3_WIN_LOCK_NONE) {
         mpi_errno = req_state->win_ptr->RMAFns.Win_flush(req_state->target_rank,
                                                          req_state->win_ptr);
     }
 
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
     MPIR_Grequest_complete_impl(req_state->request);
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -56,8 +57,7 @@ static int MPIDI_CH3I_Rma_req_poll(void *state, MPI_Status *status)
 #define FUNCNAME MPIDI_CH3I_Rma_req_wait
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int MPIDI_CH3I_Rma_req_wait(int count, void **states, double timeout,
-                                   MPI_Status *status)
+static int MPIDI_CH3I_Rma_req_wait(int count, void **states, double timeout, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
     int i;
@@ -65,12 +65,14 @@ static int MPIDI_CH3I_Rma_req_wait(int count, void **states, double timeout,
     for (i = 0; i < count; i++) {
         /* Call poll to complete the operation */
         mpi_errno = MPIDI_CH3I_Rma_req_poll(states[i], status);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -79,7 +81,7 @@ static int MPIDI_CH3I_Rma_req_wait(int count, void **states, double timeout,
 #define FUNCNAME MPIDI_CH3I_Rma_req_query
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int MPIDI_CH3I_Rma_req_query(void *state, MPI_Status *status)
+static int MPIDI_CH3I_Rma_req_query(void *state, MPI_Status * status)
 {
     int mpi_errno = MPI_SUCCESS;
 
@@ -91,10 +93,10 @@ static int MPIDI_CH3I_Rma_req_query(void *state, MPI_Status *status)
     status->MPI_SOURCE = MPI_UNDEFINED;
     status->MPI_TAG = MPI_UNDEFINED;
 
- fn_exit:
+  fn_exit:
     status->MPI_ERROR = mpi_errno;
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -126,9 +128,9 @@ static int MPIDI_CH3I_Rma_req_cancel(void *state, int complete)
         MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**rmareqcancel");
     }
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -139,8 +141,8 @@ static int MPIDI_CH3I_Rma_req_cancel(void *state, int complete)
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Rput(const void *origin_addr, int origin_count,
                MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-               int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr,
-               MPID_Request **request)
+               int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
+               MPID_Request ** request)
 {
     int mpi_errno = MPI_SUCCESS;
     int dt_contig ATTRIBUTE((unused));
@@ -156,27 +158,25 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL &&
-                        target_rank != MPI_PROC_NULL,
-                        mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+                        target_rank != MPI_PROC_NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
-                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
-                        "req-based RMA state");
+    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t *,
+                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno, "req-based RMA state");
 
     req_state->win_ptr = win_ptr;
     req_state->target_rank = target_rank;
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-                            dt_contig, data_sz, dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
 
     /* Enqueue or perform the RMA operation */
     if (target_rank != MPI_PROC_NULL && data_sz != 0) {
         mpi_errno = win_ptr->RMAFns.Put(origin_addr, origin_count,
                                         origin_datatype, target_rank,
-                                        target_disp, target_count,
-                                        target_datatype, win_ptr);
+                                        target_disp, target_count, target_datatype, win_ptr);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
@@ -192,7 +192,9 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_free,
                                              MPIDI_CH3I_Rma_req_cancel,
                                              req_state, &req_state->request);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_Grequest_complete_impl(req_state->request);
     }
@@ -204,15 +206,17 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_wait,
                                              req_state, &req_state->request);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     *request = req_state->request;
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RPUT);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
@@ -224,8 +228,8 @@ int MPIDI_Rput(const void *origin_addr, int origin_count,
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Rget(void *origin_addr, int origin_count,
                MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-               int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr,
-               MPID_Request **request)
+               int target_count, MPI_Datatype target_datatype, MPID_Win * win_ptr,
+               MPID_Request ** request)
 {
     int mpi_errno = MPI_SUCCESS;
     int dt_contig ATTRIBUTE((unused));
@@ -241,27 +245,25 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL &&
-                        target_rank != MPI_PROC_NULL,
-                        mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+                        target_rank != MPI_PROC_NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
-                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
-                        "req-based RMA state");
+    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t *,
+                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno, "req-based RMA state");
 
     req_state->win_ptr = win_ptr;
     req_state->target_rank = target_rank;
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-                            dt_contig, data_sz, dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
 
     /* Enqueue or perform the RMA operation */
     if (target_rank != MPI_PROC_NULL && data_sz != 0) {
         mpi_errno = win_ptr->RMAFns.Get(origin_addr, origin_count,
                                         origin_datatype, target_rank,
-                                        target_disp, target_count,
-                                        target_datatype, win_ptr);
+                                        target_disp, target_count, target_datatype, win_ptr);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
@@ -277,7 +279,9 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_free,
                                              MPIDI_CH3I_Rma_req_cancel,
                                              req_state, &req_state->request);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_Grequest_complete_impl(req_state->request);
     }
@@ -289,15 +293,17 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_wait,
                                              req_state, &req_state->request);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     *request = req_state->request;
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
@@ -309,8 +315,8 @@ int MPIDI_Rget(void *origin_addr, int origin_count,
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
 int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
                       MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
-                      int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win_ptr,
-                      MPID_Request **request)
+                      int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win * win_ptr,
+                      MPID_Request ** request)
 {
     int mpi_errno = MPI_SUCCESS;
     int dt_contig ATTRIBUTE((unused));
@@ -326,18 +332,15 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL &&
-                        target_rank != MPI_PROC_NULL,
-                        mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+                        target_rank != MPI_PROC_NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
-                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
-                        "req-based RMA state");
+    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t *,
+                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno, "req-based RMA state");
 
     req_state->win_ptr = win_ptr;
     req_state->target_rank = target_rank;
 
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-                            dt_contig, data_sz, dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
 
     /* Enqueue or perform the RMA operation */
     if (target_rank != MPI_PROC_NULL && data_sz != 0) {
@@ -345,7 +348,9 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
                                                origin_datatype, target_rank,
                                                target_disp, target_count,
                                                target_datatype, op, win_ptr);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
@@ -361,7 +366,9 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_free,
                                              MPIDI_CH3I_Rma_req_cancel,
                                              req_state, &req_state->request);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_Grequest_complete_impl(req_state->request);
     }
@@ -373,15 +380,17 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_wait,
                                              req_state, &req_state->request);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     *request = req_state->request;
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RACCUMULATE);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
@@ -394,8 +403,8 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count,
 int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
                           MPI_Datatype origin_datatype, void *result_addr, int result_count,
                           MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
-                          int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win_ptr,
-                          MPID_Request **request)
+                          int target_count, MPI_Datatype target_datatype, MPI_Op op,
+                          MPID_Win * win_ptr, MPID_Request ** request)
 {
     int mpi_errno = MPI_SUCCESS;
     int dt_contig ATTRIBUTE((unused));
@@ -411,21 +420,17 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL &&
-                        target_rank != MPI_PROC_NULL,
-                        mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
+                        target_rank != MPI_PROC_NULL, mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t*,
-                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno,
-                        "req-based RMA state");
+    MPIU_CHKPMEM_MALLOC(req_state, MPIDI_CH3I_Rma_req_state_t *,
+                        sizeof(MPIDI_CH3I_Rma_req_state_t), mpi_errno, "req-based RMA state");
 
     req_state->win_ptr = win_ptr;
     req_state->target_rank = target_rank;
 
     /* Note that GACC is only a no-op if no data goes in both directions */
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-                            dt_contig, data_sz, dtp, dt_true_lb);
-    MPIDI_Datatype_get_info(origin_count, origin_datatype,
-                            dt_contig, trg_data_sz, dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, data_sz, dtp, dt_true_lb);
+    MPIDI_Datatype_get_info(origin_count, origin_datatype, dt_contig, trg_data_sz, dtp, dt_true_lb);
 
     /* Enqueue or perform the RMA operation */
     if (target_rank != MPI_PROC_NULL && (data_sz != 0 || trg_data_sz != 0)) {
@@ -433,9 +438,10 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
                                                    origin_datatype, result_addr,
                                                    result_count, result_datatype,
                                                    target_rank, target_disp,
-                                                   target_count, target_datatype,
-                                                   op, win_ptr);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+                                                   target_count, target_datatype, op, win_ptr);
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
@@ -446,13 +452,14 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
     /* FIXME: We still may need to flush or sync for shared memory windows */
     if (target_rank == MPI_PROC_NULL || target_rank == win_ptr->comm_ptr->rank ||
         (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) ||
-        (data_sz == 0 && trg_data_sz == 0))
-    {
+        (data_sz == 0 && trg_data_sz == 0)) {
         mpi_errno = MPIR_Grequest_start_impl(MPIDI_CH3I_Rma_req_query,
                                              MPIDI_CH3I_Rma_req_free,
                                              MPIDI_CH3I_Rma_req_cancel,
                                              req_state, &req_state->request);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         MPIR_Grequest_complete_impl(req_state->request);
     }
@@ -464,16 +471,17 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count,
                                              MPIDI_CH3I_Rma_req_wait,
                                              req_state, &req_state->request);
 
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     *request = req_state->request;
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_RGET_ACCUMULATE);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
-
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 1324324..ad42680 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -413,595 +413,479 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmaqueue_set);
 void MPIDI_CH3_RMA_Init_Pvars(void)
 {
     /* rma_lockqueue_alloc */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_lockqueue_alloc,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "Allocate Lock Queue element (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_lockqueue_alloc,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "Allocate Lock Queue element (in seconds)");
 
     /* rma_winfence_clearlock */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_clearlock,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Clear prior lock (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_clearlock_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Clear prior lock");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_clearlock,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FENCE:Clear prior lock (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_clearlock_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Clear prior lock");
 
     /* rma_winfence_rs */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_rs,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:ReduceScatterBlock (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_rs,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FENCE:ReduceScatterBlock (in seconds)");
 
     /* rma_winfence_issue and auxiliaries */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_issue,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Issue RMA ops (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_issue_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Issue RMA ops");
-
-    MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_issue_aux,
-        0, /* init value */
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Issue RMA ops");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_issue,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FENCE:Issue RMA ops (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_issue_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Issue RMA ops");
+
+    MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(RMA, MPI_UNSIGNED_LONG_LONG, rma_winfence_issue_aux, 0,   /* init value */
+                                              MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                              MPI_T_BIND_NO_OBJECT,
+                                              MPIR_T_PVAR_FLAG_READONLY,
+                                              "RMA", "WIN_FENCE:Issue RMA ops");
 
     /* rma_winfence_complete */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_complete,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Complete RMA ops (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_complete_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Complete RMA ops");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_complete,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FENCE:Complete RMA ops (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_complete_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Complete RMA ops");
 
     /* rma_winfence_wait */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_wait,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Wait for ops from other processes (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_wait_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Wait for ops from other processes");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_wait,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA",
+                                      "WIN_FENCE:Wait for ops from other processes (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_wait_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Wait for ops from other processes");
 
     /* rma_winfence_block */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfence_block,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Wait for any progress (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_block_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Wait for any progress");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfence_block,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FENCE:Wait for any progress (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_block_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Wait for any progress");
 
 
     /* rma_winpost_clearlock */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winpost_clearlock,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_POST:Clear prior lock  (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winpost_clearlock_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_POST:Clear prior lock");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winpost_clearlock,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_POST:Clear prior lock  (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winpost_clearlock_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_POST:Clear prior lock");
 
     /* rma_winpost_sendsync */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winpost_sendsync,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_POST:Senc sync messages (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winpost_sendsync_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_POST:Senc sync messages");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winpost_sendsync,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_POST:Senc sync messages (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winpost_sendsync_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_POST:Senc sync messages");
 
     /* rma_winstart_clearlock */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winstart_clearlock,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_START:Clear prior lock (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winstart_clearlock_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_START:Clear prior lock");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winstart_clearlock,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_START:Clear prior lock (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winstart_clearlock_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_START:Clear prior lock");
 
     /* rma_wincomplete_issue and auxiliaries */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_wincomplete_issue,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Issue RMA ops (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_issue_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Issue RMA ops");
-
-    MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_issue_aux,
-        0, /* init value */
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Issue RMA ops");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_wincomplete_issue,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_COMPLETE:Issue RMA ops (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_wincomplete_issue_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_COMPLETE:Issue RMA ops");
+
+    MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(RMA, MPI_UNSIGNED_LONG_LONG, rma_wincomplete_issue_aux, 0,        /* init value */
+                                              MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                              MPI_T_BIND_NO_OBJECT,
+                                              MPIR_T_PVAR_FLAG_READONLY,
+                                              "RMA", "WIN_COMPLETE:Issue RMA ops");
 
     /* rma_wincomplete_complete */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_wincomplete_complete,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Complete RMA ops (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_complete_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Complete RMA ops");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_wincomplete_complete,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_COMPLETE:Complete RMA ops (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_wincomplete_complete_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_COMPLETE:Complete RMA ops");
 
     /* rma_wincomplete_recvsync */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_wincomplete_recvsync,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Recv sync messages (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_recvsync_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Recv sync messages");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_wincomplete_recvsync,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_COMPLETE:Recv sync messages (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_wincomplete_recvsync_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_COMPLETE:Recv sync messages");
 
     /* rma_wincomplete_block */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_wincomplete_block,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Wait for any progress (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_block_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Wait for any progress");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_wincomplete_block,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_COMPLETE:Wait for any progress (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_wincomplete_block_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_COMPLETE:Wait for any progress");
 
     /* rma_winwait_wait */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winwait_wait,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_WAIT:Wait for ops from other processes (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winwait_wait_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_WAIT:Wait for ops from other processes");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winwait_wait,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA",
+                                      "WIN_WAIT:Wait for ops from other processes (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winwait_wait_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_WAIT:Wait for ops from other processes");
 
     /* rma_winlock_getlocallock */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winlock_getlocallock,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_LOCK:Get local lock (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winlock_getlocallock,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_LOCK:Get local lock (in seconds)");
 
     /* rma_winunlock_getlock */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winunlock_getlock,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Acquire lock (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winunlock_getlock,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_UNLOCK:Acquire lock (in seconds)");
 
     /* rma_winunlock_issue */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winunlock_issue,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Issue RMA ops (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winunlock_issue,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_UNLOCK:Issue RMA ops (in seconds)");
 
     /* rma_winunlock_complete */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winunlock_complete,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Complete RMA ops (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winunlock_complete_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Complete RMA ops (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winunlock_complete,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_UNLOCK:Complete RMA ops (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winunlock_complete_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_UNLOCK:Complete RMA ops (in seconds)");
 
     /* rma_winunlock_block */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winunlock_block,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Wait for any progress (in seconds)");
-
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winunlock_block_aux,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Wait for any progress");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winunlock_block,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_UNLOCK:Wait for any progress (in seconds)");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winunlock_block_aux,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_UNLOCK:Wait for any progress");
 
     /* rma_rmapkt_acc */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_acc,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Accumulate (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_acc,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "RMA:PKTHANDLER for Accumulate (in seconds)");
 
     /* rma_rmapkt_acc_predef */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_acc_predef,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Accumulate: predef dtype (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_acc_predef,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA",
+                                      "RMA:PKTHANDLER for Accumulate: predef dtype (in seconds)");
 
     /* rma_rmapkt_acc_immed */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_acc_immed,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Accum immed (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_acc_immed,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "RMA:PKTHANDLER for Accum immed (in seconds)");
 
     /* rma_rmapkt_acc_immed_op */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_acc_immed_op,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Accum immed operation (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_acc_immed_op,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA",
+                                      "RMA:PKTHANDLER for Accum immed operation (in seconds)");
 
     /* rma_rmapkt_cas */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_cas,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Compare-and-swap (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_cas,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "RMA:PKTHANDLER for Compare-and-swap (in seconds)");
 
     /* rma_rmapkt_fop */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_fop,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Fetch-and-op (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_fop,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "RMA:PKTHANDLER for Fetch-and-op (in seconds)");
 
     /* rma_rmapkt_get_accum */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmapkt_get_accum,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "RMA:PKTHANDLER for Get-Accumulate (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmapkt_get_accum,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "RMA:PKTHANDLER for Get-Accumulate (in seconds)");
 
     /* Level, counter and highwatermark for rma_winfence_reqs */
-    MPIR_T_PVAR_LEVEL_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_reqs,
-        0, /* init value */
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY | MPIR_T_PVAR_FLAG_CONTINUOUS,
-        "RMA",
-        "WIN_FENCE:Pending requests");
-
-      MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_reqs,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Pending requests");
-
-      MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winfence_reqs,
-        0, /* init value */
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FENCE:Pending requests");
+    MPIR_T_PVAR_LEVEL_REGISTER_STATIC(RMA, MPI_UNSIGNED_LONG_LONG, rma_winfence_reqs, 0,        /* init value */
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY | MPIR_T_PVAR_FLAG_CONTINUOUS,
+                                      "RMA", "WIN_FENCE:Pending requests");
+
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winfence_reqs,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_FENCE:Pending requests");
+
+    MPIR_T_PVAR_HIGHWATERMARK_REGISTER_STATIC(RMA, MPI_UNSIGNED_LONG_LONG, rma_winfence_reqs, 0,        /* init value */
+                                              MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                              MPI_T_BIND_NO_OBJECT,
+                                              MPIR_T_PVAR_FLAG_READONLY,
+                                              "RMA", "WIN_FENCE:Pending requests");
 
     /* rma_winunlock_reqs */
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_winunlock_reqs,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_UNLOCK:Pending requests");
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_winunlock_reqs,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_UNLOCK:Pending requests");
 
     /* rma_wincomplete_reqs */
-    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(
-        RMA,
-        MPI_UNSIGNED_LONG_LONG,
-        rma_wincomplete_reqs,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_COMPLETE:Pending requests");
+    MPIR_T_PVAR_COUNTER_REGISTER_STATIC(RMA,
+                                        MPI_UNSIGNED_LONG_LONG,
+                                        rma_wincomplete_reqs,
+                                        MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                        MPI_T_BIND_NO_OBJECT,
+                                        MPIR_T_PVAR_FLAG_READONLY,
+                                        "RMA", "WIN_COMPLETE:Pending requests");
 
     /* rma_wincreate_allgather */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_wincreate_allgather,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_CREATE:Allgather (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_wincreate_allgather,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_CREATE:Allgather (in seconds)");
 
     /* rma_winfree_rs */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfree_rs,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FREE:ReduceScatterBlock (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfree_rs,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FREE:ReduceScatterBlock (in seconds)");
 
     /* rma_winfree_complete */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_winfree_complete,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "WIN_FREE:Complete (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_winfree_complete,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "WIN_FREE:Complete (in seconds)");
 
     /* rma_rmaqueue_alloc */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmaqueue_alloc,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "Allocate RMA Queue element (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmaqueue_alloc,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "Allocate RMA Queue element (in seconds)");
 
     /* rma_rmaqueue_set */
-    MPIR_T_PVAR_TIMER_REGISTER_STATIC(
-        RMA,
-        MPI_DOUBLE,
-        rma_rmaqueue_set,
-        MPI_T_VERBOSITY_MPIDEV_DETAIL,
-        MPI_T_BIND_NO_OBJECT,
-        MPIR_T_PVAR_FLAG_READONLY,
-        "RMA",
-        "Set fields in RMA Queue element (in seconds)");
+    MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
+                                      MPI_DOUBLE,
+                                      rma_rmaqueue_set,
+                                      MPI_T_VERBOSITY_MPIDEV_DETAIL,
+                                      MPI_T_BIND_NO_OBJECT,
+                                      MPIR_T_PVAR_FLAG_READONLY,
+                                      "RMA", "Set fields in RMA Queue element (in seconds)");
 }
 
-/* These are used to use a common routine to complete lists of RMA 
-   operations with a single routine, while collecting data that 
+/* These are used to use a common routine to complete lists of RMA
+   operations with a single routine, while collecting data that
    distinguishes between different synchronization modes.  This is not
    thread-safe; the best choice for thread-safety is to eliminate this
    ability to discriminate between the different types of RMA synchronization.
 */
-static MPIR_T_pvar_timer_t *list_complete_timer;  /* outer */
+static MPIR_T_pvar_timer_t *list_complete_timer;        /* outer */
 static unsigned long long *list_complete_counter;
-static MPIR_T_pvar_timer_t *list_block_timer;     /* Inner; while waiting */
+static MPIR_T_pvar_timer_t *list_block_timer;   /* Inner; while waiting */
 
 /*
  * These routines provide a default implementation of the MPI RMA operations
@@ -1012,110 +896,105 @@ static MPIR_T_pvar_timer_t *list_block_timer;     /* Inner; while waiting */
 
 #define SYNC_POST_TAG 100
 
-static int send_lock_msg(int dest, int lock_type, MPID_Win *win_ptr);
-static int send_unlock_msg(int dest, MPID_Win *win_ptr);
+static int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr);
+static int send_unlock_msg(int dest, MPID_Win * win_ptr);
 /* static int send_flush_msg(int dest, MPID_Win *win_ptr); */
-static int wait_for_lock_granted(MPID_Win *win_ptr, int target_rank);
-static int acquire_local_lock(MPID_Win *win_ptr, int lock_mode);
+static int wait_for_lock_granted(MPID_Win * win_ptr, int target_rank);
+static int acquire_local_lock(MPID_Win * win_ptr, int lock_mode);
 static int send_rma_msg(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
-                                   MPIDI_CH3_Pkt_flags_t flags,
-				   MPI_Win source_win_handle, 
-				   MPI_Win target_win_handle, 
-				   MPIDI_RMA_dtype_info * dtype_info, 
-				   void ** dataloop, MPID_Request ** request);
+                        MPIDI_CH3_Pkt_flags_t flags,
+                        MPI_Win source_win_handle,
+                        MPI_Win target_win_handle,
+                        MPIDI_RMA_dtype_info * dtype_info,
+                        void **dataloop, MPID_Request ** request);
 static int recv_rma_msg(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
-                                   MPIDI_CH3_Pkt_flags_t flags,
-				   MPI_Win source_win_handle, 
-				   MPI_Win target_win_handle, 
-				   MPIDI_RMA_dtype_info * dtype_info, 
-				   void ** dataloop, MPID_Request ** request); 
+                        MPIDI_CH3_Pkt_flags_t flags,
+                        MPI_Win source_win_handle,
+                        MPI_Win target_win_handle,
+                        MPIDI_RMA_dtype_info * dtype_info,
+                        void **dataloop, MPID_Request ** request);
 static int send_contig_acc_msg(MPIDI_RMA_Op_t *, MPID_Win *,
-                                          MPIDI_CH3_Pkt_flags_t flags,
-					  MPI_Win, MPI_Win, MPID_Request ** );
+                               MPIDI_CH3_Pkt_flags_t flags, MPI_Win, MPI_Win, MPID_Request **);
 static int send_immed_rmw_msg(MPIDI_RMA_Op_t *, MPID_Win *,
-                                         MPIDI_CH3_Pkt_flags_t flags,
-                                         MPI_Win, MPI_Win, MPID_Request ** );
-static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
-                                            int *wait_for_rma_done_pkt,
-                                            MPIDI_CH3_Pkt_flags_t sync_flags);
+                              MPIDI_CH3_Pkt_flags_t flags, MPI_Win, MPI_Win, MPID_Request **);
+static int do_passive_target_rma(MPID_Win * win_ptr, int target_rank,
+                                 int *wait_for_rma_done_pkt, MPIDI_CH3_Pkt_flags_t sync_flags);
 static int send_lock_put_or_acc(MPID_Win *, int);
 static int send_lock_get(MPID_Win *, int);
 static inline int poke_progress_engine(void);
-static inline int rma_list_complete(MPID_Win *win_ptr,
-                                      MPIDI_RMA_Ops_list_t *ops_list);
-static inline int rma_list_gc(MPID_Win *win_ptr,
-                                             MPIDI_RMA_Ops_list_t *ops_list,
-                                             MPIDI_RMA_Op_t *last_elm, int *nDone);
+static inline int rma_list_complete(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * ops_list);
+static inline int rma_list_gc(MPID_Win * win_ptr,
+                              MPIDI_RMA_Ops_list_t * ops_list,
+                              MPIDI_RMA_Op_t * last_elm, int *nDone);
 
-static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
+static int create_datatype(const MPIDI_RMA_dtype_info * dtype_info,
                            const void *dataloop, MPI_Aint dataloop_sz,
                            const void *o_addr, int o_count,
-			   MPI_Datatype o_datatype,
-                           MPID_Datatype **combined_dtp);
+                           MPI_Datatype o_datatype, MPID_Datatype ** combined_dtp);
 
 /* Issue an RMA operation -- Before calling this macro, you must define the
  * MPIDI_CH3I_TRACK_RMA_WRITE helper macro.  This macro defines any extra action
  * that should be taken when a write (put/acc) operation is encountered. */
 #define MPIDI_CH3I_ISSUE_RMA_OP(op_ptr_, win_ptr_, flags_, source_win_handle_, target_win_handle_,err_) \
-    do {                                                                                        \
-    switch ((op_ptr_)->type)                                                                    \
-    {                                                                                           \
-        case (MPIDI_RMA_PUT):                                                                   \
-        case (MPIDI_RMA_ACCUMULATE):                                                            \
-            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);                                      \
-            (err_) = send_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_),        \
-                                                (target_win_handle_), &(op_ptr_)->dtype_info,   \
-                                                &(op_ptr_)->dataloop, &(op_ptr_)->request);     \
-            if (err_) { MPIU_ERR_POP(err_); }                                                   \
-            break;                                                                              \
-        case (MPIDI_RMA_GET_ACCUMULATE):                                                        \
-            if ((op_ptr_)->op == MPI_NO_OP) {                                                   \
-                /* Note: Origin arguments are ignored for NO_OP, so we don't                    \
-                 * need to release a ref to the origin datatype. */                             \
-                                                                                                \
-                /* Convert the GAcc to a Get */                                                 \
-                (op_ptr_)->type            = MPIDI_RMA_GET;                                     \
-                (op_ptr_)->origin_addr     = (op_ptr_)->result_addr;                            \
-                (op_ptr_)->origin_count    = (op_ptr_)->result_count;                           \
-                (op_ptr_)->origin_datatype = (op_ptr_)->result_datatype;                        \
-                                                                                                \
-                (err_) = recv_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_),    \
-                                                    (target_win_handle_), &(op_ptr_)->dtype_info,\
-                                                    &(op_ptr_)->dataloop, &(op_ptr_)->request); \
-            } else {                                                                            \
-                MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);                                  \
-                (err_) = send_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_),    \
-                                                    (target_win_handle_), &(op_ptr_)->dtype_info,\
-                                                    &(op_ptr_)->dataloop, &(op_ptr_)->request); \
-            }                                                                                   \
-            if (err_) { MPIU_ERR_POP(err_); }                                                   \
-            break;                                                                              \
-        case MPIDI_RMA_ACC_CONTIG:                                                              \
-            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);                                      \
-            (err_) = send_contig_acc_msg((op_ptr_), (win_ptr_), (flags_),                       \
-                                                       (source_win_handle_), (target_win_handle_),\
-                                                       &(op_ptr_)->request );                   \
-            if (err_) { MPIU_ERR_POP(err_); }                                                   \
-            break;                                                                              \
-        case (MPIDI_RMA_GET):                                                                   \
-            (err_) = recv_rma_msg((op_ptr_), (win_ptr_), (flags_),                              \
-                                                (source_win_handle_), (target_win_handle_),     \
-                                                &(op_ptr_)->dtype_info,                         \
-                                                &(op_ptr_)->dataloop, &(op_ptr_)->request);     \
-            if (err_) { MPIU_ERR_POP(err_); }                                                   \
-            break;                                                                              \
-        case (MPIDI_RMA_COMPARE_AND_SWAP):                                                      \
-        case (MPIDI_RMA_FETCH_AND_OP):                                                          \
-            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);                                      \
-            (err_) = send_immed_rmw_msg((op_ptr_), (win_ptr_), (flags_),                        \
-                                                      (source_win_handle_), (target_win_handle_),\
-                                                      &(op_ptr_)->request );                    \
-            if (err_) { MPIU_ERR_POP(err_); }                                                   \
-            break;                                                                              \
-                                                                                                \
-        default:                                                                                \
-            MPIU_ERR_SETANDJUMP(err_,MPI_ERR_OTHER,"**winInvalidOp");                           \
-    }                                                                                           \
+    do {                                                                \
+        switch ((op_ptr_)->type)                                        \
+        {                                                               \
+        case (MPIDI_RMA_PUT):                                           \
+        case (MPIDI_RMA_ACCUMULATE):                                    \
+            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);              \
+            (err_) = send_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_), \
+                                  (target_win_handle_), &(op_ptr_)->dtype_info, \
+                                  &(op_ptr_)->dataloop, &(op_ptr_)->request); \
+            if (err_) { MPIU_ERR_POP(err_); }                           \
+            break;                                                      \
+        case (MPIDI_RMA_GET_ACCUMULATE):                                \
+            if ((op_ptr_)->op == MPI_NO_OP) {                           \
+                /* Note: Origin arguments are ignored for NO_OP, so we don't \
+                 * need to release a ref to the origin datatype. */     \
+                                                                        \
+                /* Convert the GAcc to a Get */                         \
+                (op_ptr_)->type            = MPIDI_RMA_GET;             \
+                (op_ptr_)->origin_addr     = (op_ptr_)->result_addr;    \
+                (op_ptr_)->origin_count    = (op_ptr_)->result_count;   \
+                (op_ptr_)->origin_datatype = (op_ptr_)->result_datatype; \
+                                                                        \
+                (err_) = recv_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_), \
+                                      (target_win_handle_), &(op_ptr_)->dtype_info, \
+                                      &(op_ptr_)->dataloop, &(op_ptr_)->request); \
+            } else {                                                    \
+                MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);          \
+                (err_) = send_rma_msg((op_ptr_), (win_ptr_), (flags_), (source_win_handle_), \
+                                      (target_win_handle_), &(op_ptr_)->dtype_info, \
+                                      &(op_ptr_)->dataloop, &(op_ptr_)->request); \
+            }                                                           \
+            if (err_) { MPIU_ERR_POP(err_); }                           \
+            break;                                                      \
+        case MPIDI_RMA_ACC_CONTIG:                                      \
+            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);              \
+            (err_) = send_contig_acc_msg((op_ptr_), (win_ptr_), (flags_), \
+                                         (source_win_handle_), (target_win_handle_), \
+                                         &(op_ptr_)->request);          \
+            if (err_) { MPIU_ERR_POP(err_); }                           \
+            break;                                                      \
+        case (MPIDI_RMA_GET):                                           \
+            (err_) = recv_rma_msg((op_ptr_), (win_ptr_), (flags_),      \
+                                  (source_win_handle_), (target_win_handle_), \
+                                  &(op_ptr_)->dtype_info,               \
+                                  &(op_ptr_)->dataloop, &(op_ptr_)->request); \
+            if (err_) { MPIU_ERR_POP(err_); }                           \
+            break;                                                      \
+        case (MPIDI_RMA_COMPARE_AND_SWAP):                              \
+        case (MPIDI_RMA_FETCH_AND_OP):                                  \
+            MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_);              \
+            (err_) = send_immed_rmw_msg((op_ptr_), (win_ptr_), (flags_), \
+                                        (source_win_handle_), (target_win_handle_), \
+                                        &(op_ptr_)->request);           \
+            if (err_) { MPIU_ERR_POP(err_); }                           \
+            break;                                                      \
+                                                                        \
+        default:                                                        \
+            MPIU_ERR_SETANDJUMP(err_,MPI_ERR_OTHER,"**winInvalidOp");   \
+        }                                                               \
     } while (0)
 
 
@@ -1123,7 +1002,7 @@ static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
 #define FUNCNAME MPIDI_Win_fence
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
+int MPIDI_Win_fence(int assert, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int comm_size;
@@ -1150,110 +1029,110 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
      * we need to check whether there is a lock on the window, and if
      * there is a lock, poke the progress engine until the operartions
      * have completed and the lock is released. */
-    if (win_ptr->current_lock_type != MPID_LOCK_NONE)
-    {
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_clearlock);
-	MPID_Progress_start(&progress_state);
-	while (win_ptr->current_lock_type != MPID_LOCK_NONE)
-	{
-	    /* poke the progress engine */
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS) {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-	    }
-	    /* --END ERROR HANDLING-- */
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_clearlock_aux, 1);
-	}
-	MPID_Progress_end(&progress_state);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_clearlock);
+    if (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_clearlock);
+        MPID_Progress_start(&progress_state);
+        while (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+            /* poke the progress engine */
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+            }
+            /* --END ERROR HANDLING-- */
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_clearlock_aux, 1);
+        }
+        MPID_Progress_end(&progress_state);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_clearlock);
     }
 
     /* Note that the NOPRECEDE and NOSUCCEED must be specified by all processes
-       in the window's group if any specify it */
-    if (assert & MPI_MODE_NOPRECEDE)
-    {
+     * in the window's group if any specify it */
+    if (assert & MPI_MODE_NOPRECEDE) {
         /* Error: Operations were issued and the user claimed NOPRECEDE */
         MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_FENCE,
                             mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
-	win_ptr->fence_issued = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1;
-	goto shm_barrier;
+        win_ptr->fence_issued = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1;
+        goto shm_barrier;
     }
-    
-    if (win_ptr->fence_issued == 0)
-    {
-	/* win_ptr->fence_issued == 0 means either this is the very first
-	   call to fence or the preceding fence had the
-	   MPI_MODE_NOSUCCEED assert. 
 
-           If this fence has MPI_MODE_NOSUCCEED, do nothing and return.
-	   Otherwise just increment the fence count and return. */
+    if (win_ptr->fence_issued == 0) {
+        /* win_ptr->fence_issued == 0 means either this is the very first
+         * call to fence or the preceding fence had the
+         * MPI_MODE_NOSUCCEED assert.
+         *
+         * If this fence has MPI_MODE_NOSUCCEED, do nothing and return.
+         * Otherwise just increment the fence count and return. */
 
-	if (!(assert & MPI_MODE_NOSUCCEED)) win_ptr->fence_issued = 1;
+        if (!(assert & MPI_MODE_NOSUCCEED))
+            win_ptr->fence_issued = 1;
     }
-    else
-    {
-	int nRequest = 0;
-	int nRequestNew = 0;
+    else {
+        int nRequest = 0;
+        int nRequestNew = 0;
 
         /* Ensure ordering of load/store operations. */
         if (win_ptr->shm_allocated == TRUE) {
-           OPA_read_write_barrier();
+            OPA_read_write_barrier();
         }
 
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_rs);
-	/* This is the second or later fence. Do all the preceding RMA ops. */
-	comm_ptr = win_ptr->comm_ptr;
-	/* First inform every process whether it is a target of RMA
-	   ops from this process */
-	comm_size = comm_ptr->local_size;
-
-	MPIU_CHKLMEM_MALLOC(rma_target_proc, int *, comm_size*sizeof(int),
-			    mpi_errno, "rma_target_proc");
-	for (i=0; i<comm_size; i++) rma_target_proc[i] = 0;
-	
-	/* keep track of no. of ops to each proc. Needed for knowing
-	   whether or not to decrement the completion counter. The
-	   completion counter is decremented only on the last
-	   operation. */
-	MPIU_CHKLMEM_MALLOC(nops_to_proc, int *, comm_size*sizeof(int),
-			    mpi_errno, "nops_to_proc");
-	for (i=0; i<comm_size; i++) nops_to_proc[i] = 0;
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_rs);
+        /* This is the second or later fence. Do all the preceding RMA ops. */
+        comm_ptr = win_ptr->comm_ptr;
+        /* First inform every process whether it is a target of RMA
+         * ops from this process */
+        comm_size = comm_ptr->local_size;
+
+        MPIU_CHKLMEM_MALLOC(rma_target_proc, int *, comm_size * sizeof(int),
+                            mpi_errno, "rma_target_proc");
+        for (i = 0; i < comm_size; i++)
+            rma_target_proc[i] = 0;
+
+        /* keep track of no. of ops to each proc. Needed for knowing
+         * whether or not to decrement the completion counter. The
+         * completion counter is decremented only on the last
+         * operation. */
+        MPIU_CHKLMEM_MALLOC(nops_to_proc, int *, comm_size * sizeof(int),
+                            mpi_errno, "nops_to_proc");
+        for (i = 0; i < comm_size; i++)
+            nops_to_proc[i] = 0;
 
         /* Note, active target uses the following ops list, and passive
-           target uses win_ptr->targets[..] */
+         * target uses win_ptr->targets[..] */
         ops_list = &win_ptr->at_rma_ops_list;
 
-	/* set rma_target_proc[i] to 1 if rank i is a target of RMA
-	   ops from this process */
-	total_op_count = 0;
+        /* set rma_target_proc[i] to 1 if rank i is a target of RMA
+         * ops from this process */
+        total_op_count = 0;
         curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
-	while (curr_ptr != NULL)
-	{
-	    total_op_count++;
-	    rma_target_proc[curr_ptr->target_rank] = 1;
-	    nops_to_proc[curr_ptr->target_rank]++;
-	    curr_ptr = curr_ptr->next;
-	}
-	
-	MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size*sizeof(int),
-			    mpi_errno, "curr_ops_cnt");
-	for (i=0; i<comm_size; i++) curr_ops_cnt[i] = 0;
-	/* do a reduce_scatter_block (with MPI_SUM) on rma_target_proc. 
-	   As a result,
-	   each process knows how many other processes will be doing
-	   RMA ops on its window */  
-            
-	/* first initialize the completion counter. */
-	win_ptr->at_completion_counter += comm_size;
-            
-	mpi_errno = MPIR_Reduce_scatter_block_impl(MPI_IN_PLACE, rma_target_proc, 1,
+        while (curr_ptr != NULL) {
+            total_op_count++;
+            rma_target_proc[curr_ptr->target_rank] = 1;
+            nops_to_proc[curr_ptr->target_rank]++;
+            curr_ptr = curr_ptr->next;
+        }
+
+        MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size * sizeof(int),
+                            mpi_errno, "curr_ops_cnt");
+        for (i = 0; i < comm_size; i++)
+            curr_ops_cnt[i] = 0;
+        /* do a reduce_scatter_block (with MPI_SUM) on rma_target_proc.
+         * As a result,
+         * each process knows how many other processes will be doing
+         * RMA ops on its window */
+
+        /* first initialize the completion counter. */
+        win_ptr->at_completion_counter += comm_size;
+
+        mpi_errno = MPIR_Reduce_scatter_block_impl(MPI_IN_PLACE, rma_target_proc, 1,
                                                    MPI_INT, MPI_SUM, comm_ptr, &errflag);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_rs);
-	/* result is stored in rma_target_proc[0] */
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_rs);
+        /* result is stored in rma_target_proc[0] */
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
         MPIU_ERR_CHKANDJUMP(errflag, mpi_errno, MPI_ERR_OTHER, "**coll_fail");
 
         /* Ensure ordering of load/store operations. */
@@ -1261,93 +1140,98 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
             OPA_read_write_barrier();
         }
 
-	/* Set the completion counter */
-	/* FIXME: MT: this needs to be done atomically because other
-	   procs have the address and could decrement it. */
+        /* Set the completion counter */
+        /* FIXME: MT: this needs to be done atomically because other
+         * procs have the address and could decrement it. */
         win_ptr->at_completion_counter -= comm_size;
         win_ptr->at_completion_counter += rma_target_proc[0];
 
-    MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_issue);
-    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_issue_aux, total_op_count);
-    MPIR_T_PVAR_ULONG2_HIGHWATERMARK_UPDATE(RMA, rma_winfence_issue_aux, total_op_count);
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_issue);
+        MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_issue_aux, total_op_count);
+        MPIR_T_PVAR_ULONG2_HIGHWATERMARK_UPDATE(RMA, rma_winfence_issue_aux, total_op_count);
 
-    MPIR_T_PVAR_ULONG2_HIGHWATERMARK_UPDATE(RMA, rma_winfence_reqs, MPIR_T_PVAR_LEVEL_GET(rma_winfence_reqs));
-    MPIR_T_PVAR_LEVEL_SET(RMA, rma_winfence_reqs, 0); /* reset the level */
-    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_reqs, 1);
+        MPIR_T_PVAR_ULONG2_HIGHWATERMARK_UPDATE(RMA, rma_winfence_reqs,
+                                                MPIR_T_PVAR_LEVEL_GET(rma_winfence_reqs));
+        MPIR_T_PVAR_LEVEL_SET(RMA, rma_winfence_reqs, 0);       /* reset the level */
+        MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_reqs, 1);
 
-	i = 0;
+        i = 0;
         curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
-	while (curr_ptr != NULL)
-	{
+        while (curr_ptr != NULL) {
             MPIDI_CH3_Pkt_flags_t flags = MPIDI_CH3_PKT_FLAG_NONE;
 
-	    /* The completion counter at the target is decremented only on 
-	       the last RMA operation. */
-	    if (curr_ops_cnt[curr_ptr->target_rank] ==
-                nops_to_proc[curr_ptr->target_rank] - 1) {
+            /* The completion counter at the target is decremented only on
+             * the last RMA operation. */
+            if (curr_ops_cnt[curr_ptr->target_rank] == nops_to_proc[curr_ptr->target_rank] - 1) {
                 flags = MPIDI_CH3_PKT_FLAG_RMA_AT_COMPLETE;
             }
 
             source_win_handle = win_ptr->handle;
-	    target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank];
+            target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank];
 
-#define MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_) /* Not used by active mode */
+#define MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_)   /* Not used by active mode */
             MPIDI_CH3I_ISSUE_RMA_OP(curr_ptr, win_ptr, flags,
                                     source_win_handle, target_win_handle, mpi_errno);
 #undef MPIDI_CH3I_TRACK_RMA_WRITE
 
-	    i++;
-	    curr_ops_cnt[curr_ptr->target_rank]++;
-	    /* If the request is null, we can remove it immediately */
-	    if (!curr_ptr->request) {
+            i++;
+            curr_ops_cnt[curr_ptr->target_rank]++;
+            /* If the request is null, we can remove it immediately */
+            if (!curr_ptr->request) {
                 MPIDI_CH3I_RMA_Ops_free_and_next(ops_list, &curr_ptr);
-	    }
-	    else  {
-		nRequest++;
-		MPIR_T_PVAR_LEVEL_INC(RMA, rma_winfence_reqs, 1);
-		curr_ptr    = curr_ptr->next;
-		/* The test on the difference is to reduce the number
-		   of times the partial complete routine is called. Without
-		   this, significant overhead is added once the
-		   number of requests exceeds the threshold, since the
-		   number that are completed in a call may be small. */
-		if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
-		    nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
-		    int nDone = 0;
+            }
+            else {
+                nRequest++;
+                MPIR_T_PVAR_LEVEL_INC(RMA, rma_winfence_reqs, 1);
+                curr_ptr = curr_ptr->next;
+                /* The test on the difference is to reduce the number
+                 * of times the partial complete routine is called. Without
+                 * this, significant overhead is added once the
+                 * number of requests exceeds the threshold, since the
+                 * number that are completed in a call may be small. */
+                if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
+                    nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
+                    int nDone = 0;
                     mpi_errno = poke_progress_engine();
-                    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-            MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winfence_complete));
-            MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_winfence_complete_aux));
+                    if (mpi_errno != MPI_SUCCESS)
+                        MPIU_ERR_POP(mpi_errno);
+                    MPIR_T_PVAR_STMT(RMA, list_complete_timer =
+                                     MPIR_T_PVAR_TIMER_ADDR(rma_winfence_complete));
+                    MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                                     MPIR_T_PVAR_COUNTER_ADDR(rma_winfence_complete_aux));
 
                     mpi_errno = rma_list_gc(win_ptr, ops_list, curr_ptr, &nDone);
-                    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-		    /* if (nDone > 0) printf( "nDone = %d\n", nDone ); */
-		    nRequest -= nDone;
-		    nRequestNew = nRequest;
-		}
-	    }
-	}
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_issue);
-
-	/* We replaced a loop over an array of requests with a list of the
-	   incomplete requests.  The reason to do 
-	   that is for long lists - processing the entire list until
-	   all are done introduces a potentially n^2 time.  In 
-	   testing with test/mpi/perf/manyrma.c , the number of iterations
-	   within the "while (total_op_count) was O(total_op_count).
-	   
-	   Another alternative is to create a more compressed list (storing
-	   only the necessary information, reducing the number of cache lines
-	   needed while looping through the requests.
-	*/
-	if (total_op_count)
-	{ 
-        MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winfence_complete));
-        MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_winfence_complete_aux));
-        MPIR_T_PVAR_STMT(RMA, list_block_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winfence_block));
+                    if (mpi_errno != MPI_SUCCESS)
+                        MPIU_ERR_POP(mpi_errno);
+                    /* if (nDone > 0) printf("nDone = %d\n", nDone); */
+                    nRequest -= nDone;
+                    nRequestNew = nRequest;
+                }
+            }
+        }
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_issue);
+
+        /* We replaced a loop over an array of requests with a list of the
+         * incomplete requests.  The reason to do
+         * that is for long lists - processing the entire list until
+         * all are done introduces a potentially n^2 time.  In
+         * testing with test/mpi/perf/manyrma.c , the number of iterations
+         * within the "while (total_op_count) was O(total_op_count).
+         *
+         * Another alternative is to create a more compressed list (storing
+         * only the necessary information, reducing the number of cache lines
+         * needed while looping through the requests.
+         */
+        if (total_op_count) {
+            MPIR_T_PVAR_STMT(RMA, list_complete_timer =
+                             MPIR_T_PVAR_TIMER_ADDR(rma_winfence_complete));
+            MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                             MPIR_T_PVAR_COUNTER_ADDR(rma_winfence_complete_aux));
+            MPIR_T_PVAR_STMT(RMA, list_block_timer = MPIR_T_PVAR_TIMER_ADDR(rma_winfence_block));
             mpi_errno = rma_list_complete(win_ptr, ops_list);
-            if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-	}
+            if (mpi_errno != MPI_SUCCESS)
+                MPIU_ERR_POP(mpi_errno);
+        }
 
         /* MT: avoid processing unissued operations enqueued by other threads
            in rma_list_complete() */
@@ -1355,32 +1239,29 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
         if (curr_ptr && !curr_ptr->request)
             goto finish_up;
         MPIU_Assert(MPIDI_CH3I_RMA_Ops_isempty(ops_list));
-	
+
  finish_up:
 	/* wait for all operations from other processes to finish */
-	if (win_ptr->at_completion_counter)
-	{
-	    MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_wait);
-	    MPID_Progress_start(&progress_state);
-	    while (win_ptr->at_completion_counter)
-	    {
-		mpi_errno = MPID_Progress_wait(&progress_state);
-		/* --BEGIN ERROR HANDLING-- */
-		if (mpi_errno != MPI_SUCCESS) {
-		    MPID_Progress_end(&progress_state);
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-		}
-		/* --END ERROR HANDLING-- */
-		MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_wait_aux, 1);
-	    }
-	    MPID_Progress_end(&progress_state);
-	    MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_wait);
-	} 
-	
-	if (assert & MPI_MODE_NOSUCCEED)
-	{
-	    win_ptr->fence_issued = 0;
-	}
+        if (win_ptr->at_completion_counter) {
+            MPIR_T_PVAR_TIMER_START(RMA, rma_winfence_wait);
+            MPID_Progress_start(&progress_state);
+            while (win_ptr->at_completion_counter) {
+                mpi_errno = MPID_Progress_wait(&progress_state);
+                /* --BEGIN ERROR HANDLING-- */
+                if (mpi_errno != MPI_SUCCESS) {
+                    MPID_Progress_end(&progress_state);
+                    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
+                }
+                /* --END ERROR HANDLING-- */
+                MPIR_T_PVAR_COUNTER_INC(RMA, rma_winfence_wait_aux, 1);
+            }
+            MPID_Progress_end(&progress_state);
+            MPIR_T_PVAR_TIMER_END(RMA, rma_winfence_wait);
+        }
+
+        if (assert & MPI_MODE_NOSUCCEED) {
+            win_ptr->fence_issued = 0;
+        }
 
         win_ptr->epoch_state = MPIDI_EPOCH_NONE;
     }
@@ -1407,12 +1288,12 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
         }
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FENCE);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -1423,16 +1304,16 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
 #define FUNCNAME create_datatype
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
+static int create_datatype(const MPIDI_RMA_dtype_info * dtype_info,
                            const void *dataloop, MPI_Aint dataloop_sz,
                            const void *o_addr, int o_count, MPI_Datatype o_datatype,
-                           MPID_Datatype **combined_dtp)
+                           MPID_Datatype ** combined_dtp)
 {
     int mpi_errno = MPI_SUCCESS;
     /* datatype_set_contents wants an array 'ints' which is the
-       blocklens array with count prepended to it.  So blocklens
-       points to the 2nd element of ints to avoid having to copy
-       blocklens into ints later. */
+     * blocklens array with count prepended to it.  So blocklens
+     * points to the 2nd element of ints to avoid having to copy
+     * blocklens into ints later. */
     int ints[4];
     int *blocklens = &ints[1];
     MPI_Aint displaces[3];
@@ -1447,54 +1328,46 @@ static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
     displaces[0] = MPIU_PtrToAint(dtype_info);
     blocklens[0] = sizeof(*dtype_info);
     datatypes[0] = MPI_BYTE;
-    
+
     displaces[1] = MPIU_PtrToAint(dataloop);
     MPIU_Assign_trunc(blocklens[1], dataloop_sz, int);
     datatypes[1] = MPI_BYTE;
-    
+
     displaces[2] = MPIU_PtrToAint(o_addr);
     blocklens[2] = o_count;
     datatypes[2] = o_datatype;
-    
-    mpi_errno = MPID_Type_struct(count,
-                                 blocklens,
-                                 displaces,
-                                 datatypes,
-                                 &combined_datatype);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-   
+
+    mpi_errno = MPID_Type_struct(count, blocklens, displaces, datatypes, &combined_datatype);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
+
     ints[0] = count;
 
-    MPID_Datatype_get_ptr(combined_datatype, *combined_dtp);    
-    mpi_errno = MPID_Datatype_set_contents(*combined_dtp,
-				           MPI_COMBINER_STRUCT,
-				           count+1, /* ints (cnt,blklen) */
-				           count, /* aints (disps) */
-				           count, /* types */
-				           ints,
-				           displaces,
-				           datatypes);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    MPID_Datatype_get_ptr(combined_datatype, *combined_dtp);
+    mpi_errno = MPID_Datatype_set_contents(*combined_dtp, MPI_COMBINER_STRUCT, count + 1,       /* ints (cnt,blklen) */
+                                           count,       /* aints (disps) */
+                                           count,       /* types */
+                                           ints, displaces, datatypes);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     /* Commit datatype */
-    
+
     MPID_Dataloop_create(combined_datatype,
                          &(*combined_dtp)->dataloop,
                          &(*combined_dtp)->dataloop_size,
-                         &(*combined_dtp)->dataloop_depth,
-                         MPID_DATALOOP_HOMOGENEOUS);
-    
+                         &(*combined_dtp)->dataloop_depth, MPID_DATALOOP_HOMOGENEOUS);
+
     /* create heterogeneous dataloop */
     MPID_Dataloop_create(combined_datatype,
                          &(*combined_dtp)->hetero_dloop,
                          &(*combined_dtp)->hetero_dloop_size,
-                         &(*combined_dtp)->hetero_dloop_depth,
-                         MPID_DATALOOP_HETEROGENEOUS);
- 
- fn_exit:
+                         &(*combined_dtp)->hetero_dloop_depth, MPID_DATALOOP_HETEROGENEOUS);
+
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_CREATE_DATATYPE);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -1503,24 +1376,23 @@ static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
 #define FUNCNAME send_rma_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
-                                   MPIDI_CH3_Pkt_flags_t flags,
-				   MPI_Win source_win_handle, 
-				   MPI_Win target_win_handle, 
-				   MPIDI_RMA_dtype_info *dtype_info, 
-				   void **dataloop, MPID_Request **request) 
+static int send_rma_msg(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
+                        MPIDI_CH3_Pkt_flags_t flags,
+                        MPI_Win source_win_handle,
+                        MPI_Win target_win_handle,
+                        MPIDI_RMA_dtype_info * dtype_info, void **dataloop, MPID_Request ** request)
 {
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_put_t *put_pkt = &upkt.put;
     MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum;
     MPID_IOV iov[MPID_IOV_LIMIT];
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     int origin_dt_derived, target_dt_derived, iovcnt;
     MPI_Aint origin_type_size;
-    MPIDI_VC_t * vc;
+    MPIDI_VC_t *vc;
     MPID_Comm *comm_ptr;
-    MPID_Datatype *target_dtp=NULL, *origin_dtp=NULL;
-    MPID_Request *resp_req=NULL;
+    MPID_Datatype *target_dtp = NULL, *origin_dtp = NULL;
+    MPID_Request *resp_req = NULL;
     MPIU_CHKPMEM_DECL(1);
     MPIDI_STATE_DECL(MPID_STATE_SEND_RMA_MSG);
     MPIDI_STATE_DECL(MPID_STATE_MEMCPY);
@@ -1529,8 +1401,7 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
 
     *request = NULL;
 
-    if (rma_op->type == MPIDI_RMA_PUT)
-    {
+    if (rma_op->type == MPIDI_RMA_PUT) {
         MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT);
         put_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
             win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
@@ -1540,15 +1411,14 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
         put_pkt->dataloop_size = 0;
         put_pkt->target_win_handle = target_win_handle;
         put_pkt->source_win_handle = source_win_handle;
-        
+
         iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) put_pkt;
         iov[0].MPID_IOV_LEN = sizeof(*put_pkt);
     }
-    else if (rma_op->type == MPIDI_RMA_GET_ACCUMULATE)
-    {
+    else if (rma_op->type == MPIDI_RMA_GET_ACCUMULATE) {
         /* Create a request for the GACC response.  Store the response buf, count, and
-           datatype in it, and pass the request's handle in the GACC packet. When the
-           response comes from the target, it will contain the request handle. */
+         * datatype in it, and pass the request's handle in the GACC packet. When the
+         * response comes from the target, it will contain the request handle. */
         resp_req = MPID_Request_create();
         MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
 
@@ -1565,7 +1435,7 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
             MPID_Datatype_get_ptr(resp_req->dev.datatype, result_dtp);
             resp_req->dev.datatype_ptr = result_dtp;
             /* this will cause the datatype to be freed when the
-               request is freed. */
+             * request is freed. */
         }
 
         /* Note: Get_accumulate uses the same packet type as accumulate */
@@ -1584,8 +1454,7 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
         iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) accum_pkt;
         iov[0].MPID_IOV_LEN = sizeof(*accum_pkt);
     }
-    else
-    {
+    else {
         MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_ACCUMULATE);
         accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
             win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
@@ -1602,35 +1471,30 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
     }
 
     /*    printf("send pkt: type %d, addr %d, count %d, base %d\n", rma_pkt->type,
-          rma_pkt->addr, rma_pkt->count, win_ptr->base_addrs[rma_op->target_rank]);
-          fflush(stdout);
-    */
+     * rma_pkt->addr, rma_pkt->count, win_ptr->base_addrs[rma_op->target_rank]);
+     * fflush(stdout);
+     */
 
     comm_ptr = win_ptr->comm_ptr;
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
 
-    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->origin_datatype))
-    {
+    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->origin_datatype)) {
         origin_dt_derived = 1;
         MPID_Datatype_get_ptr(rma_op->origin_datatype, origin_dtp);
     }
-    else
-    {
+    else {
         origin_dt_derived = 0;
     }
 
-    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->target_datatype))
-    {
+    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->target_datatype)) {
         target_dt_derived = 1;
         MPID_Datatype_get_ptr(rma_op->target_datatype, target_dtp);
     }
-    else
-    {
+    else {
         target_dt_derived = 0;
     }
 
-    if (target_dt_derived)
-    {
+    if (target_dt_derived) {
         /* derived datatype on target. fill derived datatype info */
         dtype_info->is_contig = target_dtp->is_contig;
         dtype_info->max_contig_blocks = target_dtp->max_contig_blocks;
@@ -1647,108 +1511,104 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
         dtype_info->has_sticky_ub = target_dtp->has_sticky_ub;
         dtype_info->has_sticky_lb = target_dtp->has_sticky_lb;
 
-	MPIU_CHKPMEM_MALLOC(*dataloop, void *, target_dtp->dataloop_size, 
-			    mpi_errno, "dataloop");
+        MPIU_CHKPMEM_MALLOC(*dataloop, void *, target_dtp->dataloop_size, mpi_errno, "dataloop");
 
-	MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY);
+        MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY);
         MPIU_Memcpy(*dataloop, target_dtp->dataloop, target_dtp->dataloop_size);
-	MPIDI_FUNC_EXIT(MPID_STATE_MEMCPY);
+        MPIDI_FUNC_EXIT(MPID_STATE_MEMCPY);
         /* the dataloop can have undefined padding sections, so we need to let
          * valgrind know that it is OK to pass this data to writev later on */
         MPL_VG_MAKE_MEM_DEFINED(*dataloop, target_dtp->dataloop_size);
 
-        if (rma_op->type == MPIDI_RMA_PUT)
-	{
+        if (rma_op->type == MPIDI_RMA_PUT) {
             put_pkt->dataloop_size = target_dtp->dataloop_size;
-	}
-        else
-	{
+        }
+        else {
             accum_pkt->dataloop_size = target_dtp->dataloop_size;
-	}
+        }
     }
 
     MPID_Datatype_get_size_macro(rma_op->origin_datatype, origin_type_size);
 
-    if (!target_dt_derived)
-    {
+    if (!target_dt_derived) {
         /* basic datatype on target */
-        if (!origin_dt_derived)
-        {
+        if (!origin_dt_derived) {
             /* basic datatype on origin */
-            iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rma_op->origin_addr;
+            iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) rma_op->origin_addr;
             iov[1].MPID_IOV_LEN = rma_op->origin_count * origin_type_size;
             iovcnt = 2;
-	    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
             mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, iovcnt, request);
-	    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
             MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
-        else
-        {
+        else {
             /* derived datatype on origin */
             *request = MPID_Request_create();
-            MPIU_ERR_CHKANDJUMP(*request == NULL,mpi_errno,MPI_ERR_OTHER,"**nomemreq");
-            
+            MPIU_ERR_CHKANDJUMP(*request == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
+
             MPIU_Object_set_ref(*request, 2);
             (*request)->kind = MPID_REQUEST_SEND;
-            
-            (*request)->dev.segment_ptr = MPID_Segment_alloc( );
-            MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+
+            (*request)->dev.segment_ptr = MPID_Segment_alloc();
+            MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER,
+                                 "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
             (*request)->dev.datatype_ptr = origin_dtp;
             /* this will cause the datatype to be freed when the request
-               is freed. */
+             * is freed. */
             MPID_Segment_init(rma_op->origin_addr, rma_op->origin_count,
-                              rma_op->origin_datatype,
-                              (*request)->dev.segment_ptr, 0);
+                              rma_op->origin_datatype, (*request)->dev.segment_ptr, 0);
             (*request)->dev.segment_first = 0;
             (*request)->dev.segment_size = rma_op->origin_count * origin_type_size;
 
             (*request)->dev.OnFinal = 0;
             (*request)->dev.OnDataAvail = 0;
 
-	    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
-            mpi_errno = vc->sendNoncontig_fn(vc, *request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN);
-	    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            mpi_errno =
+                vc->sendNoncontig_fn(vc, *request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN);
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
             MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
     }
-    else
-    {
+    else {
         /* derived datatype on target */
         MPID_Datatype *combined_dtp = NULL;
 
         *request = MPID_Request_create();
         if (*request == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
         }
 
         MPIU_Object_set_ref(*request, 2);
         (*request)->kind = MPID_REQUEST_SEND;
 
-	(*request)->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        (*request)->dev.segment_ptr = MPID_Segment_alloc();
+        MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER,
+                             "**nomem", "**nomem %s", "MPID_Segment_alloc");
 
         /* create a new datatype containing the dtype_info, dataloop, and origin data */
 
-        mpi_errno = create_datatype(dtype_info, *dataloop, target_dtp->dataloop_size, rma_op->origin_addr,
-                                    rma_op->origin_count, rma_op->origin_datatype, &combined_dtp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        mpi_errno =
+            create_datatype(dtype_info, *dataloop, target_dtp->dataloop_size, rma_op->origin_addr,
+                            rma_op->origin_count, rma_op->origin_datatype, &combined_dtp);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
 
         (*request)->dev.datatype_ptr = combined_dtp;
         /* combined_datatype will be freed when request is freed */
 
-        MPID_Segment_init(MPI_BOTTOM, 1, combined_dtp->handle,
-                          (*request)->dev.segment_ptr, 0);
+        MPID_Segment_init(MPI_BOTTOM, 1, combined_dtp->handle, (*request)->dev.segment_ptr, 0);
         (*request)->dev.segment_first = 0;
         (*request)->dev.segment_size = combined_dtp->size;
 
         (*request)->dev.OnFinal = 0;
         (*request)->dev.OnDataAvail = 0;
 
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = vc->sendNoncontig_fn(vc, *request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
         MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         /* we're done with the datatypes */
@@ -1758,28 +1618,29 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
     }
 
     /* This operation can generate two requests; one for inbound and one for
-       outbound data. */
+     * outbound data. */
     if (resp_req != NULL) {
         if (*request != NULL) {
             /* If we have both inbound and outbound requests (i.e. GACC
-               operation), we need to ensure that the source buffer is
-               available and that the response data has been received before
-               informing the origin that this operation is complete.  Because
-               the update needs to be done atomically at the target, they will
-               not send back data until it has been received.  Therefore,
-               completion of the response request implies that the send request
-               has completed.
-
-               Therefore: refs on the response request are set to two: one is
-               held by the progress engine and the other by the RMA op
-               completion code.  Refs on the outbound request are set to one;
-               it will be completed by the progress engine.
+             * operation), we need to ensure that the source buffer is
+             * available and that the response data has been received before
+             * informing the origin that this operation is complete.  Because
+             * the update needs to be done atomically at the target, they will
+             * not send back data until it has been received.  Therefore,
+             * completion of the response request implies that the send request
+             * has completed.
+             *
+             * Therefore: refs on the response request are set to two: one is
+             * held by the progress engine and the other by the RMA op
+             * completion code.  Refs on the outbound request are set to one;
+             * it will be completed by the progress engine.
              */
 
             MPID_Request_release(*request);
             *request = resp_req;
 
-        } else {
+        }
+        else {
             *request = resp_req;
         }
 
@@ -1787,17 +1648,16 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
         resp_req = NULL;
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKPMEM_COMMIT();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_RMA_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     if (resp_req) {
         MPID_Request_release(resp_req);
     }
-    if (*request)
-    {
+    if (*request) {
         MPIU_CHKPMEM_REAP();
         if ((*request)->dev.datatype_ptr)
             MPID_Datatype_release((*request)->dev.datatype_ptr);
@@ -1815,20 +1675,19 @@ static int send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
 #define FUNCNAME send_contig_acc_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
-					  MPID_Win *win_ptr,
-                                          MPIDI_CH3_Pkt_flags_t flags,
-					  MPI_Win source_win_handle, 
-					  MPI_Win target_win_handle, 
-					  MPID_Request **request) 
+static int send_contig_acc_msg(MPIDI_RMA_Op_t * rma_op,
+                               MPID_Win * win_ptr,
+                               MPIDI_CH3_Pkt_flags_t flags,
+                               MPI_Win source_win_handle,
+                               MPI_Win target_win_handle, MPID_Request ** request)
 {
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum;
     MPID_IOV iov[MPID_IOV_LIMIT];
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     int iovcnt;
     MPI_Aint origin_type_size;
-    MPIDI_VC_t * vc;
+    MPIDI_VC_t *vc;
     MPID_Comm *comm_ptr;
     size_t len;
     MPIDI_STATE_DECL(MPID_STATE_SEND_CONTIG_ACC_MSG);
@@ -1840,40 +1699,48 @@ static int send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
     MPID_Datatype_get_size_macro(rma_op->origin_datatype, origin_type_size);
     /* FIXME: Make this size check efficient and match the packet type */
     MPIU_Assign_trunc(len, rma_op->origin_count * origin_type_size, size_t);
-    if (MPIR_CVAR_CH3_RMA_ACC_IMMED && len <= MPIDI_RMA_IMMED_INTS*sizeof(int)) {
-	MPIDI_CH3_Pkt_accum_immed_t * accumi_pkt = &upkt.accum_immed;
-	void *dest = accumi_pkt->data, *src = rma_op->origin_addr;
-	
-	MPIDI_Pkt_init(accumi_pkt, MPIDI_CH3_PKT_ACCUM_IMMED);
-	accumi_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
-	    win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
+    if (MPIR_CVAR_CH3_RMA_ACC_IMMED && len <= MPIDI_RMA_IMMED_INTS * sizeof(int)) {
+        MPIDI_CH3_Pkt_accum_immed_t *accumi_pkt = &upkt.accum_immed;
+        void *dest = accumi_pkt->data, *src = rma_op->origin_addr;
+
+        MPIDI_Pkt_init(accumi_pkt, MPIDI_CH3_PKT_ACCUM_IMMED);
+        accumi_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
+            win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
         accumi_pkt->flags = flags;
-	accumi_pkt->count = rma_op->target_count;
-	accumi_pkt->datatype = rma_op->target_datatype;
-	accumi_pkt->op = rma_op->op;
-	accumi_pkt->target_win_handle = target_win_handle;
-	accumi_pkt->source_win_handle = source_win_handle;
-	
-	switch (len) {
-	case 1: *(uint8_t *)dest  = *(uint8_t *)src;  break;
-	case 2: *(uint16_t *)dest = *(uint16_t *)src; break;
-	case 4: *(uint32_t *)dest = *(uint32_t *)src; break;
-	case 8: *(uint64_t *)dest = *(uint64_t *)src; break;
-	default:
-	    MPIU_Memcpy( accumi_pkt->data, (void *)rma_op->origin_addr, len );
-	}
-	comm_ptr = win_ptr->comm_ptr;
-	MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
-	mpi_errno = MPIDI_CH3_iStartMsg(vc, accumi_pkt, sizeof(*accumi_pkt), request);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-	MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
-	goto fn_exit;
+        accumi_pkt->count = rma_op->target_count;
+        accumi_pkt->datatype = rma_op->target_datatype;
+        accumi_pkt->op = rma_op->op;
+        accumi_pkt->target_win_handle = target_win_handle;
+        accumi_pkt->source_win_handle = source_win_handle;
+
+        switch (len) {
+        case 1:
+            *(uint8_t *) dest = *(uint8_t *) src;
+            break;
+        case 2:
+            *(uint16_t *) dest = *(uint16_t *) src;
+            break;
+        case 4:
+            *(uint32_t *) dest = *(uint32_t *) src;
+            break;
+        case 8:
+            *(uint64_t *) dest = *(uint64_t *) src;
+            break;
+        default:
+            MPIU_Memcpy(accumi_pkt->data, (void *) rma_op->origin_addr, len);
+        }
+        comm_ptr = win_ptr->comm_ptr;
+        MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        mpi_errno = MPIDI_CH3_iStartMsg(vc, accumi_pkt, sizeof(*accumi_pkt), request);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+        MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        goto fn_exit;
     }
 
     MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_ACCUMULATE);
     accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] +
-	win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
+        win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
     accum_pkt->flags = flags;
     accum_pkt->count = rma_op->target_count;
     accum_pkt->datatype = rma_op->target_datatype;
@@ -1881,14 +1748,14 @@ static int send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
     accum_pkt->op = rma_op->op;
     accum_pkt->target_win_handle = target_win_handle;
     accum_pkt->source_win_handle = source_win_handle;
-    
+
     iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) accum_pkt;
     iov[0].MPID_IOV_LEN = sizeof(*accum_pkt);
 
     /*    printf("send pkt: type %d, addr %d, count %d, base %d\n", rma_pkt->type,
-          rma_pkt->addr, rma_pkt->count, win_ptr->base_addrs[rma_op->target_rank]);
-          fflush(stdout);
-    */
+     * rma_pkt->addr, rma_pkt->count, win_ptr->base_addrs[rma_op->target_rank]);
+     * fflush(stdout);
+     */
 
     comm_ptr = win_ptr->comm_ptr;
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
@@ -1897,24 +1764,23 @@ static int send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
     /* basic datatype on target */
     /* basic datatype on origin */
     /* FIXME: This is still very heavyweight for a small message operation,
-       such as a single word update */
-    /* One possibility is to use iStartMsg with a buffer that is just large 
-       enough, though note that nemesis has an optimization for this */
-    iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rma_op->origin_addr;
+     * such as a single word update */
+    /* One possibility is to use iStartMsg with a buffer that is just large
+     * enough, though note that nemesis has an optimization for this */
+    iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) rma_op->origin_addr;
     iov[1].MPID_IOV_LEN = rma_op->origin_count * origin_type_size;
     iovcnt = 2;
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, iovcnt, request);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_CONTIG_ACC_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
-    if (*request)
-    {
+  fn_fail:
+    if (*request) {
         MPID_Request_release(*request);
     }
     *request = NULL;
@@ -1930,12 +1796,11 @@ static int send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
 #define FUNCNAME send_immed_rmw_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
-                                         MPID_Win *win_ptr,
-                                         MPIDI_CH3_Pkt_flags_t flags,
-                                         MPI_Win source_win_handle, 
-                                         MPI_Win target_win_handle, 
-                                         MPID_Request **request) 
+static int send_immed_rmw_msg(MPIDI_RMA_Op_t * rma_op,
+                              MPID_Win * win_ptr,
+                              MPIDI_CH3_Pkt_flags_t flags,
+                              MPI_Win source_win_handle,
+                              MPI_Win target_win_handle, MPID_Request ** request)
 {
     int mpi_errno = MPI_SUCCESS;
     MPID_Request *rmw_req = NULL, *resp_req = NULL;
@@ -1949,14 +1814,14 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
     *request = NULL;
 
     /* Create a request for the RMW response.  Store the origin buf, count, and
-       datatype in it, and pass the request's handle RMW packet. When the
-       response comes from the target, it will contain the request handle. */
+     * datatype in it, and pass the request's handle RMW packet. When the
+     * response comes from the target, it will contain the request handle. */
     resp_req = MPID_Request_create();
     MPIU_ERR_CHKANDJUMP(resp_req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     *request = resp_req;
 
     /* Set refs on the request to 2: one for the response message, and one for
-       the partial completion handler */
+     * the partial completion handler */
     MPIU_Object_set_ref(resp_req, 2);
 
     resp_req->dev.user_buf = rma_op->result_addr;
@@ -1966,7 +1831,7 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
     resp_req->dev.source_win_handle = source_win_handle;
 
     /* REQUIRE: All datatype arguments must be of the same, builtin
-                type and counts must be 1. */
+     * type and counts must be 1. */
     MPID_Datatype_get_size_macro(rma_op->origin_datatype, len);
     comm_ptr = win_ptr->comm_ptr;
 
@@ -1985,13 +1850,13 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
         cas_pkt->target_win_handle = target_win_handle;
         cas_pkt->request_handle = resp_req->handle;
 
-        MPIU_Memcpy( (void *) &cas_pkt->origin_data, rma_op->origin_addr, len );
-        MPIU_Memcpy( (void *) &cas_pkt->compare_data, rma_op->compare_addr, len );
+        MPIU_Memcpy((void *) &cas_pkt->origin_data, rma_op->origin_addr, len);
+        MPIU_Memcpy((void *) &cas_pkt->compare_data, rma_op->compare_addr, len);
 
         MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_pkt, sizeof(*cas_pkt), &rmw_req);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
         MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
         if (rmw_req != NULL) {
@@ -2018,13 +1883,13 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
         if (len <= sizeof(fop_pkt->origin_data) || rma_op->op == MPI_NO_OP) {
             /* Embed FOP data in the packet header */
             if (rma_op->op != MPI_NO_OP) {
-                MPIU_Memcpy( fop_pkt->origin_data, rma_op->origin_addr, len );
+                MPIU_Memcpy(fop_pkt->origin_data, rma_op->origin_addr, len);
             }
 
             MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
-            MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
             mpi_errno = MPIDI_CH3_iStartMsg(vc, fop_pkt, sizeof(*fop_pkt), &rmw_req);
-            MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
             MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
             if (rmw_req != NULL) {
@@ -2042,15 +1907,15 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
             rmw_req->dev.OnFinal = 0;
             rmw_req->dev.OnDataAvail = 0;
 
-            iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)fop_pkt;
+            iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) fop_pkt;
             iov[0].MPID_IOV_LEN = sizeof(*fop_pkt);
-            iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rma_op->origin_addr;
-            iov[1].MPID_IOV_LEN = len; /* count == 1 */
+            iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) rma_op->origin_addr;
+            iov[1].MPID_IOV_LEN = len;  /* count == 1 */
 
             MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
-            MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
             mpi_errno = MPIDI_CH3_iSendv(vc, rmw_req, iov, 2);
-            MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
 
             MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
@@ -2059,11 +1924,11 @@ static int send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
         MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_IMMED_RMW_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     if (*request) {
         MPID_Request_release(*request);
     }
@@ -2081,17 +1946,16 @@ fn_fail:
 #define FUNCNAME recv_rma_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
-                                   MPIDI_CH3_Pkt_flags_t flags,
-				   MPI_Win source_win_handle, 
-				   MPI_Win target_win_handle, 
-				   MPIDI_RMA_dtype_info *dtype_info, 
-				   void **dataloop, MPID_Request **request) 
+static int recv_rma_msg(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
+                        MPIDI_CH3_Pkt_flags_t flags,
+                        MPI_Win source_win_handle,
+                        MPI_Win target_win_handle,
+                        MPIDI_RMA_dtype_info * dtype_info, void **dataloop, MPID_Request ** request)
 {
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_get_t *get_pkt = &upkt.get;
-    int mpi_errno=MPI_SUCCESS;
-    MPIDI_VC_t * vc;
+    int mpi_errno = MPI_SUCCESS;
+    MPIDI_VC_t *vc;
     MPID_Comm *comm_ptr;
     MPID_Request *req = NULL;
     MPID_Datatype *dtp;
@@ -2103,12 +1967,12 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_RECV_RMA_MSG);
 
     /* create a request, store the origin buf, cnt, datatype in it,
-       and pass a handle to it in the get packet. When the get
-       response comes from the target, it will contain the request
-       handle. */  
+     * and pass a handle to it in the get packet. When the get
+     * response comes from the target, it will contain the request
+     * handle. */
     req = MPID_Request_create();
     if (req == NULL) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     }
 
     *request = req;
@@ -2120,12 +1984,11 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
     req->dev.datatype = rma_op->origin_datatype;
     req->dev.target_win_handle = MPI_WIN_NULL;
     req->dev.source_win_handle = source_win_handle;
-    if (!MPIR_DATATYPE_IS_PREDEFINED(req->dev.datatype))
-    {
+    if (!MPIR_DATATYPE_IS_PREDEFINED(req->dev.datatype)) {
         MPID_Datatype_get_ptr(req->dev.datatype, dtp);
         req->dev.datatype_ptr = dtp;
         /* this will cause the datatype to be freed when the
-           request is freed. */  
+         * request is freed. */
     }
 
     MPIDI_Pkt_init(get_pkt, MPIDI_CH3_PKT_GET);
@@ -2142,21 +2005,19 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
            rma_pkt->addr, rma_pkt->count, win_ptr->base_addrs[rma_op->target_rank]);
     fflush(stdout);
 */
-	    
+
     comm_ptr = win_ptr->comm_ptr;
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
 
-    if (MPIR_DATATYPE_IS_PREDEFINED(rma_op->target_datatype))
-    {
+    if (MPIR_DATATYPE_IS_PREDEFINED(rma_op->target_datatype)) {
         /* basic datatype on target. simply send the get_pkt. */
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, get_pkt, sizeof(*get_pkt), &req);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     }
-    else
-    {
+    else {
         /* derived datatype on target. fill derived datatype info and
-           send it along with get_pkt. */
+         * send it along with get_pkt. */
 
         MPID_Datatype_get_ptr(rma_op->target_datatype, dtp);
         dtype_info->is_contig = dtp->is_contig;
@@ -2174,12 +2035,11 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
         dtype_info->has_sticky_ub = dtp->has_sticky_ub;
         dtype_info->has_sticky_lb = dtp->has_sticky_lb;
 
-	MPIU_CHKPMEM_MALLOC(*dataloop, void *, dtp->dataloop_size, 
-			    mpi_errno, "dataloop");
+        MPIU_CHKPMEM_MALLOC(*dataloop, void *, dtp->dataloop_size, mpi_errno, "dataloop");
 
-	MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY);
+        MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY);
         MPIU_Memcpy(*dataloop, dtp->dataloop, dtp->dataloop_size);
-	MPIDI_FUNC_EXIT(MPID_STATE_MEMCPY);
+        MPIDI_FUNC_EXIT(MPID_STATE_MEMCPY);
 
         /* the dataloop can have undefined padding sections, so we need to let
          * valgrind know that it is OK to pass this data to writev later on */
@@ -2187,37 +2047,36 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
 
         get_pkt->dataloop_size = dtp->dataloop_size;
 
-        iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)get_pkt;
+        iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_pkt;
         iov[0].MPID_IOV_LEN = sizeof(*get_pkt);
-        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)dtype_info;
+        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) dtype_info;
         iov[1].MPID_IOV_LEN = sizeof(*dtype_info);
-        iov[2].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)*dataloop;
+        iov[2].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) * dataloop;
         iov[2].MPID_IOV_LEN = dtp->dataloop_size;
 
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, 3, &req);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
 
         /* release the target datatype */
         MPID_Datatype_release(dtp);
     }
 
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     /* release the request returned by iStartMsg or iStartMsgv */
-    if (req != NULL)
-    {
+    if (req != NULL) {
         MPID_Request_release(req);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_RECV_RMA_MSG);
     return mpi_errno;
 
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
     /* --END ERROR HANDLING-- */
@@ -2228,9 +2087,9 @@ static int recv_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
 #define FUNCNAME MPIDI_Win_post
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_post(MPID_Group *post_grp_ptr, int assert, MPID_Win *win_ptr)
+int MPIDI_Win_post(MPID_Group * post_grp_ptr, int assert, MPID_Win * win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     MPID_Group *win_grp_ptr;
     int i, post_grp_size, *ranks_in_post_grp, *ranks_in_win_grp, dst, rank;
     MPID_Comm *win_comm_ptr;
@@ -2262,100 +2121,101 @@ int MPIDI_Win_post(MPID_Group *post_grp_ptr, int assert, MPID_Win *win_ptr)
      * we need to check whether there is a lock on the window, and if
      * there is a lock, poke the progress engine until the operations
      * have completed and the lock is therefore released. */
-    if (win_ptr->current_lock_type != MPID_LOCK_NONE)
-    {
-	MPID_Progress_state progress_state;
-	
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winpost_clearlock);
-	/* poke the progress engine */
-	MPID_Progress_start(&progress_state);
-	while (win_ptr->current_lock_type != MPID_LOCK_NONE)
-	{
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS) {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-	    }
-	    /* --END ERROR HANDLING-- */
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winpost_clearlock_aux, 1);
-	}
-	MPID_Progress_end(&progress_state);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winpost_clearlock);
-    }
-        
+    if (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+        MPID_Progress_state progress_state;
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winpost_clearlock);
+        /* poke the progress engine */
+        MPID_Progress_start(&progress_state);
+        while (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+            }
+            /* --END ERROR HANDLING-- */
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_winpost_clearlock_aux, 1);
+        }
+        MPID_Progress_end(&progress_state);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winpost_clearlock);
+    }
+
     post_grp_size = post_grp_ptr->size;
 
     /* Ensure ordering of load/store operations. */
     if (win_ptr->shm_allocated == TRUE) {
         OPA_read_write_barrier();
     }
-        
+
     /* initialize the completion counter */
     win_ptr->at_completion_counter += post_grp_size;
-        
-    if ((assert & MPI_MODE_NOCHECK) == 0)
-    {
+
+    if ((assert & MPI_MODE_NOCHECK) == 0) {
         MPI_Request *req;
         MPI_Status *status;
 
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winpost_sendsync);
- 
-	/* NOCHECK not specified. We need to notify the source
-	   processes that Post has been called. */  
-	
-	/* We need to translate the ranks of the processes in
-	   post_group to ranks in win_ptr->comm_ptr, so that we
-	   can do communication */
-            
-	MPIU_CHKLMEM_MALLOC(ranks_in_post_grp, int *, 
-			    post_grp_size * sizeof(int),
-			    mpi_errno, "ranks_in_post_grp");
-	MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, 
-			    post_grp_size * sizeof(int),
-			    mpi_errno, "ranks_in_win_grp");
-        
-	for (i=0; i<post_grp_size; i++)
-	{
-	    ranks_in_post_grp[i] = i;
-	}
-        
-	win_comm_ptr = win_ptr->comm_ptr;
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winpost_sendsync);
+
+        /* NOCHECK not specified. We need to notify the source
+         * processes that Post has been called. */
+
+        /* We need to translate the ranks of the processes in
+         * post_group to ranks in win_ptr->comm_ptr, so that we
+         * can do communication */
+
+        MPIU_CHKLMEM_MALLOC(ranks_in_post_grp, int *,
+                            post_grp_size * sizeof(int), mpi_errno, "ranks_in_post_grp");
+        MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *,
+                            post_grp_size * sizeof(int), mpi_errno, "ranks_in_win_grp");
+
+        for (i = 0; i < post_grp_size; i++) {
+            ranks_in_post_grp[i] = i;
+        }
+
+        win_comm_ptr = win_ptr->comm_ptr;
 
         mpi_errno = MPIR_Comm_group_impl(win_comm_ptr, &win_grp_ptr);
-	if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-	
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
+
 
         mpi_errno = MPIR_Group_translate_ranks_impl(post_grp_ptr, post_grp_size, ranks_in_post_grp,
                                                     win_grp_ptr, ranks_in_win_grp);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-	
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
+
         rank = win_ptr->comm_ptr->rank;
-	
-	MPIU_CHKLMEM_MALLOC(req, MPI_Request *, post_grp_size * sizeof(MPI_Request), mpi_errno, "req");
-        MPIU_CHKLMEM_MALLOC(status, MPI_Status *, post_grp_size*sizeof(MPI_Status), mpi_errno, "status");
-
-	/* Send a 0-byte message to the source processes */
-	MPIR_T_PVAR_COUNTER_INC(RMA, rma_winpost_sendsync_aux, post_grp_size);
-	for (i = 0; i < post_grp_size; i++) {
-	    dst = ranks_in_win_grp[i];
-
-	    /* FIXME: Short messages like this shouldn't normally need a 
-	       request - this should consider using the ch3 call to send
-	       a short message and return a request only if the message is
-	       not delivered. */
-	    if (dst != rank) {
+
+        MPIU_CHKLMEM_MALLOC(req, MPI_Request *, post_grp_size * sizeof(MPI_Request), mpi_errno,
+                            "req");
+        MPIU_CHKLMEM_MALLOC(status, MPI_Status *, post_grp_size * sizeof(MPI_Status), mpi_errno,
+                            "status");
+
+        /* Send a 0-byte message to the source processes */
+        MPIR_T_PVAR_COUNTER_INC(RMA, rma_winpost_sendsync_aux, post_grp_size);
+        for (i = 0; i < post_grp_size; i++) {
+            dst = ranks_in_win_grp[i];
+
+            /* FIXME: Short messages like this shouldn't normally need a
+             * request - this should consider using the ch3 call to send
+             * a short message and return a request only if the message is
+             * not delivered. */
+            if (dst != rank) {
                 MPID_Request *req_ptr;
-		mpi_errno = MPID_Isend(&i, 0, MPI_INT, dst, SYNC_POST_TAG, win_comm_ptr,
+                mpi_errno = MPID_Isend(&i, 0, MPI_INT, dst, SYNC_POST_TAG, win_comm_ptr,
                                        MPID_CONTEXT_INTRA_PT2PT, &req_ptr);
-		if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno)
+                    MPIU_ERR_POP(mpi_errno);
                 req[i] = req_ptr->handle;
-	    } else {
+            }
+            else {
                 req[i] = MPI_REQUEST_NULL;
             }
-	}
+        }
         mpi_errno = MPIR_Waitall_impl(post_grp_size, req, status);
-        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS)
+            MPIU_ERR_POP(mpi_errno);
 
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno == MPI_ERR_IN_STATUS) {
@@ -2369,22 +2229,23 @@ int MPIDI_Win_post(MPID_Group *post_grp_ptr, int assert, MPID_Win *win_ptr)
         /* --END ERROR HANDLING-- */
 
         mpi_errno = MPIR_Group_free_impl(win_grp_ptr);
-	if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winpost_sendsync);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winpost_sendsync);
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_POST);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
 
 
-static int recv_post_msgs(MPID_Win *win_ptr, int *ranks_in_win_grp, int local)
+static int recv_post_msgs(MPID_Win * win_ptr, int *ranks_in_win_grp, int local)
 {
     int mpi_errno = MPI_SUCCESS;
     int start_grp_size, src, rank, i, j;
@@ -2404,8 +2265,9 @@ static int recv_post_msgs(MPID_Win *win_ptr, int *ranks_in_win_grp, int local)
     start_grp_size = win_ptr->start_group_ptr->size;
 
     rank = win_ptr->comm_ptr->rank;
-    MPIU_CHKLMEM_MALLOC(req, MPI_Request *, start_grp_size*sizeof(MPI_Request), mpi_errno, "req");
-    MPIU_CHKLMEM_MALLOC(status, MPI_Status *, start_grp_size*sizeof(MPI_Status), mpi_errno, "status");
+    MPIU_CHKLMEM_MALLOC(req, MPI_Request *, start_grp_size * sizeof(MPI_Request), mpi_errno, "req");
+    MPIU_CHKLMEM_MALLOC(status, MPI_Status *, start_grp_size * sizeof(MPI_Status), mpi_errno,
+                        "status");
 
     j = 0;
     for (i = 0; i < start_grp_size; i++) {
@@ -2423,7 +2285,8 @@ static int recv_post_msgs(MPID_Win *win_ptr, int *ranks_in_win_grp, int local)
             if (orig_vc->node_id == target_vc->node_id) {
                 mpi_errno = MPID_Irecv(NULL, 0, MPI_INT, src, SYNC_POST_TAG,
                                        comm_ptr, MPID_CONTEXT_INTRA_PT2PT, &req_ptr);
-                if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+                if (mpi_errno)
+                    MPIU_ERR_POP(mpi_errno);
                 req[j++] = req_ptr->handle;
             }
         }
@@ -2445,7 +2308,8 @@ static int recv_post_msgs(MPID_Win *win_ptr, int *ranks_in_win_grp, int local)
 
     if (j) {
         mpi_errno = MPIR_Waitall_impl(j, req, status);
-        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno && mpi_errno != MPI_ERR_IN_STATUS)
+            MPIU_ERR_POP(mpi_errno);
         /* --BEGIN ERROR HANDLING-- */
         if (mpi_errno == MPI_ERR_IN_STATUS) {
             for (i = 0; i < j; i++) {
@@ -2458,13 +2322,13 @@ static int recv_post_msgs(MPID_Win *win_ptr, int *ranks_in_win_grp, int local)
         /* --END ERROR HANDLING-- */
     }
 
- fn_fail:
+  fn_fail:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_RECV_POST_MSGS);
     return mpi_errno;
 }
 
-static int fill_ranks_in_win_grp(MPID_Win *win_ptr, int *ranks_in_win_grp)
+static int fill_ranks_in_win_grp(MPID_Win * win_ptr, int *ranks_in_win_grp)
 {
     int mpi_errno = MPI_SUCCESS;
     int i, *ranks_in_start_grp;
@@ -2474,24 +2338,28 @@ static int fill_ranks_in_win_grp(MPID_Win *win_ptr, int *ranks_in_win_grp)
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_FILL_RANKS_IN_WIN_GRP);
 
-    MPIU_CHKLMEM_MALLOC(ranks_in_start_grp, int *, win_ptr->start_group_ptr->size*sizeof(int),
-			mpi_errno, "ranks_in_start_grp");
+    MPIU_CHKLMEM_MALLOC(ranks_in_start_grp, int *, win_ptr->start_group_ptr->size * sizeof(int),
+                        mpi_errno, "ranks_in_start_grp");
 
     for (i = 0; i < win_ptr->start_group_ptr->size; i++)
-	ranks_in_start_grp[i] = i;
+        ranks_in_start_grp[i] = i;
 
     mpi_errno = MPIR_Comm_group_impl(win_ptr->comm_ptr, &win_grp_ptr);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
-    mpi_errno = MPIR_Group_translate_ranks_impl(win_ptr->start_group_ptr, win_ptr->start_group_ptr->size,
-                                                ranks_in_start_grp,
-                                                win_grp_ptr, ranks_in_win_grp);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    mpi_errno =
+        MPIR_Group_translate_ranks_impl(win_ptr->start_group_ptr, win_ptr->start_group_ptr->size,
+                                        ranks_in_start_grp, win_grp_ptr, ranks_in_win_grp);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     mpi_errno = MPIR_Group_free_impl(win_grp_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
- fn_fail:
+  fn_fail:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_FILL_RANKS_IN_WIN_GRP);
     return mpi_errno;
@@ -2502,9 +2370,9 @@ static int fill_ranks_in_win_grp(MPID_Win *win_ptr, int *ranks_in_win_grp)
 #define FUNCNAME MPIDI_Win_start
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr)
+int MPIDI_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     int *ranks_in_win_grp;
     MPIU_CHKLMEM_DECL(1);
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_START);
@@ -2534,38 +2402,37 @@ int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr)
      * we need to check whether there is a lock on the window, and if
      * there is a lock, poke the progress engine until the operations
      * have completed and the lock is therefore released. */
-    if (win_ptr->current_lock_type != MPID_LOCK_NONE)
-    {
-	MPID_Progress_state progress_state;
-	
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winstart_clearlock);
-	/* poke the progress engine */
-	MPID_Progress_start(&progress_state);
-	while (win_ptr->current_lock_type != MPID_LOCK_NONE)
-	{
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS) {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-	    }
-	    /* --END ERROR HANDLING-- */
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winstart_clearlock_aux, 1);
-	}
-	MPID_Progress_end(&progress_state);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winstart_clearlock);
+    if (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+        MPID_Progress_state progress_state;
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winstart_clearlock);
+        /* poke the progress engine */
+        MPID_Progress_start(&progress_state);
+        while (win_ptr->current_lock_type != MPID_LOCK_NONE) {
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+            }
+            /* --END ERROR HANDLING-- */
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_winstart_clearlock_aux, 1);
+        }
+        MPID_Progress_end(&progress_state);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winstart_clearlock);
     }
-    
+
     win_ptr->start_group_ptr = group_ptr;
-    MPIR_Group_add_ref( group_ptr );
+    MPIR_Group_add_ref(group_ptr);
     win_ptr->start_assert = assert;
 
     /* wait for messages from local processes */
-    MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, win_ptr->start_group_ptr->size*sizeof(int),
-			mpi_errno, "ranks_in_win_grp");
+    MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, win_ptr->start_group_ptr->size * sizeof(int),
+                        mpi_errno, "ranks_in_win_grp");
 
     mpi_errno = fill_ranks_in_win_grp(win_ptr, ranks_in_win_grp);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     /* If MPI_MODE_NOCHECK was not specified, we need to check if
        Win_post was called on the target processes on SHM window.
@@ -2581,7 +2448,7 @@ int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr)
         OPA_read_write_barrier();
     }
 
- fn_fail:
+  fn_fail:
     MPIU_CHKLMEM_FREEALL();
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_START);
     return mpi_errno;
@@ -2593,7 +2460,7 @@ int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_complete
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_complete(MPID_Win *win_ptr)
+int MPIDI_Win_complete(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int comm_size, *nops_to_proc, new_total_op_count;
@@ -2622,187 +2489,191 @@ int MPIDI_Win_complete(MPID_Win *win_ptr)
 
     comm_ptr = win_ptr->comm_ptr;
     comm_size = comm_ptr->local_size;
-        
+
     /* Ensure ordering of load/store operations. */
     if (win_ptr->shm_allocated == TRUE) {
         OPA_read_write_barrier();
     }
 
     /* Translate the ranks of the processes in
-       start_group to ranks in win_ptr->comm_ptr */
-    
+     * start_group to ranks in win_ptr->comm_ptr */
+
     start_grp_size = win_ptr->start_group_ptr->size;
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_wincomplete_recvsync);
 
-    MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, start_grp_size*sizeof(int), 
-			mpi_errno, "ranks_in_win_grp");
-        
+    MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, start_grp_size * sizeof(int),
+                        mpi_errno, "ranks_in_win_grp");
+
     mpi_errno = fill_ranks_in_win_grp(win_ptr, ranks_in_win_grp);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     rank = win_ptr->comm_ptr->rank;
 
     /* If MPI_MODE_NOCHECK was not specified, we need to check if
-       Win_post was called on the target processes. Wait for a 0-byte sync
-       message from each target process */
-    if ((win_ptr->start_assert & MPI_MODE_NOCHECK) == 0)
-    {
+     * Win_post was called on the target processes. Wait for a 0-byte sync
+     * message from each target process */
+    if ((win_ptr->start_assert & MPI_MODE_NOCHECK) == 0) {
         /* wait for messages from non-local processes */
         mpi_errno = recv_post_msgs(win_ptr, ranks_in_win_grp, 0);
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
     }
     MPIR_T_PVAR_TIMER_END(RMA, rma_wincomplete_recvsync);
 
     /* keep track of no. of ops to each proc. Needed for knowing
-       whether or not to decrement the completion counter. The
-       completion counter is decremented only on the last
-       operation. */
+     * whether or not to decrement the completion counter. The
+     * completion counter is decremented only on the last
+     * operation. */
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_wincomplete_issue);
 
     /* Note, active target uses the following ops list, and passive
-       target uses win_ptr->targets[..] */
+     * target uses win_ptr->targets[..] */
     ops_list = &win_ptr->at_rma_ops_list;
 
-    MPIU_CHKLMEM_MALLOC(nops_to_proc, int *, comm_size*sizeof(int), 
-			mpi_errno, "nops_to_proc");
-    for (i=0; i<comm_size; i++) nops_to_proc[i] = 0;
+    MPIU_CHKLMEM_MALLOC(nops_to_proc, int *, comm_size * sizeof(int), mpi_errno, "nops_to_proc");
+    for (i = 0; i < comm_size; i++)
+        nops_to_proc[i] = 0;
 
     total_op_count = 0;
     curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
-    while (curr_ptr != NULL)
-    {
-	nops_to_proc[curr_ptr->target_rank]++;
-	total_op_count++;
-	curr_ptr = curr_ptr->next;
+    while (curr_ptr != NULL) {
+        nops_to_proc[curr_ptr->target_rank]++;
+        total_op_count++;
+        curr_ptr = curr_ptr->next;
     }
 
     MPIR_T_PVAR_COUNTER_INC(RMA, rma_wincomplete_issue_aux, total_op_count);
     MPIR_T_PVAR_ULONG2_HIGHWATERMARK_UPDATE(RMA, rma_wincomplete_issue_aux, total_op_count);
 
     /* We allocate a few extra requests because if there are no RMA
-       ops to a target process, we need to send a 0-byte message just
-       to decrement the completion counter. */
-        
-    MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size*sizeof(int),
-			mpi_errno, "curr_ops_cnt");
-    for (i=0; i<comm_size; i++) curr_ops_cnt[i] = 0;
-        
+     * ops to a target process, we need to send a 0-byte message just
+     * to decrement the completion counter. */
+
+    MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size * sizeof(int), mpi_errno, "curr_ops_cnt");
+    for (i = 0; i < comm_size; i++)
+        curr_ops_cnt[i] = 0;
+
     i = 0;
     curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
-    while (curr_ptr != NULL)
-    {
+    while (curr_ptr != NULL) {
         MPIDI_CH3_Pkt_flags_t flags = MPIDI_CH3_PKT_FLAG_NONE;
 
-	/* The completion counter at the target is decremented only on 
-	   the last RMA operation. */
-	if (curr_ops_cnt[curr_ptr->target_rank] ==
-	    nops_to_proc[curr_ptr->target_rank] - 1) {
+        /* The completion counter at the target is decremented only on
+         * the last RMA operation. */
+        if (curr_ops_cnt[curr_ptr->target_rank] == nops_to_proc[curr_ptr->target_rank] - 1) {
             flags = MPIDI_CH3_PKT_FLAG_RMA_AT_COMPLETE;
         }
 
         source_win_handle = win_ptr->handle;
-	target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank];
+        target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank];
 
-#define MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_) /* Not used by active mode */
-            MPIDI_CH3I_ISSUE_RMA_OP(curr_ptr, win_ptr, flags,
-                                    source_win_handle, target_win_handle, mpi_errno);
+#define MPIDI_CH3I_TRACK_RMA_WRITE(op_ptr_, win_ptr_)   /* Not used by active mode */
+        MPIDI_CH3I_ISSUE_RMA_OP(curr_ptr, win_ptr, flags,
+                                source_win_handle, target_win_handle, mpi_errno);
 #undef MPIDI_CH3I_TRACK_RMA_WRITE
 
-	i++;
-	curr_ops_cnt[curr_ptr->target_rank]++;
-	/* If the request is null, we can remove it immediately */
-	if (!curr_ptr->request) {
+        i++;
+        curr_ops_cnt[curr_ptr->target_rank]++;
+        /* If the request is null, we can remove it immediately */
+        if (!curr_ptr->request) {
             MPIDI_CH3I_RMA_Ops_free_and_next(ops_list, &curr_ptr);
-	}
-	else  {
-	    nRequest++;
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_wincomplete_reqs, 1);
-	    curr_ptr    = curr_ptr->next;
-	    if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
-		nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
-		int nDone = 0;
+        }
+        else {
+            nRequest++;
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_wincomplete_reqs, 1);
+            curr_ptr = curr_ptr->next;
+            if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
+                nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
+                int nDone = 0;
                 mpi_errno = poke_progress_engine();
-                if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-            MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_complete));
-            MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_wincomplete_complete_aux));
+                if (mpi_errno != MPI_SUCCESS)
+                    MPIU_ERR_POP(mpi_errno);
+                MPIR_T_PVAR_STMT(RMA, list_complete_timer =
+                                 MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_complete));
+                MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                                 MPIR_T_PVAR_COUNTER_ADDR(rma_wincomplete_complete_aux));
                 mpi_errno = rma_list_gc(win_ptr, ops_list, curr_ptr, &nDone);
-                if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-		nRequest -= nDone;
-		nRequestNew = nRequest;
-	    }
-	}
+                if (mpi_errno != MPI_SUCCESS)
+                    MPIU_ERR_POP(mpi_errno);
+                nRequest -= nDone;
+                nRequestNew = nRequest;
+            }
+        }
     }
     MPIR_T_PVAR_TIMER_END(RMA, rma_wincomplete_issue);
-        
+
     /* If the start_group included some processes that did not end up
-       becoming targets of  RMA operations from this process, we need
-       to send a dummy message to those processes just to decrement
-       the completion counter */
-        
+     * becoming targets of  RMA operations from this process, we need
+     * to send a dummy message to those processes just to decrement
+     * the completion counter */
+
     j = i;
     new_total_op_count = total_op_count;
-    for (i=0; i<start_grp_size; i++)
-    {
-	dst = ranks_in_win_grp[i];
-	if (dst == rank) {
-	    /* FIXME: MT: this has to be done atomically */
-	    win_ptr->at_completion_counter -= 1;
-	}
-	else if (nops_to_proc[dst] == 0)
-	{
-	    MPIDI_CH3_Pkt_t upkt;
-	    MPIDI_CH3_Pkt_put_t *put_pkt = &upkt.put;
-	    MPIDI_VC_t * vc;
-	    MPID_Request *request;
-	    
-	    MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT);
+    for (i = 0; i < start_grp_size; i++) {
+        dst = ranks_in_win_grp[i];
+        if (dst == rank) {
+            /* FIXME: MT: this has to be done atomically */
+            win_ptr->at_completion_counter -= 1;
+        }
+        else if (nops_to_proc[dst] == 0) {
+            MPIDI_CH3_Pkt_t upkt;
+            MPIDI_CH3_Pkt_put_t *put_pkt = &upkt.put;
+            MPIDI_VC_t *vc;
+            MPID_Request *request;
+
+            MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT);
             put_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_AT_COMPLETE;
-	    put_pkt->addr = NULL;
-	    put_pkt->count = 0;
-	    put_pkt->datatype = MPI_INT;
-	    put_pkt->target_win_handle = win_ptr->all_win_handles[dst];
-	    put_pkt->source_win_handle = win_ptr->handle;
-	    
-	    MPIDI_Comm_get_vc_set_active(comm_ptr, dst, &vc);
-	    
-	    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
-	    mpi_errno = MPIDI_CH3_iStartMsg(vc, put_pkt, sizeof(*put_pkt), &request);
-	    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-	    if (mpi_errno != MPI_SUCCESS) {
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg" );
-	    }
-	    /* In the unlikely event that a request is returned (the message
-	       is not sent yet), add it to the list of pending operations */
-	    if (request) {
+            put_pkt->addr = NULL;
+            put_pkt->count = 0;
+            put_pkt->datatype = MPI_INT;
+            put_pkt->target_win_handle = win_ptr->all_win_handles[dst];
+            put_pkt->source_win_handle = win_ptr->handle;
+
+            MPIDI_Comm_get_vc_set_active(comm_ptr, dst, &vc);
+
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+            mpi_errno = MPIDI_CH3_iStartMsg(vc, put_pkt, sizeof(*put_pkt), &request);
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+            if (mpi_errno != MPI_SUCCESS) {
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+            }
+            /* In the unlikely event that a request is returned (the message
+             * is not sent yet), add it to the list of pending operations */
+            if (request) {
                 MPIDI_RMA_Op_t *new_ptr = NULL;
 
                 MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_alloc);
                 mpi_errno = MPIDI_CH3I_RMA_Ops_alloc_tail(ops_list, &new_ptr);
                 MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_alloc);
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                if (mpi_errno) {
+                    MPIU_ERR_POP(mpi_errno);
+                }
 
-		MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
-		new_ptr->request  = request;
-		MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
-	    }
-	    j++;
-	    new_total_op_count++;
-	}
+                MPIR_T_PVAR_TIMER_START(RMA, rma_rmaqueue_set);
+                new_ptr->request = request;
+                MPIR_T_PVAR_TIMER_END(RMA, rma_rmaqueue_set);
+            }
+            j++;
+            new_total_op_count++;
+        }
     }
 
-    if (new_total_op_count)
-    {
-        MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_complete));
-        MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_wincomplete_complete_aux));
-        MPIR_T_PVAR_STMT(RMA, list_block_timer=MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_block));
+    if (new_total_op_count) {
+        MPIR_T_PVAR_STMT(RMA, list_complete_timer =
+                         MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_complete));
+        MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                         MPIR_T_PVAR_COUNTER_ADDR(rma_wincomplete_complete_aux));
+        MPIR_T_PVAR_STMT(RMA, list_block_timer = MPIR_T_PVAR_TIMER_ADDR(rma_wincomplete_block));
         mpi_errno = rma_list_complete(win_ptr, ops_list);
-        if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno != MPI_SUCCESS)
+            MPIU_ERR_POP(mpi_errno);
     }
 
     MPIU_Assert(MPIDI_CH3I_RMA_Ops_isempty(ops_list));
-    
+
     /* free the group stored in window */
     MPIR_Group_release(win_ptr->start_group_ptr);
     win_ptr->start_group_ptr = NULL; 
@@ -2812,7 +2683,7 @@ int MPIDI_Win_complete(MPID_Win *win_ptr)
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_COMPLETE);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -2823,9 +2694,9 @@ int MPIDI_Win_complete(MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_wait
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_wait(MPID_Win *win_ptr)
+int MPIDI_Win_wait(MPID_Win * win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_WAIT);
 
@@ -2842,39 +2713,36 @@ int MPIDI_Win_wait(MPID_Win *win_ptr)
         win_ptr->epoch_state = MPIDI_EPOCH_NONE;
 
     /* wait for all operations from other processes to finish */
-    if (win_ptr->at_completion_counter)
-    {
-	MPID_Progress_state progress_state;
-	
-	MPIR_T_PVAR_TIMER_START(RMA, rma_winwait_wait);
-	MPID_Progress_start(&progress_state);
-	while (win_ptr->at_completion_counter)
-	{
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS)
-	    {
-		MPID_Progress_end(&progress_state);
-		MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_WAIT);
-		return mpi_errno;
-	    }
-	    /* --END ERROR HANDLING-- */
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winwait_wait_aux, 1);
-	}
-	MPID_Progress_end(&progress_state);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_winwait_wait);
-    } 
+    if (win_ptr->at_completion_counter) {
+        MPID_Progress_state progress_state;
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_winwait_wait);
+        MPID_Progress_start(&progress_state);
+        while (win_ptr->at_completion_counter) {
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_WAIT);
+                return mpi_errno;
+            }
+            /* --END ERROR HANDLING-- */
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_winwait_wait_aux, 1);
+        }
+        MPID_Progress_end(&progress_state);
+        MPIR_T_PVAR_TIMER_END(RMA, rma_winwait_wait);
+    }
 
     /* Ensure ordering of load/store operations. */
     if (win_ptr->shm_allocated == TRUE) {
         OPA_read_write_barrier();
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_WAIT);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -2883,9 +2751,9 @@ int MPIDI_Win_wait(MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_test
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_test(MPID_Win *win_ptr, int *flag)
+int MPIDI_Win_test(MPID_Win * win_ptr, int *flag)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_TEST);
 
@@ -2897,7 +2765,7 @@ int MPIDI_Win_test(MPID_Win *win_ptr, int *flag)
 
     mpi_errno = MPID_Progress_test();
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+        MPIU_ERR_POP(mpi_errno);
     }
 
     *flag = (win_ptr->at_completion_counter) ? 0 : 1;
@@ -2915,11 +2783,11 @@ int MPIDI_Win_test(MPID_Win *win_ptr, int *flag)
         }
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_TEST);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -2931,7 +2799,7 @@ int MPIDI_Win_test(MPID_Win *win_ptr, int *flag)
 #define FUNCNAME MPIDI_Win_lock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
+int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     struct MPIDI_Win_target_state *target_state;
@@ -2948,7 +2816,8 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
      * synchronization, we cannot do this because fence_issued must be
      * updated collectively */
 
-    if (dest == MPI_PROC_NULL) goto fn_exit;
+    if (dest == MPI_PROC_NULL)
+        goto fn_exit;
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_NONE &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK,
@@ -2966,8 +2835,8 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
         win_ptr->epoch_state = MPIDI_EPOCH_LOCK;
     }
 
-    target_state->remote_lock_state  = MPIDI_CH3_WIN_LOCK_CALLED;
-    target_state->remote_lock_mode   = lock_type;
+    target_state->remote_lock_state = MPIDI_CH3_WIN_LOCK_CALLED;
+    target_state->remote_lock_mode = lock_type;
     target_state->remote_lock_assert = assert;
 
     if (dest == win_ptr->comm_ptr->rank) {
@@ -2975,7 +2844,9 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
          * is acquired.  Once it is acquired, local puts, gets, accumulates
          * will be done directly without queueing. */
         mpi_errno = acquire_local_lock(win_ptr, lock_type);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
     else if (win_ptr->shm_allocated == TRUE) {
         /* Lock must be taken immediately for shared memory windows because of
@@ -2983,29 +2854,34 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
 
         if (win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
             /* check if target is local and shared memory is allocated on window,
-               if so, we directly send lock request and wait for lock reply. */
+             * if so, we directly send lock request and wait for lock reply. */
 
             /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-               the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-               not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-               which is only set to TRUE when SHM region is allocated in nemesis.
-               In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-            */
+             * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+             * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+             * which is only set to TRUE when SHM region is allocated in nemesis.
+             * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+             */
             MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
             MPIDI_Comm_get_vc(win_ptr->comm_ptr, dest, &target_vc);
         }
 
-        if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || orig_vc->node_id == target_vc->node_id) {
+        if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
+            orig_vc->node_id == target_vc->node_id) {
             mpi_errno = send_lock_msg(dest, lock_type, win_ptr);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
 
             mpi_errno = wait_for_lock_granted(win_ptr, dest);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
     }
     else if (MPIR_CVAR_CH3_RMA_LOCK_IMMED && ((assert & MPI_MODE_NOCHECK) == 0)) {
         /* TODO: Make this mode of operation available through an assert
-           argument or info key. */
+         * argument or info key. */
         mpi_errno = send_lock_msg(dest, lock_type, win_ptr);
         MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
     }
@@ -3015,11 +2891,11 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
         OPA_read_write_barrier();
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_LOCK);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3028,16 +2904,17 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_unlock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr)
+int MPIDI_Win_unlock(int dest, MPID_Win * win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
     int single_op_opt = 0;
     MPIDI_RMA_Op_t *rma_op;
     int wait_for_rma_done_pkt = 0;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_UNLOCK);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_UNLOCK);
 
-    if (dest == MPI_PROC_NULL) goto fn_exit;
+    if (dest == MPI_PROC_NULL)
+        goto fn_exit;
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_LOCK &&
                         win_ptr->epoch_state != MPIDI_EPOCH_LOCK_ALL,
@@ -3059,29 +2936,31 @@ int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr)
     }
 
     if (dest == win_ptr->comm_ptr->rank) {
-	/* local lock. release the lock on the window, grant the next one
-	 * in the queue, and return. */
+        /* local lock. release the lock on the window, grant the next one
+         * in the queue, and return. */
         MPIU_Assert(MPIDI_CH3I_RMA_Ops_isempty(&win_ptr->targets[dest].rma_ops_list));
 
         /* NOTE: We don't need to signal completion here becase a thread in the
          * same processes cannot lock the window again while it is already
          * locked. */
-	mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
         win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
 
-	mpi_errno = MPID_Progress_poke();
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
-	goto fn_exit;
+        mpi_errno = MPID_Progress_poke();
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
+        goto fn_exit;
     }
-        
+
     rma_op = MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[dest].rma_ops_list);
 
     /* Lock was called, but the lock was not requested and there are no ops to
      * perform.  Do nothing and return. */
-    if (rma_op == NULL &&
-        win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED)
-    {
+    if (rma_op == NULL && win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED) {
         win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
         goto fn_exit;
     }
@@ -3089,110 +2968,112 @@ int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr)
     /* TODO: MPI-3: Add lock->cas/fop/gacc->unlock optimization.  */
     /* TODO: MPI-3: Add lock_all->op optimization. */
     /* LOCK-OP-UNLOCK Optimization -- This optimization can't be used if we
-       have already requested the lock. */
-    if ( MPIR_CVAR_CH3_RMA_MERGE_LOCK_OP_UNLOCK &&
-         win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED &&
-         rma_op && rma_op->next == NULL /* There is only one op */ &&
-         rma_op->type != MPIDI_RMA_COMPARE_AND_SWAP &&
-         rma_op->type != MPIDI_RMA_FETCH_AND_OP &&
-         rma_op->type != MPIDI_RMA_GET_ACCUMULATE )
-    {
-	/* Single put, get, or accumulate between the lock and unlock. If it
-	 * is of small size and predefined datatype at the target, we
-	 * do an optimization where the lock and the RMA operation are
-	 * sent in a single packet. Otherwise, we send a separate lock
-	 * request first. */
+     * have already requested the lock. */
+    if (MPIR_CVAR_CH3_RMA_MERGE_LOCK_OP_UNLOCK &&
+        win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED &&
+        rma_op && rma_op->next == NULL /* There is only one op */  &&
+        rma_op->type != MPIDI_RMA_COMPARE_AND_SWAP &&
+        rma_op->type != MPIDI_RMA_FETCH_AND_OP && rma_op->type != MPIDI_RMA_GET_ACCUMULATE) {
+        /* Single put, get, or accumulate between the lock and unlock. If it
+         * is of small size and predefined datatype at the target, we
+         * do an optimization where the lock and the RMA operation are
+         * sent in a single packet. Otherwise, we send a separate lock
+         * request first. */
         MPI_Aint type_size;
         MPIDI_VC_t *vc;
         MPIDI_RMA_Op_t *curr_op = rma_op;
 
         MPIDI_Comm_get_vc_set_active(win_ptr->comm_ptr, dest, &vc);
 
-	MPID_Datatype_get_size_macro(curr_op->origin_datatype, type_size);
-
-	/* msg_sz typically = 65480 */
-	if (MPIR_DATATYPE_IS_PREDEFINED(curr_op->target_datatype) &&
-	     (type_size * curr_op->origin_count <= vc->eager_max_msg_sz) ) {
-	    single_op_opt = 1;
-	    /* Set the lock granted flag to 1 */
-	    win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
-	    if (curr_op->type == MPIDI_RMA_GET) {
-		mpi_errno = send_lock_get(win_ptr, dest);
-		wait_for_rma_done_pkt = 0;
-	    }
-	    else {
-		mpi_errno = send_lock_put_or_acc(win_ptr, dest);
-		wait_for_rma_done_pkt = 1;
-	    }
-	    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
-	}
-    }
-        
+        MPID_Datatype_get_size_macro(curr_op->origin_datatype, type_size);
+
+        /* msg_sz typically = 65480 */
+        if (MPIR_DATATYPE_IS_PREDEFINED(curr_op->target_datatype) &&
+            (type_size * curr_op->origin_count <= vc->eager_max_msg_sz)) {
+            single_op_opt = 1;
+            /* Set the lock granted flag to 1 */
+            win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
+            if (curr_op->type == MPIDI_RMA_GET) {
+                mpi_errno = send_lock_get(win_ptr, dest);
+                wait_for_rma_done_pkt = 0;
+            }
+            else {
+                mpi_errno = send_lock_put_or_acc(win_ptr, dest);
+                wait_for_rma_done_pkt = 1;
+            }
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
+        }
+    }
+
     if (single_op_opt == 0) {
 
         /* Send a lock packet over to the target and wait for the lock_granted
-           reply. If the user gave MODE_NOCHECK, we will piggyback the lock
-           request on the first RMA op.  Then do all the RMA ops. */
+         * reply. If the user gave MODE_NOCHECK, we will piggyback the lock
+         * request on the first RMA op.  Then do all the RMA ops. */
 
-        if ((win_ptr->targets[dest].remote_lock_assert & MPI_MODE_NOCHECK) == 0)
-        {
+        if ((win_ptr->targets[dest].remote_lock_assert & MPI_MODE_NOCHECK) == 0) {
             if (win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED) {
-                mpi_errno = send_lock_msg(dest, win_ptr->targets[dest].remote_lock_mode,
-                                                     win_ptr);
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                mpi_errno = send_lock_msg(dest, win_ptr->targets[dest].remote_lock_mode, win_ptr);
+                if (mpi_errno) {
+                    MPIU_ERR_POP(mpi_errno);
+                }
             }
         }
 
         if (win_ptr->targets[dest].remote_lock_state == MPIDI_CH3_WIN_LOCK_REQUESTED) {
             mpi_errno = wait_for_lock_granted(win_ptr, dest);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
 
-	/* Now do all the RMA operations */
+        /* Now do all the RMA operations */
         mpi_errno = do_passive_target_rma(win_ptr, dest, &wait_for_rma_done_pkt,
-                                                     MPIDI_CH3_PKT_FLAG_RMA_UNLOCK);
-	if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                                          MPIDI_CH3_PKT_FLAG_RMA_UNLOCK);
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
-        
+
     /* If the lock is a shared lock or we have done the single op
-       optimization, we need to wait until the target informs us that
-       all operations are done on the target.  This ensures that third-
-       party communication can be done safely.  */
+     * optimization, we need to wait until the target informs us that
+     * all operations are done on the target.  This ensures that third-
+     * party communication can be done safely.  */
     if (wait_for_rma_done_pkt == 1) {
-        /* wait until the "pt rma done" packet is received from the 
-           target. This packet resets the remote_lock_state flag back to
-           NONE. */
+        /* wait until the "pt rma done" packet is received from the
+         * target. This packet resets the remote_lock_state flag back to
+         * NONE. */
 
         /* poke the progress engine until remote_lock_state flag is reset to NONE */
-        if (win_ptr->targets[dest].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE)
-	{
-	    MPID_Progress_state progress_state;
-	    
-	    MPID_Progress_start(&progress_state);
-            while (win_ptr->targets[dest].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE)
-	    {
-		mpi_errno = MPID_Progress_wait(&progress_state);
-		/* --BEGIN ERROR HANDLING-- */
-		if (mpi_errno != MPI_SUCCESS) {
-		    MPID_Progress_end(&progress_state);
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-		}
-		/* --END ERROR HANDLING-- */
-	    }
-	    MPID_Progress_end(&progress_state);
-	}
+        if (win_ptr->targets[dest].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE) {
+            MPID_Progress_state progress_state;
+
+            MPID_Progress_start(&progress_state);
+            while (win_ptr->targets[dest].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE) {
+                mpi_errno = MPID_Progress_wait(&progress_state);
+                /* --BEGIN ERROR HANDLING-- */
+                if (mpi_errno != MPI_SUCCESS) {
+                    MPID_Progress_end(&progress_state);
+                    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+                }
+                /* --END ERROR HANDLING-- */
+            }
+            MPID_Progress_end(&progress_state);
+        }
     }
     else {
         win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
     }
-    
+
     MPIU_Assert(MPIDI_CH3I_RMA_Ops_isempty(&win_ptr->targets[dest].rma_ops_list));
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_UNLOCK);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3202,7 +3083,7 @@ int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_flush_all
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_flush_all(MPID_Win *win_ptr)
+int MPIDI_Win_flush_all(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int i;
@@ -3222,26 +3103,28 @@ int MPIDI_Win_flush_all(MPID_Win *win_ptr)
      * should poke the progress engine when the local target is flushed to help
      * make asynchronous progress.  Currently this is handled by Win_flush().
      */
-     for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
-         if (MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[i].rma_ops_list) == NULL)
-             continue;
+    for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
+        if (MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[i].rma_ops_list) == NULL)
+            continue;
         if (win_ptr->targets[i].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE) {
             mpi_errno = win_ptr->RMAFns.Win_flush(i, win_ptr);
-            if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+            if (mpi_errno != MPI_SUCCESS) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
     }
 
-     /* Ensure that all shared memory operations are flushed out.  The memory
-      * barriers in the flush are not sufficient since we skip calling flush
-      * when all operations are already completed. */
-     if (win_ptr->shm_allocated == TRUE)
-         OPA_read_write_barrier();
+    /* Ensure that all shared memory operations are flushed out.  The memory
+     * barriers in the flush are not sufficient since we skip calling flush
+     * when all operations are already completed. */
+    if (win_ptr->shm_allocated == TRUE)
+        OPA_read_write_barrier();
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPIDI_STATE_MPIDI_WIN_FLUSH_ALL);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3251,7 +3134,7 @@ int MPIDI_Win_flush_all(MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_flush
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_flush(int rank, MPID_Win *win_ptr)
+int MPIDI_Win_flush(int rank, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int wait_for_rma_done_pkt = 0;
@@ -3282,32 +3165,29 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr)
          * deadlock, since local RMA calls never poke the progress engine.  So,
          * make extra progress here to avoid this problem. */
         mpi_errno = MPIDI_CH3_Progress_poke();
-        if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno)
+            MPIU_ERR_POP(mpi_errno);
         goto fn_exit;
     }
 
     /* NOTE: All flush and req-based operations are currently implemented in
-       terms of MPIDI_Win_flush.  When this changes, those operations will also
-       need to insert this read/write memory fence for shared memory windows. */
+     * terms of MPIDI_Win_flush.  When this changes, those operations will also
+     * need to insert this read/write memory fence for shared memory windows. */
 
     rma_op = MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[rank].rma_ops_list);
 
     /* If there is no activity at this target (e.g. lock-all was called, but we
      * haven't communicated with this target), don't do anything. */
-    if (win_ptr->targets[rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED
-        && rma_op == NULL)
-    {
+    if (win_ptr->targets[rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED && rma_op == NULL) {
         goto fn_exit;
     }
 
     /* MT: If another thread is performing a flush, wait for them to finish. */
-    if (win_ptr->targets[rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_FLUSH)
-    {
+    if (win_ptr->targets[rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_FLUSH) {
         MPID_Progress_state progress_state;
 
         MPID_Progress_start(&progress_state);
-        while (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED)
-        {
+        while (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED) {
             mpi_errno = MPID_Progress_wait(&progress_state);
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno != MPI_SUCCESS) {
@@ -3320,38 +3200,42 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr)
     }
 
     /* Send a lock packet over to the target, wait for the lock_granted
-       reply, and perform the RMA ops. */
+     * reply, and perform the RMA ops. */
 
     if (win_ptr->targets[rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED) {
         mpi_errno = send_lock_msg(rank, win_ptr->targets[rank].remote_lock_mode, win_ptr);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     if (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED) {
         mpi_errno = wait_for_lock_granted(win_ptr, rank);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     win_ptr->targets[rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_FLUSH;
     mpi_errno = do_passive_target_rma(win_ptr, rank, &wait_for_rma_done_pkt,
-                                                 MPIDI_CH3_PKT_FLAG_RMA_FLUSH);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                                      MPIDI_CH3_PKT_FLAG_RMA_FLUSH);
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
     /* If the lock is a shared lock or we have done the single op optimization,
-       we need to wait until the target informs us that all operations are done
-       on the target.  This ensures that third-party communication can be done
-       safely.  */
+     * we need to wait until the target informs us that all operations are done
+     * on the target.  This ensures that third-party communication can be done
+     * safely.  */
     if (wait_for_rma_done_pkt == 1) {
         /* wait until the "pt rma done" packet is received from the target.
-           This packet resets the remote_lock_state flag. */
+         * This packet resets the remote_lock_state flag. */
 
-        if (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED)
-        {
+        if (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED) {
             MPID_Progress_state progress_state;
 
             MPID_Progress_start(&progress_state);
-            while (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED)
-            {
+            while (win_ptr->targets[rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_GRANTED) {
                 mpi_errno = MPID_Progress_wait(&progress_state);
                 /* --BEGIN ERROR HANDLING-- */
                 if (mpi_errno != MPI_SUCCESS) {
@@ -3367,11 +3251,11 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr)
         win_ptr->targets[rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FLUSH);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3381,7 +3265,7 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr)
 #define FUNCNAME MPIDI_Win_flush_local
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_flush_local(int rank, MPID_Win *win_ptr)
+int MPIDI_Win_flush_local(int rank, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_FLUSH_LOCAL);
@@ -3398,13 +3282,15 @@ int MPIDI_Win_flush_local(int rank, MPID_Win *win_ptr)
      */
 
     mpi_errno = win_ptr->RMAFns.Win_flush(rank, win_ptr);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FLUSH_LOCAL);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3414,7 +3300,7 @@ fn_fail:
 #define FUNCNAME MPIDI_Win_flush_local_all
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_flush_local_all(MPID_Win *win_ptr)
+int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_FLUSH_LOCAL_ALL);
@@ -3431,13 +3317,15 @@ int MPIDI_Win_flush_local_all(MPID_Win *win_ptr)
      */
 
     mpi_errno = win_ptr->RMAFns.Win_flush_all(win_ptr);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FLUSH_LOCAL_ALL);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3447,7 +3335,7 @@ fn_fail:
 #define FUNCNAME MPIDI_Win_lock_all
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_lock_all(int assert, MPID_Win *win_ptr)
+int MPIDI_Win_lock_all(int assert, MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_VC_t *orig_vc, *target_vc;
@@ -3467,63 +3355,73 @@ int MPIDI_Win_lock_all(int assert, MPID_Win *win_ptr)
     for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
         MPIU_Assert(win_ptr->targets[i].remote_lock_state == MPIDI_CH3_WIN_LOCK_NONE);
 
-        win_ptr->targets[i].remote_lock_state  = MPIDI_CH3_WIN_LOCK_CALLED;
-        win_ptr->targets[i].remote_lock_mode   = MPI_LOCK_SHARED;
+        win_ptr->targets[i].remote_lock_state = MPIDI_CH3_WIN_LOCK_CALLED;
+        win_ptr->targets[i].remote_lock_mode = MPI_LOCK_SHARED;
         win_ptr->targets[i].remote_lock_assert = assert;
     }
 
     /* Immediately lock the local process for load/store access */
     mpi_errno = acquire_local_lock(win_ptr, MPI_LOCK_SHARED);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
     if (win_ptr->shm_allocated == TRUE) {
         /* Immediately lock all targets for load/store access */
 
         for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
             /* Local process is already locked */
-            if (i == win_ptr->comm_ptr->rank) continue;
+            if (i == win_ptr->comm_ptr->rank)
+                continue;
 
             if (win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
                 /* check if target is local and shared memory is allocated on window,
-                   if so, we directly send lock request and wait for lock reply. */
+                 * if so, we directly send lock request and wait for lock reply. */
 
                 /* FIXME: Here we decide whether to perform SHM operations by checking if origin and target are on
-                   the same node. However, in ch3:sock, even if origin and target are on the same node, they do
-                   not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
-                   which is only set to TRUE when SHM region is allocated in nemesis.
-                   In future we need to figure out a way to check if origin and target are in the same "SHM comm".
-                */
+                 * the same node. However, in ch3:sock, even if origin and target are on the same node, they do
+                 * not within the same SHM region. Here we filter out ch3:sock by checking shm_allocated flag first,
+                 * which is only set to TRUE when SHM region is allocated in nemesis.
+                 * In future we need to figure out a way to check if origin and target are in the same "SHM comm".
+                 */
                 MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
                 MPIDI_Comm_get_vc(win_ptr->comm_ptr, i, &target_vc);
             }
 
-            if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || orig_vc->node_id == target_vc->node_id) {
+            if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
+                orig_vc->node_id == target_vc->node_id) {
                 mpi_errno = send_lock_msg(i, MPI_LOCK_SHARED, win_ptr);
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                if (mpi_errno) {
+                    MPIU_ERR_POP(mpi_errno);
+                }
             }
         }
 
         for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
             /* Local process is already locked */
-            if (i == win_ptr->comm_ptr->rank) continue;
+            if (i == win_ptr->comm_ptr->rank)
+                continue;
 
             if (win_ptr->create_flavor != MPI_WIN_FLAVOR_SHARED) {
                 MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc);
                 MPIDI_Comm_get_vc(win_ptr->comm_ptr, i, &target_vc);
             }
 
-            if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || orig_vc->node_id == target_vc->node_id) {
+            if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED ||
+                orig_vc->node_id == target_vc->node_id) {
                 mpi_errno = wait_for_lock_granted(win_ptr, i);
-                if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                if (mpi_errno) {
+                    MPIU_ERR_POP(mpi_errno);
+                }
             }
         }
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_LOCK_ALL);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3533,7 +3431,7 @@ fn_fail:
 #define FUNCNAME MPIDI_Win_unlock_all
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_unlock_all(MPID_Win *win_ptr)
+int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int i;
@@ -3549,17 +3447,19 @@ int MPIDI_Win_unlock_all(MPID_Win *win_ptr)
 
     for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) {
         mpi_errno = win_ptr->RMAFns.Win_unlock(i, win_ptr);
-        if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
     }
 
     /* Track access epoch state */
     win_ptr->epoch_state = MPIDI_EPOCH_NONE;
 
-fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_UNLOCK_ALL);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3569,7 +3469,7 @@ fn_fail:
 #define FUNCNAME MPIDI_Win_sync
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_Win_sync(MPID_Win *win_ptr)
+int MPIDI_Win_sync(MPID_Win * win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_WIN_SYNC);
@@ -3582,11 +3482,11 @@ int MPIDI_Win_sync(MPID_Win *win_ptr)
 
     OPA_read_write_barrier();
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_SYNC);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3596,13 +3496,13 @@ int MPIDI_Win_sync(MPID_Win *win_ptr)
 #define FUNCNAME do_passive_target_rma
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
-                                            int *wait_for_rma_done_pkt, MPIDI_CH3_Pkt_flags_t sync_flags)
+static int do_passive_target_rma(MPID_Win * win_ptr, int target_rank,
+                                 int *wait_for_rma_done_pkt, MPIDI_CH3_Pkt_flags_t sync_flags)
 {
     int mpi_errno = MPI_SUCCESS, nops;
     MPIDI_RMA_Op_t *curr_ptr;
     MPI_Win source_win_handle = MPI_WIN_NULL, target_win_handle = MPI_WIN_NULL;
-    int nRequest=0, nRequestNew=0;
+    int nRequest = 0, nRequestNew = 0;
     MPIDI_STATE_DECL(MPID_STATE_DO_PASSIVE_TARGET_RMA);
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_DO_PASSIVE_TARGET_RMA);
@@ -3616,55 +3516,55 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
         win_ptr->targets[target_rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_CALLED &&
         win_ptr->targets[target_rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_FLUSH) {
         /* Exclusive lock already held -- no need to wait for rma done pkt at
-           the end.  This is because the target won't grant another process
-           access to the window until all of our operations complete at that
-           target.  Thus, there is no third-party communication issue.
-           However, flush still needs to wait for rma done, otherwise result
-           may be unknown if user reads the updated location from a shared window of
-           another target process after this flush. */
+         * the end.  This is because the target won't grant another process
+         * access to the window until all of our operations complete at that
+         * target.  Thus, there is no third-party communication issue.
+         * However, flush still needs to wait for rma done, otherwise result
+         * may be unknown if user reads the updated location from a shared window of
+         * another target process after this flush. */
         *wait_for_rma_done_pkt = 0;
     }
     else if (MPIDI_CH3I_RMA_Ops_isempty(&win_ptr->targets[target_rank].rma_ops_list)) {
         /* The ops list is empty -- NOTE: we assume this is because the epoch
-           was flushed.  Any issued ops are already remote complete; done
-           packet is not needed for safe third party communication. */
+         * was flushed.  Any issued ops are already remote complete; done
+         * packet is not needed for safe third party communication. */
         *wait_for_rma_done_pkt = 0;
     }
     else {
         MPIDI_RMA_Op_t *tail = MPIDI_CH3I_RMA_Ops_tail(&win_ptr->targets[target_rank].rma_ops_list);
 
         /* Check if we can piggyback the RMA done acknowlegdement on the last
-           operation in the epoch. */
+         * operation in the epoch. */
 
         if (tail->type == MPIDI_RMA_GET ||
             tail->type == MPIDI_RMA_COMPARE_AND_SWAP ||
-            tail->type == MPIDI_RMA_FETCH_AND_OP ||
-            tail->type == MPIDI_RMA_GET_ACCUMULATE)
-        {
+            tail->type == MPIDI_RMA_FETCH_AND_OP || tail->type == MPIDI_RMA_GET_ACCUMULATE) {
             /* last operation sends a response message. no need to wait
-               for an additional rma done pkt */
+             * for an additional rma done pkt */
             *wait_for_rma_done_pkt = 0;
         }
         else {
             /* Check if there is a get operation, which can be be performed
-               moved to the end to piggyback the RMA done acknowledgement.  Go
-               through the list and move the first get operation (if there is
-               one) to the end. */
-            
+             * moved to the end to piggyback the RMA done acknowledgement.  Go
+             * through the list and move the first get operation (if there is
+             * one) to the end. */
+
             *wait_for_rma_done_pkt = 1;
             curr_ptr = MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[target_rank].rma_ops_list);
-            
+
             while (curr_ptr != NULL) {
                 if (curr_ptr->type == MPIDI_RMA_GET) {
-		    /* Found a GET, move it to the end */
+                    /* Found a GET, move it to the end */
                     *wait_for_rma_done_pkt = 0;
 
-                    MPIDI_CH3I_RMA_Ops_unlink(&win_ptr->targets[target_rank].rma_ops_list, curr_ptr);
-                    MPIDI_CH3I_RMA_Ops_append(&win_ptr->targets[target_rank].rma_ops_list, curr_ptr);
+                    MPIDI_CH3I_RMA_Ops_unlink(&win_ptr->targets[target_rank].rma_ops_list,
+                                              curr_ptr);
+                    MPIDI_CH3I_RMA_Ops_append(&win_ptr->targets[target_rank].rma_ops_list,
+                                              curr_ptr);
                     break;
                 }
                 else {
-                    curr_ptr    = curr_ptr->next;
+                    curr_ptr = curr_ptr->next;
                 }
             }
         }
@@ -3686,8 +3586,7 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
         target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank];
     }
 
-    while (curr_ptr != NULL)
-    {
+    while (curr_ptr != NULL) {
         MPIDI_CH3_Pkt_flags_t flags = MPIDI_CH3_PKT_FLAG_NONE;
 
         /* Assertion: (curr_ptr != NULL) => (nops > 0) */
@@ -3695,21 +3594,20 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
         MPIU_Assert(curr_ptr->target_rank == target_rank);
 
         /* Piggyback the lock operation on the first op */
-        if (win_ptr->targets[target_rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED)
-        {
+        if (win_ptr->targets[target_rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_CALLED) {
             MPIU_Assert(win_ptr->targets[target_rank].remote_lock_assert & MPI_MODE_NOCHECK);
             flags |= MPIDI_CH3_PKT_FLAG_RMA_LOCK | MPIDI_CH3_PKT_FLAG_RMA_NOCHECK;
 
             switch (win_ptr->targets[target_rank].remote_lock_mode) {
-                case MPI_LOCK_SHARED:
-                    flags |= MPIDI_CH3_PKT_FLAG_RMA_SHARED;
-                    break;
-                case MPI_LOCK_EXCLUSIVE:
-                    flags |= MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE;
-                    break;
-                default:
-                    MPIU_Assert(0);
-                    break;
+            case MPI_LOCK_SHARED:
+                flags |= MPIDI_CH3_PKT_FLAG_RMA_SHARED;
+                break;
+            case MPI_LOCK_EXCLUSIVE:
+                flags |= MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE;
+                break;
+            default:
+                MPIU_Assert(0);
+                break;
             }
 
             win_ptr->targets[target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
@@ -3719,9 +3617,11 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
         if (curr_ptr->next == NULL) {
             if (sync_flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
                 flags |= MPIDI_CH3_PKT_FLAG_RMA_UNLOCK;
-            } else if (sync_flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
+            }
+            else if (sync_flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
                 flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH;
-            } else {
+            }
+            else {
                 MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_RMA_SYNC, "**ch3|sync_arg",
                                      "**ch3|sync_arg %d", sync_flags);
             }
@@ -3745,50 +3645,58 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
                                 target_win_handle, mpi_errno);
 #undef MPIDI_CH3I_TRACK_RMA_WRITE
 
-	/* If the request is null, we can remove it immediately */
-	if (!curr_ptr->request) {
-            MPIDI_CH3I_RMA_Ops_free_and_next(&win_ptr->targets[target_rank].rma_ops_list, &curr_ptr);
-	}
-	else  {
-	    nRequest++;
-	    MPIR_T_PVAR_COUNTER_INC(RMA, rma_winunlock_reqs, 1);
-	    curr_ptr    = curr_ptr->next;
-	    if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
-		nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
-		int nDone = 0;
+        /* If the request is null, we can remove it immediately */
+        if (!curr_ptr->request) {
+            MPIDI_CH3I_RMA_Ops_free_and_next(&win_ptr->targets[target_rank].rma_ops_list,
+                                             &curr_ptr);
+        }
+        else {
+            nRequest++;
+            MPIR_T_PVAR_COUNTER_INC(RMA, rma_winunlock_reqs, 1);
+            curr_ptr = curr_ptr->next;
+            if (nRequest > MPIR_CVAR_CH3_RMA_NREQUEST_THRESHOLD &&
+                nRequest - nRequestNew > MPIR_CVAR_CH3_RMA_NREQUEST_NEW_THRESHOLD) {
+                int nDone = 0;
                 mpi_errno = poke_progress_engine();
-                if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-		MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_complete));
-		MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_winunlock_complete_aux));
-                mpi_errno = rma_list_gc(win_ptr,
-                                                  &win_ptr->targets[target_rank].rma_ops_list,
-                                                  curr_ptr, &nDone);
-                if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-		/* if (nDone > 0) printf( "nDone = %d\n", nDone ); */
-		nRequest -= nDone;
-		nRequestNew = nRequest;
-	    }
-	}
+                if (mpi_errno != MPI_SUCCESS)
+                    MPIU_ERR_POP(mpi_errno);
+                MPIR_T_PVAR_STMT(RMA, list_complete_timer =
+                                 MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_complete));
+                MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                                 MPIR_T_PVAR_COUNTER_ADDR(rma_winunlock_complete_aux));
+                mpi_errno =
+                    rma_list_gc(win_ptr, &win_ptr->targets[target_rank].rma_ops_list, curr_ptr,
+                                &nDone);
+                if (mpi_errno != MPI_SUCCESS)
+                    MPIU_ERR_POP(mpi_errno);
+                /* if (nDone > 0) printf("nDone = %d\n", nDone); */
+                nRequest -= nDone;
+                nRequestNew = nRequest;
+            }
+        }
     }
     MPIR_T_PVAR_TIMER_END(RMA, rma_winunlock_issue);
-    
-    if (nops)
-    {
-        MPIR_T_PVAR_STMT(RMA, list_complete_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_complete));
-        MPIR_T_PVAR_STMT(RMA, list_block_timer=MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_block));
-        MPIR_T_PVAR_STMT(RMA, list_complete_counter=MPIR_T_PVAR_COUNTER_ADDR(rma_winunlock_complete_aux));
+
+    if (nops) {
+        MPIR_T_PVAR_STMT(RMA, list_complete_timer = MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_complete));
+        MPIR_T_PVAR_STMT(RMA, list_block_timer = MPIR_T_PVAR_TIMER_ADDR(rma_winunlock_block));
+        MPIR_T_PVAR_STMT(RMA, list_complete_counter =
+                         MPIR_T_PVAR_COUNTER_ADDR(rma_winunlock_complete_aux));
         mpi_errno = rma_list_complete(win_ptr, &win_ptr->targets[target_rank].rma_ops_list);
-        if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+        if (mpi_errno != MPI_SUCCESS)
+            MPIU_ERR_POP(mpi_errno);
     }
     else if (sync_flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
         /* No communication operations were left to process, but the RMA epoch
-           is open.  Send an unlock message to release the lock at the target.  */
+         * is open.  Send an unlock message to release the lock at the target.  */
         mpi_errno = send_unlock_msg(target_rank, win_ptr);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
         *wait_for_rma_done_pkt = 1;
     }
     /* NOTE: Flush -- If RMA ops are issued eagerly, Send_flush_msg should be
-       called here and wait_for_rma_done_pkt should be set. */
+     * called here and wait_for_rma_done_pkt should be set. */
 
     /* MT: avoid processing unissued operations enqueued by other threads
        in rma_list_complete() */
@@ -3797,11 +3705,11 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
         goto fn_exit;
     MPIU_Assert(MPIDI_CH3I_RMA_Ops_isempty(&win_ptr->targets[target_rank].rma_ops_list));
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_DO_PASSIVE_TARGET_RMA);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3811,11 +3719,12 @@ static int do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
 #define FUNCNAME send_lock_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_lock_msg(int dest, int lock_type, MPID_Win *win_ptr) {
+static int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
+{
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_lock_t *lock_pkt = &upkt.lock;
-    MPID_Request *req=NULL;
+    MPID_Request *req = NULL;
     MPIDI_VC_t *vc;
     MPIDI_STATE_DECL(MPID_STATE_SEND_LOCK_MSG);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_LOCK_MSG);
@@ -3832,9 +3741,9 @@ static int send_lock_msg(int dest, int lock_type, MPID_Win *win_ptr) {
     win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_REQUESTED;
     win_ptr->targets[dest].remote_lock_mode = lock_type;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_pkt, sizeof(*lock_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* release the request returned by iStartMsg */
@@ -3842,11 +3751,11 @@ static int send_lock_msg(int dest, int lock_type, MPID_Win *win_ptr) {
         MPID_Request_release(req);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_LOCK_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3856,25 +3765,24 @@ static int send_lock_msg(int dest, int lock_type, MPID_Win *win_ptr) {
 #define FUNCNAME acquire_local_lock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int acquire_local_lock(MPID_Win *win_ptr, int lock_type) {
+static int acquire_local_lock(MPID_Win * win_ptr, int lock_type)
+{
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_ACQUIRE_LOCAL_LOCK);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_ACQUIRE_LOCAL_LOCK);
 
     /* poke the progress engine until the local lock is granted */
-    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0)
-    {
+    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0) {
         MPID_Progress_state progress_state;
 
         MPIR_T_PVAR_TIMER_START(RMA, rma_winlock_getlocallock);
         MPID_Progress_start(&progress_state);
-        while (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0)
-        {
+        while (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0) {
             mpi_errno = MPID_Progress_wait(&progress_state);
             /* --BEGIN ERROR HANDLING-- */
             if (mpi_errno != MPI_SUCCESS) {
                 MPID_Progress_end(&progress_state);
-                MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
             }
             /* --END ERROR HANDLING-- */
         }
@@ -3885,11 +3793,11 @@ static int acquire_local_lock(MPID_Win *win_ptr, int lock_type) {
     win_ptr->targets[win_ptr->comm_ptr->rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
     win_ptr->targets[win_ptr->comm_ptr->rank].remote_lock_mode = lock_type;
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_ACQUIRE_LOCAL_LOCK);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3899,7 +3807,8 @@ fn_fail:
 #define FUNCNAME wait_for_lock_granted
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int wait_for_lock_granted(MPID_Win *win_ptr, int target_rank) {
+static int wait_for_lock_granted(MPID_Win * win_ptr, int target_rank)
+{
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_WAIT_FOR_LOCK_GRANTED);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_WAIT_FOR_LOCK_GRANTED);
@@ -3931,11 +3840,11 @@ static int wait_for_lock_granted(MPID_Win *win_ptr, int target_rank) {
         MPIR_T_PVAR_TIMER_END(RMA, rma_winunlock_getlock);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_WAIT_FOR_LOCK_GRANTED);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3945,11 +3854,12 @@ fn_fail:
 #define FUNCNAME send_unlock_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_unlock_msg(int dest, MPID_Win *win_ptr) {
+static int send_unlock_msg(int dest, MPID_Win * win_ptr)
+{
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_unlock_t *unlock_pkt = &upkt.unlock;
-    MPID_Request *req=NULL;
+    MPID_Request *req = NULL;
     MPIDI_VC_t *vc;
     MPIDI_STATE_DECL(MPID_STATE_SEND_UNLOCK_MSG);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_UNLOCK_MSG);
@@ -3967,9 +3877,9 @@ static int send_unlock_msg(int dest, MPID_Win *win_ptr) {
     /* Reset the local state of the target to unlocked */
     win_ptr->targets[dest].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, unlock_pkt, sizeof(*unlock_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* Release the request returned by iStartMsg */
@@ -3977,11 +3887,11 @@ static int send_unlock_msg(int dest, MPID_Win *win_ptr) {
         MPID_Request_release(req);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_UNLOCK_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -3994,11 +3904,12 @@ static int send_unlock_msg(int dest, MPID_Win *win_ptr) {
 #define FUNCNAME send_flush_msg
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_flush_msg(int dest, MPID_Win *win_ptr) {
+static int send_flush_msg(int dest, MPID_Win * win_ptr)
+{
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_flush_t *flush_pkt = &upkt.flush;
-    MPID_Request *req=NULL;
+    MPID_Request *req = NULL;
     MPIDI_VC_t *vc;
     MPIDI_STATE_DECL(MPID_STATE_SEND_FLUSH_MSG);
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_FLUSH_MSG);
@@ -4011,9 +3922,9 @@ static int send_flush_msg(int dest, MPID_Win *win_ptr) {
     flush_pkt->target_win_handle = win_ptr->all_win_handles[dest];
     flush_pkt->source_win_handle = win_ptr->handle;
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, flush_pkt, sizeof(*flush_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
     /* Release the request returned by iStartMsg */
@@ -4021,11 +3932,11 @@ static int send_flush_msg(int dest, MPID_Win *win_ptr) {
         MPID_Request_release(req);
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_FLUSH_MSG);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -4036,22 +3947,20 @@ static int send_flush_msg(int dest, MPID_Win *win_ptr) {
 #define FUNCNAME send_lock_put_or_acc
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
+static int send_lock_put_or_acc(MPID_Win * win_ptr, int target_rank)
 {
-    int mpi_errno=MPI_SUCCESS, lock_type, origin_dt_derived, iovcnt;
+    int mpi_errno = MPI_SUCCESS, lock_type, origin_dt_derived, iovcnt;
     MPIDI_RMA_Op_t *rma_op;
-    MPID_Request *request=NULL;
-    MPIDI_VC_t * vc;
+    MPID_Request *request = NULL;
+    MPIDI_VC_t *vc;
     MPID_IOV iov[MPID_IOV_LIMIT];
     MPID_Comm *comm_ptr;
-    MPID_Datatype *origin_dtp=NULL;
+    MPID_Datatype *origin_dtp = NULL;
     MPI_Aint origin_type_size;
     MPIDI_CH3_Pkt_t upkt;
-    MPIDI_CH3_Pkt_lock_put_unlock_t *lock_put_unlock_pkt = 
-	&upkt.lock_put_unlock;
-    MPIDI_CH3_Pkt_lock_accum_unlock_t *lock_accum_unlock_pkt = 
-	&upkt.lock_accum_unlock;
-        
+    MPIDI_CH3_Pkt_lock_put_unlock_t *lock_put_unlock_pkt = &upkt.lock_put_unlock;
+    MPIDI_CH3_Pkt_lock_accum_unlock_t *lock_accum_unlock_pkt = &upkt.lock_accum_unlock;
+
     MPIDI_STATE_DECL(MPID_STATE_SEND_LOCK_PUT_OR_ACC);
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_SEND_LOCK_PUT_OR_ACC);
@@ -4066,35 +3975,33 @@ static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
         MPIDI_Pkt_init(lock_put_unlock_pkt, MPIDI_CH3_PKT_LOCK_PUT_UNLOCK);
         lock_put_unlock_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_LOCK |
             MPIDI_CH3_PKT_FLAG_RMA_UNLOCK | MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK;
-        lock_put_unlock_pkt->target_win_handle = 
-            win_ptr->all_win_handles[rma_op->target_rank];
+        lock_put_unlock_pkt->target_win_handle = win_ptr->all_win_handles[rma_op->target_rank];
         lock_put_unlock_pkt->source_win_handle = win_ptr->handle;
         lock_put_unlock_pkt->lock_type = lock_type;
- 
-        lock_put_unlock_pkt->addr = 
+
+        lock_put_unlock_pkt->addr =
             (char *) win_ptr->base_addrs[rma_op->target_rank] +
             win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
-        
+
         lock_put_unlock_pkt->count = rma_op->target_count;
         lock_put_unlock_pkt->datatype = rma_op->target_datatype;
 
         iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) lock_put_unlock_pkt;
         iov[0].MPID_IOV_LEN = sizeof(*lock_put_unlock_pkt);
     }
-    
-    else if (rma_op->type == MPIDI_RMA_ACCUMULATE) {        
+
+    else if (rma_op->type == MPIDI_RMA_ACCUMULATE) {
         MPIDI_Pkt_init(lock_accum_unlock_pkt, MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK);
         lock_accum_unlock_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_LOCK |
             MPIDI_CH3_PKT_FLAG_RMA_UNLOCK | MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK;
-        lock_accum_unlock_pkt->target_win_handle = 
-            win_ptr->all_win_handles[rma_op->target_rank];
+        lock_accum_unlock_pkt->target_win_handle = win_ptr->all_win_handles[rma_op->target_rank];
         lock_accum_unlock_pkt->source_win_handle = win_ptr->handle;
         lock_accum_unlock_pkt->lock_type = lock_type;
 
-        lock_accum_unlock_pkt->addr = 
+        lock_accum_unlock_pkt->addr =
             (char *) win_ptr->base_addrs[rma_op->target_rank] +
             win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
-        
+
         lock_accum_unlock_pkt->count = rma_op->target_count;
         lock_accum_unlock_pkt->datatype = rma_op->target_datatype;
         lock_accum_unlock_pkt->op = rma_op->op;
@@ -4106,15 +4013,14 @@ static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
         MPIDI_Pkt_init(lock_accum_unlock_pkt, MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK);
         lock_accum_unlock_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_LOCK |
             MPIDI_CH3_PKT_FLAG_RMA_UNLOCK | MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK;
-        lock_accum_unlock_pkt->target_win_handle = 
-            win_ptr->all_win_handles[rma_op->target_rank];
+        lock_accum_unlock_pkt->target_win_handle = win_ptr->all_win_handles[rma_op->target_rank];
         lock_accum_unlock_pkt->source_win_handle = win_ptr->handle;
         lock_accum_unlock_pkt->lock_type = lock_type;
 
-        lock_accum_unlock_pkt->addr = 
+        lock_accum_unlock_pkt->addr =
             (char *) win_ptr->base_addrs[rma_op->target_rank] +
             win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
-        
+
         lock_accum_unlock_pkt->count = rma_op->target_count;
         lock_accum_unlock_pkt->datatype = rma_op->target_datatype;
         lock_accum_unlock_pkt->op = rma_op->op;
@@ -4123,107 +4029,99 @@ static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
         iov[0].MPID_IOV_LEN = sizeof(*lock_accum_unlock_pkt);
     }
     else {
-	/* FIXME: Error return */
-	printf( "expected short accumulate...\n" );
-	/* */
+        /* FIXME: Error return */
+        printf("expected short accumulate...\n");
+        /* */
     }
 
     comm_ptr = win_ptr->comm_ptr;
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
 
-    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->origin_datatype))
-    {
+    if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->origin_datatype)) {
         origin_dt_derived = 1;
         MPID_Datatype_get_ptr(rma_op->origin_datatype, origin_dtp);
     }
-    else
-    {
+    else {
         origin_dt_derived = 0;
     }
 
     MPID_Datatype_get_size_macro(rma_op->origin_datatype, origin_type_size);
 
-    if (!origin_dt_derived)
-    {
-	/* basic datatype on origin */
+    if (!origin_dt_derived) {
+        /* basic datatype on origin */
 
-        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rma_op->origin_addr;
+        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) rma_op->origin_addr;
         iov[1].MPID_IOV_LEN = rma_op->origin_count * origin_type_size;
         iovcnt = 2;
 
-	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = MPIDI_CH3_iStartMsgv(vc, iov, iovcnt, &request);
-	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
         if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
         }
     }
-    else
-    {
-	/* derived datatype on origin */
+    else {
+        /* derived datatype on origin */
 
         iovcnt = 1;
 
         request = MPID_Request_create();
         if (request == NULL) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
         }
 
         MPIU_Object_set_ref(request, 2);
         request->kind = MPID_REQUEST_SEND;
-	    
+
         request->dev.datatype_ptr = origin_dtp;
         /* this will cause the datatype to be freed when the request
-           is freed. */ 
+         * is freed. */
 
-	request->dev.segment_ptr = MPID_Segment_alloc( );
-        MPIU_ERR_CHKANDJUMP1(request->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc");
+        request->dev.segment_ptr = MPID_Segment_alloc();
+        MPIU_ERR_CHKANDJUMP1(request->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem",
+                             "**nomem %s", "MPID_Segment_alloc");
 
         MPID_Segment_init(rma_op->origin_addr, rma_op->origin_count,
-                          rma_op->origin_datatype,
-                          request->dev.segment_ptr, 0);
+                          rma_op->origin_datatype, request->dev.segment_ptr, 0);
         request->dev.segment_first = 0;
         request->dev.segment_size = rma_op->origin_count * origin_type_size;
-	    
+
         request->dev.OnFinal = 0;
         request->dev.OnDataAvail = 0;
 
         mpi_errno = vc->sendNoncontig_fn(vc, request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN);
         /* --BEGIN ERROR HANDLING-- */
-        if (mpi_errno)
-        {
+        if (mpi_errno) {
             MPID_Datatype_release(request->dev.datatype_ptr);
             MPID_Request_release(request);
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|loadsendiov");
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|loadsendiov");
         }
-        /* --END ERROR HANDLING-- */        
+        /* --END ERROR HANDLING-- */
     }
 
     if (request != NULL) {
-	if (!MPID_Request_is_complete(request))
-        {
-	    MPID_Progress_state progress_state;
-	    
+        if (!MPID_Request_is_complete(request)) {
+            MPID_Progress_state progress_state;
+
             MPID_Progress_start(&progress_state);
-	    while (!MPID_Request_is_complete(request))
-            {
+            while (!MPID_Request_is_complete(request)) {
                 mpi_errno = MPID_Progress_wait(&progress_state);
                 /* --BEGIN ERROR HANDLING-- */
-                if (mpi_errno != MPI_SUCCESS)
-                {
-		    MPID_Progress_end(&progress_state);
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rma_msg");
+                if (mpi_errno != MPI_SUCCESS) {
+                    MPID_Progress_end(&progress_state);
+                    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
                 }
                 /* --END ERROR HANDLING-- */
             }
-	    MPID_Progress_end(&progress_state);
+            MPID_Progress_end(&progress_state);
         }
-        
+
         mpi_errno = request->status.MPI_ERROR;
         if (mpi_errno != MPI_SUCCESS) {
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rma_msg");
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
         }
-                
+
         MPID_Request_release(request);
     }
 
@@ -4231,7 +4129,7 @@ static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
      * we have to free two elements. */
     MPIDI_CH3I_RMA_Ops_free(&win_ptr->targets[target_rank].rma_ops_list);
 
- fn_fail:
+  fn_fail:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_LOCK_PUT_OR_ACC);
     return mpi_errno;
 }
@@ -4241,17 +4139,16 @@ static int send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
 #define FUNCNAME send_lock_get
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-static int send_lock_get(MPID_Win *win_ptr, int target_rank)
+static int send_lock_get(MPID_Win * win_ptr, int target_rank)
 {
-    int mpi_errno=MPI_SUCCESS, lock_type;
+    int mpi_errno = MPI_SUCCESS, lock_type;
     MPIDI_RMA_Op_t *rma_op;
-    MPID_Request *rreq=NULL, *sreq=NULL;
-    MPIDI_VC_t * vc;
+    MPID_Request *rreq = NULL, *sreq = NULL;
+    MPIDI_VC_t *vc;
     MPID_Comm *comm_ptr;
     MPID_Datatype *dtp;
     MPIDI_CH3_Pkt_t upkt;
-    MPIDI_CH3_Pkt_lock_get_unlock_t *lock_get_unlock_pkt = 
-	&upkt.lock_get_unlock;
+    MPIDI_CH3_Pkt_lock_get_unlock_t *lock_get_unlock_pkt = &upkt.lock_get_unlock;
 
     MPIDI_STATE_DECL(MPID_STATE_SEND_LOCK_GET);
 
@@ -4262,12 +4159,12 @@ static int send_lock_get(MPID_Win *win_ptr, int target_rank)
     rma_op = MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[target_rank].rma_ops_list);
 
     /* create a request, store the origin buf, cnt, datatype in it,
-       and pass a handle to it in the get packet. When the get
-       response comes from the target, it will contain the request
-       handle. */  
+     * and pass a handle to it in the get packet. When the get
+     * response comes from the target, it will contain the request
+     * handle. */
     rreq = MPID_Request_create();
     if (rreq == NULL) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomemreq");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**nomemreq");
     }
 
     MPIU_Object_set_ref(rreq, 2);
@@ -4278,26 +4175,23 @@ static int send_lock_get(MPID_Win *win_ptr, int target_rank)
     rreq->dev.target_win_handle = MPI_WIN_NULL;
     rreq->dev.source_win_handle = win_ptr->handle;
 
-    if (!MPIR_DATATYPE_IS_PREDEFINED(rreq->dev.datatype))
-    {
+    if (!MPIR_DATATYPE_IS_PREDEFINED(rreq->dev.datatype)) {
         MPID_Datatype_get_ptr(rreq->dev.datatype, dtp);
         rreq->dev.datatype_ptr = dtp;
         /* this will cause the datatype to be freed when the
-           request is freed. */  
+         * request is freed. */
     }
 
     MPIDI_Pkt_init(lock_get_unlock_pkt, MPIDI_CH3_PKT_LOCK_GET_UNLOCK);
-    lock_get_unlock_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_LOCK |
-        MPIDI_CH3_PKT_FLAG_RMA_UNLOCK; /* FIXME | MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK; */
-    lock_get_unlock_pkt->target_win_handle = 
-        win_ptr->all_win_handles[rma_op->target_rank];
+    lock_get_unlock_pkt->flags = MPIDI_CH3_PKT_FLAG_RMA_LOCK | MPIDI_CH3_PKT_FLAG_RMA_UNLOCK;   /* FIXME | MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK; */
+    lock_get_unlock_pkt->target_win_handle = win_ptr->all_win_handles[rma_op->target_rank];
     lock_get_unlock_pkt->source_win_handle = win_ptr->handle;
     lock_get_unlock_pkt->lock_type = lock_type;
- 
-    lock_get_unlock_pkt->addr = 
+
+    lock_get_unlock_pkt->addr =
         (char *) win_ptr->base_addrs[rma_op->target_rank] +
         win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp;
-        
+
     lock_get_unlock_pkt->count = rma_op->target_count;
     lock_get_unlock_pkt->datatype = rma_op->target_datatype;
     lock_get_unlock_pkt->request_handle = rreq->handle;
@@ -4305,53 +4199,49 @@ static int send_lock_get(MPID_Win *win_ptr, int target_rank)
     comm_ptr = win_ptr->comm_ptr;
     MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc);
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_get_unlock_pkt, sizeof(*lock_get_unlock_pkt), &sreq);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
     /* release the request returned by iStartMsg */
-    if (sreq != NULL)
-    {
+    if (sreq != NULL) {
         MPID_Request_release(sreq);
     }
 
     /* now wait for the data to arrive */
-    if (!MPID_Request_is_complete(rreq))
-    {
-	MPID_Progress_state progress_state;
-	
-	MPID_Progress_start(&progress_state);
-	while (!MPID_Request_is_complete(rreq))
-        {
+    if (!MPID_Request_is_complete(rreq)) {
+        MPID_Progress_state progress_state;
+
+        MPID_Progress_start(&progress_state);
+        while (!MPID_Request_is_complete(rreq)) {
             mpi_errno = MPID_Progress_wait(&progress_state);
             /* --BEGIN ERROR HANDLING-- */
-            if (mpi_errno != MPI_SUCCESS)
-            {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rma_msg");
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
             }
             /* --END ERROR HANDLING-- */
         }
-	MPID_Progress_end(&progress_state);
+        MPID_Progress_end(&progress_state);
     }
-    
+
     mpi_errno = rreq->status.MPI_ERROR;
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rma_msg");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
     }
-            
-    /* if origin datatype was a derived datatype, it will get freed when the 
-       rreq gets freed. */ 
+
+    /* if origin datatype was a derived datatype, it will get freed when the
+     * rreq gets freed. */
     MPID_Request_release(rreq);
 
     /* Free MPIDI_RMA_Ops_list - the lock packet should still be in place, so
      * we have to free two elements. */
     MPIDI_CH3I_RMA_Ops_free(&win_ptr->targets[target_rank].rma_ops_list);
 
- fn_fail:
+  fn_fail:
     MPIDI_RMA_FUNC_EXIT(MPID_STATE_SEND_LOCK_GET);
     return mpi_errno;
 }
@@ -4365,15 +4255,14 @@ static int send_lock_get(MPID_Win *win_ptr, int target_rank)
 #define FUNCNAME MPIDI_CH3I_Send_lock_granted_pkt
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t *vc, MPID_Win *win_ptr,
-                                     MPI_Win source_win_handle)
+int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr, MPI_Win source_win_handle)
 {
     MPIDI_CH3_Pkt_t upkt;
     MPIDI_CH3_Pkt_lock_granted_t *lock_granted_pkt = &upkt.lock_granted;
     MPID_Request *req = NULL;
     int mpi_errno;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
 
     /* send lock granted packet */
@@ -4381,31 +4270,30 @@ int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t *vc, MPID_Win *win_ptr,
     lock_granted_pkt->source_win_handle = source_win_handle;
     lock_granted_pkt->target_rank = win_ptr->comm_ptr->rank;
 
-    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,
+    MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
                      (MPIU_DBG_FDEST, "sending lock granted pkt on vc=%p, source_win_handle=%#08x",
                       vc, lock_granted_pkt->source_win_handle));
 
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_granted_pkt, sizeof(*lock_granted_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
     if (mpi_errno) {
-	MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
     }
 
-    if (req != NULL)
-    {
+    if (req != NULL) {
         MPID_Request_release(req);
     }
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
 
     return mpi_errno;
 }
 
 /* ------------------------------------------------------------------------ */
-/* 
- * The following routines are the packet handlers for the packet types 
+/*
+ * The following routines are the packet handlers for the packet types
  * used above in the implementation of the RMA operations in terms
  * of messages.
  */
@@ -4414,10 +4302,10 @@ int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t *vc, MPID_Win *win_ptr,
 #define FUNCNAME MPIDI_CH3_PktHandler_Put
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Put( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
-			      MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                             MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_put_t * put_pkt = &pkt->put;
+    MPIDI_CH3_Pkt_put_t *put_pkt = &pkt->put;
     MPID_Request *req = NULL;
     MPI_Aint type_size;
     int complete = 0;
@@ -4426,24 +4314,26 @@ int MPIDI_CH3_PktHandler_Put( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPID_Win *win_ptr;
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_PUT);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_PUT);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received put pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received put pkt");
 
-    if (put_pkt->count == 0)
-    {
-	/* it's a 0-byte message sent just to decrement the
-	   completion counter. This happens only in
-	   post/start/complete/wait sync model; therefore, no need
-	   to check lock queue. */
-	if (put_pkt->target_win_handle != MPI_WIN_NULL) {
+    if (put_pkt->count == 0) {
+        /* it's a 0-byte message sent just to decrement the
+         * completion counter. This happens only in
+         * post/start/complete/wait sync model; therefore, no need
+         * to check lock queue. */
+        if (put_pkt->target_win_handle != MPI_WIN_NULL) {
             MPID_Win_get_ptr(put_pkt->target_win_handle, win_ptr);
-            mpi_errno = MPIDI_CH3_Finish_rma_op_target(NULL, win_ptr, TRUE, put_pkt->flags, MPI_WIN_NULL);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
-	}
+            mpi_errno =
+                MPIDI_CH3_Finish_rma_op_target(NULL, win_ptr, TRUE, put_pkt->flags, MPI_WIN_NULL);
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
+        }
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
-	*rreqp = NULL;
+        *rreqp = NULL;
         goto fn_exit;
     }
 
@@ -4452,119 +4342,113 @@ int MPIDI_CH3_PktHandler_Put( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     mpi_errno = MPIDI_CH3_Start_rma_op_target(win_ptr, put_pkt->flags);
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
 
     req = MPID_Request_create();
     MPIU_Object_set_ref(req, 1);
-                
+
     req->dev.user_buf = put_pkt->addr;
     req->dev.user_count = put_pkt->count;
     req->dev.target_win_handle = put_pkt->target_win_handle;
     req->dev.source_win_handle = put_pkt->source_win_handle;
     req->dev.flags = put_pkt->flags;
-	
-    if (MPIR_DATATYPE_IS_PREDEFINED(put_pkt->datatype))
-    {
+
+    if (MPIR_DATATYPE_IS_PREDEFINED(put_pkt->datatype)) {
         MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP);
         req->dev.datatype = put_pkt->datatype;
-	    
-        MPID_Datatype_get_size_macro(put_pkt->datatype,
-                                     type_size);
+
+        MPID_Datatype_get_size_macro(put_pkt->datatype, type_size);
         req->dev.recv_data_sz = type_size * put_pkt->count;
-		    
-        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len,
-                                                  &complete);
+
+        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
         MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
         /* FIXME:  Only change the handling of completion if
-           post_data_receive reset the handler.  There should
-           be a cleaner way to do this */
+         * post_data_receive reset the handler.  There should
+         * be a cleaner way to do this */
         if (!req->dev.OnDataAvail) {
             req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
         }
-        
+
         /* return the number of bytes processed in this function */
         *buflen = sizeof(MPIDI_CH3_Pkt_t) + data_len;
 
-        if (complete) 
-        {
+        if (complete) {
             mpi_errno = MPIDI_CH3_ReqHandler_PutAccumRespComplete(vc, req, &complete);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            if (complete)
-            {
+            if (mpi_errno)
+                MPIU_ERR_POP(mpi_errno);
+            if (complete) {
                 *rreqp = NULL;
                 goto fn_exit;
             }
         }
     }
-    else
-    {
+    else {
         /* derived datatype */
         MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP_DERIVED_DT);
         req->dev.datatype = MPI_DATATYPE_NULL;
         req->dev.OnFinal = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
-	    
-        req->dev.dtype_info = (MPIDI_RMA_dtype_info *) 
+
+        req->dev.dtype_info = (MPIDI_RMA_dtype_info *)
             MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
-        if (! req->dev.dtype_info) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_RMA_dtype_info");
+        if (!req->dev.dtype_info) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_RMA_dtype_info");
         }
 
         req->dev.dataloop = MPIU_Malloc(put_pkt->dataloop_size);
-        if (! req->dev.dataloop) {
-            MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-				 put_pkt->dataloop_size);
+        if (!req->dev.dataloop) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                                 put_pkt->dataloop_size);
         }
 
         /* if we received all of the dtype_info and dataloop, copy it
-           now and call the handler, otherwise set the iov and let the
-           channel copy it */
-        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + put_pkt->dataloop_size)
-        {
+         * now and call the handler, otherwise set the iov and let the
+         * channel copy it */
+        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + put_pkt->dataloop_size) {
             /* copy all of dtype_info and dataloop */
             MPIU_Memcpy(req->dev.dtype_info, data_buf, sizeof(MPIDI_RMA_dtype_info));
-            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info), put_pkt->dataloop_size);
+            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info),
+                        put_pkt->dataloop_size);
+
+            *buflen =
+                sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + put_pkt->dataloop_size;
 
-            *buflen = sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + put_pkt->dataloop_size;
-          
             /* All dtype data has been received, call req handler */
             mpi_errno = MPIDI_CH3_ReqHandler_PutRespDerivedDTComplete(vc, req, &complete);
             MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
-                                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT"); 
-            if (complete)
-            {
+                                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
+            if (complete) {
                 *rreqp = NULL;
                 goto fn_exit;
             }
         }
-        else
-        {
-            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)((char *)req->dev.dtype_info);
+        else {
+            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) ((char *) req->dev.dtype_info);
             req->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_RMA_dtype_info);
-            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)req->dev.dataloop;
+            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) req->dev.dataloop;
             req->dev.iov[1].MPID_IOV_LEN = put_pkt->dataloop_size;
             req->dev.iov_count = 2;
 
             *buflen = sizeof(MPIDI_CH3_Pkt_t);
-            
+
             req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutRespDerivedDTComplete;
         }
-        
+
     }
-	
+
     *rreqp = req;
 
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,"**ch3|postrecv",
+        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                       "**ch3|postrecv %s", "MPIDI_CH3_PKT_PUT");
     }
-    
 
- fn_exit:
+
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_PUT);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -4572,10 +4456,10 @@ int MPIDI_CH3_PktHandler_Put( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_Get
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Get( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
-			      MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                             MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_get_t * get_pkt = &pkt->get;
+    MPIDI_CH3_Pkt_get_t *get_pkt = &pkt->get;
     MPID_Request *req = NULL;
     MPID_IOV iov[MPID_IOV_LIMIT];
     int complete;
@@ -4585,18 +4469,18 @@ int MPIDI_CH3_PktHandler_Get( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int mpi_errno = MPI_SUCCESS;
     MPI_Aint type_size;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received get pkt");
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received get pkt");
 
     MPIU_Assert(get_pkt->target_win_handle != MPI_WIN_NULL);
     MPID_Win_get_ptr(get_pkt->target_win_handle, win_ptr);
     mpi_errno = MPIDI_CH3_Start_rma_op_target(win_ptr, get_pkt->flags);
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
-    
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
+
     req = MPID_Request_create();
     req->dev.target_win_handle = get_pkt->target_win_handle;
     req->dev.source_win_handle = get_pkt->source_win_handle;
@@ -4605,100 +4489,97 @@ int MPIDI_CH3_PktHandler_Get( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* here we increment the Active Target counter to guarantee the GET-like
        operation are completed when counter reaches zero. */
     win_ptr->at_completion_counter++;
-    
-    if (MPIR_DATATYPE_IS_PREDEFINED(get_pkt->datatype))
-    {
-	/* basic datatype. send the data. */
-	MPIDI_CH3_Pkt_t upkt;
-	MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &upkt.get_resp;
-	
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP); 
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete;
-	req->dev.OnFinal     = MPIDI_CH3_ReqHandler_GetSendRespComplete;
-	req->kind = MPID_REQUEST_SEND;
-	
-	MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP);
-	get_resp_pkt->request_handle = get_pkt->request_handle;
-	
-	iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_resp_pkt;
-	iov[0].MPID_IOV_LEN = sizeof(*get_resp_pkt);
-	
-	iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)get_pkt->addr;
-	MPID_Datatype_get_size_macro(get_pkt->datatype, type_size);
-	iov[1].MPID_IOV_LEN = get_pkt->count * type_size;
-
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
-	mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, 2);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-	/* --BEGIN ERROR HANDLING-- */
-	if (mpi_errno != MPI_SUCCESS)
-	{
-	    MPIU_Object_set_ref(req, 0);
-	    MPIDI_CH3_Request_destroy(req);
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
-	}
-	/* --END ERROR HANDLING-- */
-	
+
+    if (MPIR_DATATYPE_IS_PREDEFINED(get_pkt->datatype)) {
+        /* basic datatype. send the data. */
+        MPIDI_CH3_Pkt_t upkt;
+        MPIDI_CH3_Pkt_get_resp_t *get_resp_pkt = &upkt.get_resp;
+
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete;
+        req->dev.OnFinal = MPIDI_CH3_ReqHandler_GetSendRespComplete;
+        req->kind = MPID_REQUEST_SEND;
+
+        MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP);
+        get_resp_pkt->request_handle = get_pkt->request_handle;
+
+        iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_resp_pkt;
+        iov[0].MPID_IOV_LEN = sizeof(*get_resp_pkt);
+
+        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_pkt->addr;
+        MPID_Datatype_get_size_macro(get_pkt->datatype, type_size);
+        iov[1].MPID_IOV_LEN = get_pkt->count * type_size;
+
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
+        mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, 2);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+        /* --BEGIN ERROR HANDLING-- */
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_Object_set_ref(req, 0);
+            MPIDI_CH3_Request_destroy(req);
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        }
+        /* --END ERROR HANDLING-- */
+
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
-	*rreqp = NULL;
+        *rreqp = NULL;
     }
-    else
-    {
-	/* derived datatype. first get the dtype_info and dataloop. */
-	
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP_DERIVED_DT);
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetRespDerivedDTComplete;
-	req->dev.OnFinal     = 0;
-	req->dev.user_buf = get_pkt->addr;
-	req->dev.user_count = get_pkt->count;
-	req->dev.datatype = MPI_DATATYPE_NULL;
-	req->dev.request_handle = get_pkt->request_handle;
-	
-	req->dev.dtype_info = (MPIDI_RMA_dtype_info *) 
-	    MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
-	if (! req->dev.dtype_info) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_RMA_dtype_info");
-	}
-	
-	req->dev.dataloop = MPIU_Malloc(get_pkt->dataloop_size);
-	if (! req->dev.dataloop) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-				 get_pkt->dataloop_size);
-	}
-	
+    else {
+        /* derived datatype. first get the dtype_info and dataloop. */
+
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP_DERIVED_DT);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetRespDerivedDTComplete;
+        req->dev.OnFinal = 0;
+        req->dev.user_buf = get_pkt->addr;
+        req->dev.user_count = get_pkt->count;
+        req->dev.datatype = MPI_DATATYPE_NULL;
+        req->dev.request_handle = get_pkt->request_handle;
+
+        req->dev.dtype_info = (MPIDI_RMA_dtype_info *)
+            MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
+        if (!req->dev.dtype_info) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_RMA_dtype_info");
+        }
+
+        req->dev.dataloop = MPIU_Malloc(get_pkt->dataloop_size);
+        if (!req->dev.dataloop) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                                 get_pkt->dataloop_size);
+        }
+
         /* if we received all of the dtype_info and dataloop, copy it
-           now and call the handler, otherwise set the iov and let the
-           channel copy it */
-        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + get_pkt->dataloop_size)
-        {
+         * now and call the handler, otherwise set the iov and let the
+         * channel copy it */
+        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + get_pkt->dataloop_size) {
             /* copy all of dtype_info and dataloop */
             MPIU_Memcpy(req->dev.dtype_info, data_buf, sizeof(MPIDI_RMA_dtype_info));
-            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info), get_pkt->dataloop_size);
+            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info),
+                        get_pkt->dataloop_size);
+
+            *buflen =
+                sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + get_pkt->dataloop_size;
 
-            *buflen = sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + get_pkt->dataloop_size;
-          
             /* All dtype data has been received, call req handler */
             mpi_errno = MPIDI_CH3_ReqHandler_GetRespDerivedDTComplete(vc, req, &complete);
             MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
-                                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET"); 
+                                 "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET");
             if (complete)
                 *rreqp = NULL;
         }
-        else
-        {
-            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)req->dev.dtype_info;
+        else {
+            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) req->dev.dtype_info;
             req->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_RMA_dtype_info);
-            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)req->dev.dataloop;
+            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) req->dev.dataloop;
             req->dev.iov[1].MPID_IOV_LEN = get_pkt->dataloop_size;
             req->dev.iov_count = 2;
-	
+
             *buflen = sizeof(MPIDI_CH3_Pkt_t);
             *rreqp = req;
         }
-        
+
     }
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
     return mpi_errno;
 
@@ -4708,10 +4589,10 @@ int MPIDI_CH3_PktHandler_Get( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_Accumulate
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-				     MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                    MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_accum_t * accum_pkt = &pkt->accum;
+    MPIDI_CH3_Pkt_accum_t *accum_pkt = &pkt->accum;
     MPID_Request *req = NULL;
     MPI_Aint true_lb, true_extent, extent;
     void *tmp_buf = NULL;
@@ -4722,10 +4603,10 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int mpi_errno = MPI_SUCCESS;
     MPI_Aint type_size;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received accumulate pkt");
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received accumulate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc);
     MPIU_Assert(accum_pkt->target_win_handle != MPI_WIN_NULL);
@@ -4733,8 +4614,8 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     mpi_errno = MPIDI_CH3_Start_rma_op_target(win_ptr, accum_pkt->flags);
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
-    
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
+
     req = MPID_Request_create();
     MPIU_Object_set_ref(req, 1);
     *rreqp = req;
@@ -4748,53 +4629,50 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     if (accum_pkt->type == MPIDI_CH3_PKT_GET_ACCUM) {
         req->dev.resp_request_handle = accum_pkt->request_handle;
-    } else {
+    }
+    else {
         req->dev.resp_request_handle = MPI_REQUEST_NULL;
     }
 
-    if (MPIR_DATATYPE_IS_PREDEFINED(accum_pkt->datatype))
-    {
-       MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc_predef);
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP);
-	req->dev.datatype = accum_pkt->datatype;
+    if (MPIR_DATATYPE_IS_PREDEFINED(accum_pkt->datatype)) {
+        MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc_predef);
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP);
+        req->dev.datatype = accum_pkt->datatype;
 
-	MPIR_Type_get_true_extent_impl(accum_pkt->datatype, &true_lb, &true_extent);
-	MPID_Datatype_get_extent_macro(accum_pkt->datatype, extent); 
+        MPIR_Type_get_true_extent_impl(accum_pkt->datatype, &true_lb, &true_extent);
+        MPID_Datatype_get_extent_macro(accum_pkt->datatype, extent);
 
         /* Predefined types should always have zero lb */
         MPIU_Assert(true_lb == 0);
 
-	tmp_buf = MPIU_Malloc(accum_pkt->count * 
-			      (MPIR_MAX(extent,true_extent)));
-	if (!tmp_buf) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-			 accum_pkt->count * MPIR_MAX(extent,true_extent));
-	}
-	
-	req->dev.user_buf = tmp_buf;
-	
-	MPID_Datatype_get_size_macro(accum_pkt->datatype, type_size);
-	req->dev.recv_data_sz = type_size * accum_pkt->count;
-
-        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len,
-                                                  &complete);
+        tmp_buf = MPIU_Malloc(accum_pkt->count * (MPIR_MAX(extent, true_extent)));
+        if (!tmp_buf) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                                 accum_pkt->count * MPIR_MAX(extent, true_extent));
+        }
+
+        req->dev.user_buf = tmp_buf;
+
+        MPID_Datatype_get_size_macro(accum_pkt->datatype, type_size);
+        req->dev.recv_data_sz = type_size * accum_pkt->count;
+
+        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
         MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
         /* FIXME:  Only change the handling of completion if
-           post_data_receive reset the handler.  There should
-           be a cleaner way to do this */
+         * post_data_receive reset the handler.  There should
+         * be a cleaner way to do this */
         if (!req->dev.OnDataAvail) {
             req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
         }
         /* return the number of bytes processed in this function */
         *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
 
-        if (complete)
-        {
+        if (complete) {
             mpi_errno = MPIDI_CH3_ReqHandler_PutAccumRespComplete(vc, req, &complete);
-            if (mpi_errno) MPIU_ERR_POP(mpi_errno);
-            if (complete)
-            {
+            if (mpi_errno)
+                MPIU_ERR_POP(mpi_errno);
+            if (complete) {
                 *rreqp = NULL;
                 MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc_predef);
                 goto fn_exit;
@@ -4802,66 +4680,64 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         }
         MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc_predef);
     }
-    else
-    {
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP_DERIVED_DT);
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete;
-	req->dev.datatype = MPI_DATATYPE_NULL;
+    else {
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_ACCUM_RESP_DERIVED_DT);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete;
+        req->dev.datatype = MPI_DATATYPE_NULL;
         req->dev.OnFinal = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
-                
-	req->dev.dtype_info = (MPIDI_RMA_dtype_info *) 
-	    MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
-	if (! req->dev.dtype_info) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_RMA_dtype_info");
-	}
-	
-	req->dev.dataloop = MPIU_Malloc(accum_pkt->dataloop_size);
-	if (! req->dev.dataloop) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-				 accum_pkt->dataloop_size);
-	}
-	
-        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + accum_pkt->dataloop_size)
-        {
+
+        req->dev.dtype_info = (MPIDI_RMA_dtype_info *)
+            MPIU_Malloc(sizeof(MPIDI_RMA_dtype_info));
+        if (!req->dev.dtype_info) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_RMA_dtype_info");
+        }
+
+        req->dev.dataloop = MPIU_Malloc(accum_pkt->dataloop_size);
+        if (!req->dev.dataloop) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                                 accum_pkt->dataloop_size);
+        }
+
+        if (data_len >= sizeof(MPIDI_RMA_dtype_info) + accum_pkt->dataloop_size) {
             /* copy all of dtype_info and dataloop */
             MPIU_Memcpy(req->dev.dtype_info, data_buf, sizeof(MPIDI_RMA_dtype_info));
-            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info), accum_pkt->dataloop_size);
+            MPIU_Memcpy(req->dev.dataloop, data_buf + sizeof(MPIDI_RMA_dtype_info),
+                        accum_pkt->dataloop_size);
+
+            *buflen =
+                sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + accum_pkt->dataloop_size;
 
-            *buflen = sizeof(MPIDI_CH3_Pkt_t) + sizeof(MPIDI_RMA_dtype_info) + accum_pkt->dataloop_size;
-          
             /* All dtype data has been received, call req handler */
             mpi_errno = MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete(vc, req, &complete);
             MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
-                                 "**ch3|postrecv %s", "MPIDI_CH3_ACCUMULATE"); 
-            if (complete)
-            {
+                                 "**ch3|postrecv %s", "MPIDI_CH3_ACCUMULATE");
+            if (complete) {
                 *rreqp = NULL;
                 goto fn_exit;
             }
         }
-        else
-        {
-            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)req->dev.dtype_info;
+        else {
+            req->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) req->dev.dtype_info;
             req->dev.iov[0].MPID_IOV_LEN = sizeof(MPIDI_RMA_dtype_info);
-            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)req->dev.dataloop;
+            req->dev.iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) req->dev.dataloop;
             req->dev.iov[1].MPID_IOV_LEN = accum_pkt->dataloop_size;
             req->dev.iov_count = 2;
             *buflen = sizeof(MPIDI_CH3_Pkt_t);
         }
-        
+
     }
 
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**ch3|postrecv",
-			     "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
+        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
+                             "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
     }
 
- fn_exit:
+  fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 
 }
@@ -4871,19 +4747,18 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_Accumulate_Immed
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-					   MPIDI_msg_sz_t *buflen, 
-					   MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Accumulate_Immed(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                          MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_accum_immed_t * accum_pkt = &pkt->accum_immed;
+    MPIDI_CH3_Pkt_accum_immed_t *accum_pkt = &pkt->accum_immed;
     MPID_Win *win_ptr;
     MPI_Aint extent;
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE_IMMED);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE_IMMED);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received accumulate immedidate pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received accumulate immedidate pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc_immed);
     MPIU_Assert(accum_pkt->target_win_handle != MPI_WIN_NULL);
@@ -4893,11 +4768,11 @@ int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* return the number of bytes processed in this function */
     /* data_len == 0 (all within packet) */
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
-    *rreqp  = NULL;
-    
-    MPID_Datatype_get_extent_macro(accum_pkt->datatype, extent); 
-    
-	MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc_immed_op);
+    *rreqp = NULL;
+
+    MPID_Datatype_get_extent_macro(accum_pkt->datatype, extent);
+
+    MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_acc_immed_op);
     if (win_ptr->shm_allocated == TRUE)
         MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
     /* Data is already present */
@@ -4906,42 +4781,42 @@ int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         int len;
         MPIU_Assign_trunc(len, (accum_pkt->count * extent), int);
         /* FIXME: use immediate copy because this is short */
-        MPIUI_Memcpy( accum_pkt->addr, accum_pkt->data, len );
+        MPIUI_Memcpy(accum_pkt->addr, accum_pkt->data, len);
     }
     else {
         if (HANDLE_GET_KIND(accum_pkt->op) == HANDLE_KIND_BUILTIN) {
             MPI_User_function *uop;
             /* get the function by indexing into the op table */
             uop = MPIR_OP_HDL_TO_FN(accum_pkt->op);
-            (*uop)(accum_pkt->data, accum_pkt->addr,
-                   &(accum_pkt->count), &(accum_pkt->datatype));
+            (*uop) (accum_pkt->data, accum_pkt->addr, &(accum_pkt->count), &(accum_pkt->datatype));
         }
         else {
-            MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OP, "**opnotpredefined",
-                                 "**opnotpredefined %d", accum_pkt->op );
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OP, "**opnotpredefined",
+                                 "**opnotpredefined %d", accum_pkt->op);
         }
     }
     if (win_ptr->shm_allocated == TRUE)
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
-	MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc_immed_op);
+    MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc_immed_op);
 
     /* There are additional steps to take if this is a passive
-       target RMA or the last operation from the source */
+     * target RMA or the last operation from the source */
 
     /* Here is the code executed in PutAccumRespComplete after the
-       accumulation operation */
+     * accumulation operation */
     MPID_Win_get_ptr(accum_pkt->target_win_handle, win_ptr);
 
     mpi_errno = MPIDI_CH3_Finish_rma_op_target(vc, win_ptr, TRUE,
-                                               accum_pkt->flags,
-                                               accum_pkt->source_win_handle);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+                                               accum_pkt->flags, accum_pkt->source_win_handle);
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_acc_immed);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE_IMMED);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 
 }
@@ -4951,8 +4826,8 @@ int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_CAS
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-                              MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                             MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_t upkt;
@@ -4965,7 +4840,7 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received CAS pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received CAS pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas);
     MPIU_Assert(cas_pkt->target_win_handle != MPI_WIN_NULL);
@@ -4975,7 +4850,7 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* return the number of bytes processed in this function */
     /* data_len == 0 (all within packet) */
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
-    *rreqp  = NULL;
+    *rreqp = NULL;
 
     MPIDI_Pkt_init(cas_resp_pkt, MPIDI_CH3_PKT_CAS_RESP);
     cas_resp_pkt->request_handle = cas_pkt->request_handle;
@@ -4987,7 +4862,7 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     if (win_ptr->shm_allocated == TRUE)
         MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
 
-    MPIU_Memcpy( (void *)&cas_resp_pkt->data, cas_pkt->addr, len );
+    MPIU_Memcpy((void *) &cas_resp_pkt->data, cas_pkt->addr, len);
 
     /* Compare and replace if equal */
     if (MPIR_Compare_equal(&cas_pkt->compare_data, cas_pkt->addr, cas_pkt->datatype)) {
@@ -4998,9 +4873,9 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
 
     /* Send the response packet */
-    MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+    MPIU_THREAD_CS_ENTER(CH3COMM, vc);
     mpi_errno = MPIDI_CH3_iStartMsg(vc, cas_resp_pkt, sizeof(*cas_resp_pkt), &req);
-    MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+    MPIU_THREAD_CS_EXIT(CH3COMM, vc);
 
     MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
 
@@ -5024,19 +4899,19 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     }
 
 
-    /* There are additional steps to take if this is a passive 
-       target RMA or the last operation from the source */
+    /* There are additional steps to take if this is a passive
+     * target RMA or the last operation from the source */
 
-    mpi_errno = MPIDI_CH3_Finish_rma_op_target(NULL, win_ptr, TRUE,
-                                               cas_pkt->flags,
-                                               MPI_WIN_NULL);
-    if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+    mpi_errno = MPIDI_CH3_Finish_rma_op_target(NULL, win_ptr, TRUE, cas_pkt->flags, MPI_WIN_NULL);
+    if (mpi_errno) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
-fn_exit:
+  fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_cas);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 
 }
@@ -5046,33 +4921,33 @@ fn_fail:
 #define FUNCNAME MPIDI_CH3_PktHandler_CASResp
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_CASResp( MPIDI_VC_t *vc ATTRIBUTE((unused)), 
-                                  MPIDI_CH3_Pkt_t *pkt,
-                                  MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
+                                 MPIDI_CH3_Pkt_t * pkt,
+                                 MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_cas_resp_t *cas_resp_pkt = &pkt->cas_resp;
     MPID_Request *req;
     MPI_Aint len;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received CAS response pkt");
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received CAS response pkt");
 
     MPID_Request_get_ptr(cas_resp_pkt->request_handle, req);
     MPID_Datatype_get_size_macro(req->dev.datatype, len);
-    
-    MPIU_Memcpy( req->dev.user_buf, (void *)&cas_resp_pkt->data, len );
 
-    MPIDI_CH3U_Request_complete( req );
+    MPIU_Memcpy(req->dev.user_buf, (void *) &cas_resp_pkt->data, len);
+
+    MPIDI_CH3U_Request_complete(req);
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     *rreqp = NULL;
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -5081,8 +4956,8 @@ int MPIDI_CH3_PktHandler_CASResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #define FUNCNAME MPIDI_CH3_PktHandler_FOP
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-                              MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                             MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_fop_t *fop_pkt = &pkt->fop;
@@ -5095,7 +4970,7 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOP);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received FOP pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received FOP pkt");
 
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_fop);
     MPIU_Assert(fop_pkt->target_win_handle != MPI_WIN_NULL);
@@ -5104,10 +4979,10 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     req = MPID_Request_create();
     MPIU_ERR_CHKANDJUMP(req == NULL, mpi_errno, MPI_ERR_OTHER, "**nomemreq");
-    MPIU_Object_set_ref(req, 1); /* Ref is held by progress engine */
+    MPIU_Object_set_ref(req, 1);        /* Ref is held by progress engine */
     *rreqp = NULL;
 
-    req->dev.user_buf = NULL; /* will be set later */
+    req->dev.user_buf = NULL;   /* will be set later */
     req->dev.user_count = 1;
     req->dev.datatype = fop_pkt->datatype;
     req->dev.op = fop_pkt->op;
@@ -5131,8 +5006,8 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         void *data_buf;
 
         data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-        data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
-        req->dev.recv_data_sz = len; /* count == 1 for FOP */
+        data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
+        req->dev.recv_data_sz = len;    /* count == 1 for FOP */
 
         MPIU_CHKPMEM_MALLOC(req->dev.user_buf, void *, len, mpi_errno, "**nomemreq");
 
@@ -5141,8 +5016,8 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
                              "**ch3|postrecv %s", "MPIDI_CH3_PKT_ACCUMULATE");
 
         req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_FOPComplete;
-        
-        if (! data_complete) {
+
+        if (!data_complete) {
             *rreqp = req;
         }
 
@@ -5153,17 +5028,19 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     if (data_complete) {
         int fop_complete = 0;
         mpi_errno = MPIDI_CH3_ReqHandler_FOPComplete(vc, req, &fop_complete);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
         *rreqp = NULL;
     }
 
- fn_exit:
+  fn_exit:
     MPIU_CHKPMEM_COMMIT();
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_fop);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
     /* --END ERROR HANDLING-- */
@@ -5174,9 +5051,9 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_FOPResp
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_FOPResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
-                                  MPIDI_CH3_Pkt_t *pkt,
-                                  MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_FOPResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
+                                 MPIDI_CH3_Pkt_t * pkt,
+                                 MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_CH3_Pkt_fop_resp_t *fop_resp_pkt = &pkt->fop_resp;
@@ -5187,13 +5064,13 @@ int MPIDI_CH3_PktHandler_FOPResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received FOP response pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received FOP response pkt");
 
     MPID_Request_get_ptr(fop_resp_pkt->request_handle, req);
     MPID_Datatype_get_size_macro(req->dev.datatype, len);
 
     if (len <= sizeof(fop_resp_pkt->data)) {
-        MPIU_Memcpy( req->dev.user_buf, (void *)fop_resp_pkt->data, len );
+        MPIU_Memcpy(req->dev.user_buf, (void *) fop_resp_pkt->data, len);
         *buflen = sizeof(MPIDI_CH3_Pkt_t);
         complete = 1;
     }
@@ -5201,32 +5078,30 @@ int MPIDI_CH3_PktHandler_FOPResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
         /* Data was too big to embed in the header */
         MPIDI_msg_sz_t data_len;
         void *data_buf;
-        
+
         data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-        data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
-        req->dev.recv_data_sz = len; /* count == 1 for FOP */
+        data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
+        req->dev.recv_data_sz = len;    /* count == 1 for FOP */
         *rreqp = req;
 
-        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf,
-                                                  &data_len, &complete);
+        mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
         MPIU_ERR_CHKANDJUMP1(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER,
-                             "**ch3|postrecv", "**ch3|postrecv %s",
-                             "MPIDI_CH3_PKT_GET_RESP");
+                             "**ch3|postrecv", "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET_RESP");
 
         /* return the number of bytes processed in this function */
         *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
     }
 
     if (complete) {
-        MPIDI_CH3U_Request_complete( req );
+        MPIDI_CH3U_Request_complete(req);
         *rreqp = NULL;
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -5236,8 +5111,8 @@ int MPIDI_CH3_PktHandler_FOPResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #define FUNCNAME MPIDI_CH3_PktHandler_Get_AccumResp
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Get_AccumResp( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-                                        MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Get_AccumResp(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                       MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     MPIDI_CH3_Pkt_get_accum_resp_t *get_accum_resp_pkt = &pkt->get_accum_resp;
     MPID_Request *req;
@@ -5250,11 +5125,11 @@ int MPIDI_CH3_PktHandler_Get_AccumResp( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received Get-Accumulate response pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received Get-Accumulate response pkt");
     MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_get_accum);
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
 
     MPID_Request_get_ptr(get_accum_resp_pkt->request_handle, req);
 
@@ -5272,11 +5147,11 @@ int MPIDI_CH3_PktHandler_Get_AccumResp( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* return the number of bytes processed in this function */
     *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
 
-fn_exit:
+  fn_exit:
     MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_get_accum);
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -5285,69 +5160,65 @@ fn_fail:
 #define FUNCNAME MPIDI_CH3_PktHandler_Lock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Lock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
-			       MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                              MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_lock_t * lock_pkt = &pkt->lock;
+    MPIDI_CH3_Pkt_lock_t *lock_pkt = &pkt->lock;
     MPID_Win *win_ptr = NULL;
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCK);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCK);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received lock pkt");
-    
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock pkt");
+
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
 
     MPID_Win_get_ptr(lock_pkt->target_win_handle, win_ptr);
-    
-    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, 
-					lock_pkt->lock_type) == 1)
-    {
-	/* send lock granted packet. */
-        mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr,
-					     lock_pkt->source_win_handle);
+
+    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_pkt->lock_type) == 1) {
+        /* send lock granted packet. */
+        mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, lock_pkt->source_win_handle);
     }
 
     else {
-	/* queue the lock information */
-	MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
-	
-	/* Note: This code is reached by the fechandadd rma tests */
-	/* FIXME: MT: This may need to be done atomically. */
-	
-	/* FIXME: Since we need to add to the tail of the list,
-	   we should maintain a tail pointer rather than traversing the 
-	   list each time to find the tail. */
-	curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
-	prev_ptr = curr_ptr;
-	while (curr_ptr != NULL)
-	{
-	    prev_ptr = curr_ptr;
-	    curr_ptr = curr_ptr->next;
-	}
-	
-       MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
-	new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
-	MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
-	if (!new_ptr) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_Win_lock_queue");
-	}
-	if (prev_ptr != NULL)
-	    prev_ptr->next = new_ptr;
-	else 
-	    win_ptr->lock_queue = new_ptr;
-        
-	new_ptr->next = NULL;  
-	new_ptr->lock_type = lock_pkt->lock_type;
-	new_ptr->source_win_handle = lock_pkt->source_win_handle;
-	new_ptr->vc = vc;
-	new_ptr->pt_single_op = NULL;
+        /* queue the lock information */
+        MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
+
+        /* Note: This code is reached by the fechandadd rma tests */
+        /* FIXME: MT: This may need to be done atomically. */
+
+        /* FIXME: Since we need to add to the tail of the list,
+         * we should maintain a tail pointer rather than traversing the
+         * list each time to find the tail. */
+        curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
+        prev_ptr = curr_ptr;
+        while (curr_ptr != NULL) {
+            prev_ptr = curr_ptr;
+            curr_ptr = curr_ptr->next;
+        }
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
+        new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
+        MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
+        if (!new_ptr) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_Win_lock_queue");
+        }
+        if (prev_ptr != NULL)
+            prev_ptr->next = new_ptr;
+        else
+            win_ptr->lock_queue = new_ptr;
+
+        new_ptr->next = NULL;
+        new_ptr->lock_type = lock_pkt->lock_type;
+        new_ptr->source_win_handle = lock_pkt->source_win_handle;
+        new_ptr->vc = vc;
+        new_ptr->pt_single_op = NULL;
     }
-    
+
     *rreqp = NULL;
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCK);
     return mpi_errno;
 }
@@ -5356,11 +5227,10 @@ int MPIDI_CH3_PktHandler_Lock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_LockPutUnlock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, 
-					MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_LockPutUnlock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                       MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_lock_put_unlock_t * lock_put_unlock_pkt = 
-	&pkt->lock_put_unlock;
+    MPIDI_CH3_Pkt_lock_put_unlock_t *lock_put_unlock_pkt = &pkt->lock_put_unlock;
     MPID_Win *win_ptr = NULL;
     MPID_Request *req = NULL;
     MPI_Aint type_size;
@@ -5370,124 +5240,118 @@ int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     int mpi_errno = MPI_SUCCESS;
     int (*fcn)( MPIDI_VC_t *, struct MPID_Request *, int * );
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKPUTUNLOCK);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKPUTUNLOCK);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received lock_put_unlock pkt");
-    
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock_put_unlock pkt");
+
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
 
     req = MPID_Request_create();
     MPIU_Object_set_ref(req, 1);
-    
+
     req->dev.datatype = lock_put_unlock_pkt->datatype;
     MPID_Datatype_get_size_macro(lock_put_unlock_pkt->datatype, type_size);
     req->dev.recv_data_sz = type_size * lock_put_unlock_pkt->count;
     req->dev.user_count = lock_put_unlock_pkt->count;
     req->dev.target_win_handle = lock_put_unlock_pkt->target_win_handle;
-    
+
     MPID_Win_get_ptr(lock_put_unlock_pkt->target_win_handle, win_ptr);
-    
-    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, 
-                                        lock_put_unlock_pkt->lock_type) == 1)
-    {
-	/* do the put. for this optimization, only basic datatypes supported. */
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP);
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
-	req->dev.user_buf = lock_put_unlock_pkt->addr;
-	req->dev.source_win_handle = lock_put_unlock_pkt->source_win_handle;
+
+    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_put_unlock_pkt->lock_type) == 1) {
+        /* do the put. for this optimization, only basic datatypes supported. */
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PUT_RESP);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete;
+        req->dev.user_buf = lock_put_unlock_pkt->addr;
+        req->dev.source_win_handle = lock_put_unlock_pkt->source_win_handle;
         req->dev.flags = lock_put_unlock_pkt->flags;
     }
-    
+
     else {
-	/* queue the information */
-	MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
-	
-	MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
-	new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
-	MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
-	if (!new_ptr) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_Win_lock_queue");
-	}
-	
-	new_ptr->pt_single_op = (MPIDI_PT_single_op *) MPIU_Malloc(sizeof(MPIDI_PT_single_op));
-	if (new_ptr->pt_single_op == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_PT_single_op");
-	}
-	
-	/* FIXME: MT: The queuing may need to be done atomically. */
-
-	curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
-	prev_ptr = curr_ptr;
-	while (curr_ptr != NULL)
-	{
-	    prev_ptr = curr_ptr;
-	    curr_ptr = curr_ptr->next;
-	}
-	
-	if (prev_ptr != NULL)
-	    prev_ptr->next = new_ptr;
-	else 
-	    win_ptr->lock_queue = new_ptr;
-        
-	new_ptr->next = NULL;  
-	new_ptr->lock_type = lock_put_unlock_pkt->lock_type;
-	new_ptr->source_win_handle = lock_put_unlock_pkt->source_win_handle;
-	new_ptr->vc = vc;
-	
-	new_ptr->pt_single_op->type = MPIDI_RMA_PUT;
-	new_ptr->pt_single_op->flags = lock_put_unlock_pkt->flags;
-	new_ptr->pt_single_op->addr = lock_put_unlock_pkt->addr;
-	new_ptr->pt_single_op->count = lock_put_unlock_pkt->count;
-	new_ptr->pt_single_op->datatype = lock_put_unlock_pkt->datatype;
-	/* allocate memory to receive the data */
-	new_ptr->pt_single_op->data = MPIU_Malloc(req->dev.recv_data_sz);
-	if (new_ptr->pt_single_op->data == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-				 req->dev.recv_data_sz);
-	}
-
-	new_ptr->pt_single_op->data_recd = 0;
-
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PT_SINGLE_PUT);
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SinglePutAccumComplete;
-	req->dev.user_buf = new_ptr->pt_single_op->data;
-	req->dev.lock_queue_entry = new_ptr;
+        /* queue the information */
+        MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
+        new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
+        MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
+        if (!new_ptr) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_Win_lock_queue");
+        }
+
+        new_ptr->pt_single_op = (MPIDI_PT_single_op *) MPIU_Malloc(sizeof(MPIDI_PT_single_op));
+        if (new_ptr->pt_single_op == NULL) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_PT_single_op");
+        }
+
+        /* FIXME: MT: The queuing may need to be done atomically. */
+
+        curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
+        prev_ptr = curr_ptr;
+        while (curr_ptr != NULL) {
+            prev_ptr = curr_ptr;
+            curr_ptr = curr_ptr->next;
+        }
+
+        if (prev_ptr != NULL)
+            prev_ptr->next = new_ptr;
+        else
+            win_ptr->lock_queue = new_ptr;
+
+        new_ptr->next = NULL;
+        new_ptr->lock_type = lock_put_unlock_pkt->lock_type;
+        new_ptr->source_win_handle = lock_put_unlock_pkt->source_win_handle;
+        new_ptr->vc = vc;
+
+        new_ptr->pt_single_op->type = MPIDI_RMA_PUT;
+        new_ptr->pt_single_op->flags = lock_put_unlock_pkt->flags;
+        new_ptr->pt_single_op->addr = lock_put_unlock_pkt->addr;
+        new_ptr->pt_single_op->count = lock_put_unlock_pkt->count;
+        new_ptr->pt_single_op->datatype = lock_put_unlock_pkt->datatype;
+        /* allocate memory to receive the data */
+        new_ptr->pt_single_op->data = MPIU_Malloc(req->dev.recv_data_sz);
+        if (new_ptr->pt_single_op->data == NULL) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                                 req->dev.recv_data_sz);
+        }
+
+        new_ptr->pt_single_op->data_recd = 0;
+
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PT_SINGLE_PUT);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SinglePutAccumComplete;
+        req->dev.user_buf = new_ptr->pt_single_op->data;
+        req->dev.lock_queue_entry = new_ptr;
     }
 
     fcn = req->dev.OnDataAvail;
-    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len,
-                                              &complete);
+    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_OTHER,
+        MPIU_ERR_SETFATALANDJUMP1(mpi_errno, MPI_ERR_OTHER,
                                   "**ch3|postrecv", "**ch3|postrecv %s",
                                   "MPIDI_CH3_PKT_LOCK_PUT_UNLOCK");
     }
     req->dev.OnDataAvail = fcn;
     *rreqp = req;
 
-    if (complete)
-    {
+    if (complete) {
         mpi_errno = fcn(vc, req, &complete);
-        if (complete)
-        {
+        if (complete) {
             *rreqp = NULL;
         }
     }
 
     /* return the number of bytes processed in this function */
     *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
-    
+
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_SETFATALANDJUMP1(mpi_errno,MPI_ERR_OTHER, 
-				  "**ch3|postrecv", "**ch3|postrecv %s", 
-				  "MPIDI_CH3_PKT_LOCK_PUT_UNLOCK");
+        MPIU_ERR_SETFATALANDJUMP1(mpi_errno, MPI_ERR_OTHER,
+                                  "**ch3|postrecv", "**ch3|postrecv %s",
+                                  "MPIDI_CH3_PKT_LOCK_PUT_UNLOCK");
     }
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKPUTUNLOCK);
     return mpi_errno;
 }
@@ -5496,118 +5360,113 @@ int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_LockGetUnlock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_LockGetUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-					MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_LockGetUnlock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                       MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_lock_get_unlock_t * lock_get_unlock_pkt = 
-	&pkt->lock_get_unlock;
+    MPIDI_CH3_Pkt_lock_get_unlock_t *lock_get_unlock_pkt = &pkt->lock_get_unlock;
     MPID_Win *win_ptr = NULL;
     MPI_Aint type_size;
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGETUNLOCK);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGETUNLOCK);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received lock_get_unlock pkt");
-    
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock_get_unlock pkt");
+
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
 
     MPID_Win_get_ptr(lock_get_unlock_pkt->target_win_handle, win_ptr);
-    
-    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, 
-                                        lock_get_unlock_pkt->lock_type) == 1)
-    {
-	/* do the get. for this optimization, only basic datatypes supported. */
-	MPIDI_CH3_Pkt_t upkt;
-	MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &upkt.get_resp;
-	MPID_Request *req;
-	MPID_IOV iov[MPID_IOV_LIMIT];
-	
-	req = MPID_Request_create();
-	req->dev.target_win_handle = lock_get_unlock_pkt->target_win_handle;
-	req->dev.source_win_handle = lock_get_unlock_pkt->source_win_handle;
+
+    if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_get_unlock_pkt->lock_type) == 1) {
+        /* do the get. for this optimization, only basic datatypes supported. */
+        MPIDI_CH3_Pkt_t upkt;
+        MPIDI_CH3_Pkt_get_resp_t *get_resp_pkt = &upkt.get_resp;
+        MPID_Request *req;
+        MPID_IOV iov[MPID_IOV_LIMIT];
+
+        req = MPID_Request_create();
+        req->dev.target_win_handle = lock_get_unlock_pkt->target_win_handle;
+        req->dev.source_win_handle = lock_get_unlock_pkt->source_win_handle;
         req->dev.flags = lock_get_unlock_pkt->flags;
-	
-	MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP); 
-	req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete;
-	req->dev.OnFinal     = MPIDI_CH3_ReqHandler_GetSendRespComplete;
-	req->kind = MPID_REQUEST_SEND;
+
+        MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP);
+        req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete;
+        req->dev.OnFinal = MPIDI_CH3_ReqHandler_GetSendRespComplete;
+        req->kind = MPID_REQUEST_SEND;
 
         /* here we increment the Active Target counter to guarantee the GET-like
            operation are completed when counter reaches zero. */
         win_ptr->at_completion_counter++;
-	
-	MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP);
-	get_resp_pkt->request_handle = lock_get_unlock_pkt->request_handle;
-	
-	iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_resp_pkt;
-	iov[0].MPID_IOV_LEN = sizeof(*get_resp_pkt);
-	
-	iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)lock_get_unlock_pkt->addr;
-	MPID_Datatype_get_size_macro(lock_get_unlock_pkt->datatype, type_size);
-	iov[1].MPID_IOV_LEN = lock_get_unlock_pkt->count * type_size;
-	
-	mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, 2);
-	/* --BEGIN ERROR HANDLING-- */
-	if (mpi_errno != MPI_SUCCESS)
-	{
-	    MPIU_Object_set_ref(req, 0);
-	    MPIDI_CH3_Request_destroy(req);
-	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
-	}
-	/* --END ERROR HANDLING-- */
+
+        MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP);
+        get_resp_pkt->request_handle = lock_get_unlock_pkt->request_handle;
+
+        iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_resp_pkt;
+        iov[0].MPID_IOV_LEN = sizeof(*get_resp_pkt);
+
+        iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) lock_get_unlock_pkt->addr;
+        MPID_Datatype_get_size_macro(lock_get_unlock_pkt->datatype, type_size);
+        iov[1].MPID_IOV_LEN = lock_get_unlock_pkt->count * type_size;
+
+        mpi_errno = MPIDI_CH3_iSendv(vc, req, iov, 2);
+        /* --BEGIN ERROR HANDLING-- */
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_Object_set_ref(req, 0);
+            MPIDI_CH3_Request_destroy(req);
+            MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
+        }
+        /* --END ERROR HANDLING-- */
     }
 
     else {
-	/* queue the information */
-	MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
-	
-	/* FIXME: MT: This may need to be done atomically. */
-
-	curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
-	prev_ptr = curr_ptr;
-	while (curr_ptr != NULL)
-	{
-	    prev_ptr = curr_ptr;
-	    curr_ptr = curr_ptr->next;
-	}
-	
-	MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
-	new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
-	MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
-	if (!new_ptr) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_Win_lock_queue");
-	}
-	new_ptr->pt_single_op = (MPIDI_PT_single_op *) MPIU_Malloc(sizeof(MPIDI_PT_single_op));
-	if (new_ptr->pt_single_op == NULL) {
-	    MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-				 "MPIDI_PT_Single_op");
-	}
-	
-	if (prev_ptr != NULL)
-	    prev_ptr->next = new_ptr;
-	else 
-	    win_ptr->lock_queue = new_ptr;
-        
-	new_ptr->next = NULL;  
-	new_ptr->lock_type = lock_get_unlock_pkt->lock_type;
-	new_ptr->source_win_handle = lock_get_unlock_pkt->source_win_handle;
-	new_ptr->vc = vc;
-	
-	new_ptr->pt_single_op->type = MPIDI_RMA_GET;
-	new_ptr->pt_single_op->flags = lock_get_unlock_pkt->flags;
-	new_ptr->pt_single_op->addr = lock_get_unlock_pkt->addr;
-	new_ptr->pt_single_op->count = lock_get_unlock_pkt->count;
-	new_ptr->pt_single_op->datatype = lock_get_unlock_pkt->datatype;
-	new_ptr->pt_single_op->data = NULL;
-	new_ptr->pt_single_op->request_handle = lock_get_unlock_pkt->request_handle;
-	new_ptr->pt_single_op->data_recd = 1;
+        /* queue the information */
+        MPIDI_Win_lock_queue *curr_ptr, *prev_ptr, *new_ptr;
+
+        /* FIXME: MT: This may need to be done atomically. */
+
+        curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
+        prev_ptr = curr_ptr;
+        while (curr_ptr != NULL) {
+            prev_ptr = curr_ptr;
+            curr_ptr = curr_ptr->next;
+        }
+
+        MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
+        new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
+        MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
+        if (!new_ptr) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_Win_lock_queue");
+        }
+        new_ptr->pt_single_op = (MPIDI_PT_single_op *) MPIU_Malloc(sizeof(MPIDI_PT_single_op));
+        if (new_ptr->pt_single_op == NULL) {
+            MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                                 "MPIDI_PT_Single_op");
+        }
+
+        if (prev_ptr != NULL)
+            prev_ptr->next = new_ptr;
+        else
+            win_ptr->lock_queue = new_ptr;
+
+        new_ptr->next = NULL;
+        new_ptr->lock_type = lock_get_unlock_pkt->lock_type;
+        new_ptr->source_win_handle = lock_get_unlock_pkt->source_win_handle;
+        new_ptr->vc = vc;
+
+        new_ptr->pt_single_op->type = MPIDI_RMA_GET;
+        new_ptr->pt_single_op->flags = lock_get_unlock_pkt->flags;
+        new_ptr->pt_single_op->addr = lock_get_unlock_pkt->addr;
+        new_ptr->pt_single_op->count = lock_get_unlock_pkt->count;
+        new_ptr->pt_single_op->datatype = lock_get_unlock_pkt->datatype;
+        new_ptr->pt_single_op->data = NULL;
+        new_ptr->pt_single_op->request_handle = lock_get_unlock_pkt->request_handle;
+        new_ptr->pt_single_op->data_recd = 1;
     }
-    
+
     *rreqp = NULL;
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGETUNLOCK);
     return mpi_errno;
 }
@@ -5617,11 +5476,10 @@ int MPIDI_CH3_PktHandler_LockGetUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_LockAccumUnlock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-					  MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_LockAccumUnlock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                         MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_lock_accum_unlock_t * lock_accum_unlock_pkt = 
-	&pkt->lock_accum_unlock;
+    MPIDI_CH3_Pkt_lock_accum_unlock_t *lock_accum_unlock_pkt = &pkt->lock_accum_unlock;
     MPID_Request *req = NULL;
     MPID_Win *win_ptr = NULL;
     MPIDI_Win_lock_queue *curr_ptr = NULL, *prev_ptr = NULL, *new_ptr = NULL;
@@ -5631,65 +5489,64 @@ int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     MPIDI_msg_sz_t data_len;
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACCUMUNLOCK);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACCUMUNLOCK);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received lock_accum_unlock pkt");
-    
-    /* no need to acquire the lock here because we need to receive the 
-       data into a temporary buffer first */
-    
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock_accum_unlock pkt");
+
+    /* no need to acquire the lock here because we need to receive the
+     * data into a temporary buffer first */
+
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
 
     req = MPID_Request_create();
     MPIU_Object_set_ref(req, 1);
-    
+
     req->dev.datatype = lock_accum_unlock_pkt->datatype;
     MPID_Datatype_get_size_macro(lock_accum_unlock_pkt->datatype, type_size);
     req->dev.recv_data_sz = type_size * lock_accum_unlock_pkt->count;
     req->dev.user_count = lock_accum_unlock_pkt->count;
     req->dev.target_win_handle = lock_accum_unlock_pkt->target_win_handle;
     req->dev.flags = lock_accum_unlock_pkt->flags;
-    
+
     /* queue the information */
-    
+
     MPIR_T_PVAR_TIMER_START(RMA, rma_lockqueue_alloc);
     new_ptr = (MPIDI_Win_lock_queue *) MPIU_Malloc(sizeof(MPIDI_Win_lock_queue));
     MPIR_T_PVAR_TIMER_END(RMA, rma_lockqueue_alloc);
     if (!new_ptr) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-			     "MPIDI_Win_lock_queue");
+        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                             "MPIDI_Win_lock_queue");
     }
-    
+
     new_ptr->pt_single_op = (MPIDI_PT_single_op *) MPIU_Malloc(sizeof(MPIDI_PT_single_op));
     if (new_ptr->pt_single_op == NULL) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %s",
-			     "MPIDI_PT_single_op");
+        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s",
+                             "MPIDI_PT_single_op");
     }
-    
+
     MPID_Win_get_ptr(lock_accum_unlock_pkt->target_win_handle, win_ptr);
-    
+
     /* FIXME: MT: The queuing may need to be done atomically. */
-    
+
     curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue;
     prev_ptr = curr_ptr;
-    while (curr_ptr != NULL)
-    {
-	prev_ptr = curr_ptr;
-	curr_ptr = curr_ptr->next;
+    while (curr_ptr != NULL) {
+        prev_ptr = curr_ptr;
+        curr_ptr = curr_ptr->next;
     }
-    
+
     if (prev_ptr != NULL)
-	prev_ptr->next = new_ptr;
-    else 
-	win_ptr->lock_queue = new_ptr;
-    
-    new_ptr->next = NULL;  
+        prev_ptr->next = new_ptr;
+    else
+        win_ptr->lock_queue = new_ptr;
+
+    new_ptr->next = NULL;
     new_ptr->lock_type = lock_accum_unlock_pkt->lock_type;
     new_ptr->source_win_handle = lock_accum_unlock_pkt->source_win_handle;
     new_ptr->vc = vc;
-    
+
     new_ptr->pt_single_op->type = MPIDI_RMA_ACCUMULATE;
     new_ptr->pt_single_op->flags = lock_accum_unlock_pkt->flags;
     new_ptr->pt_single_op->addr = lock_accum_unlock_pkt->addr;
@@ -5699,41 +5556,38 @@ int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
     /* allocate memory to receive the data */
     new_ptr->pt_single_op->data = MPIU_Malloc(req->dev.recv_data_sz);
     if (new_ptr->pt_single_op->data == NULL) {
-	MPIU_ERR_SETANDJUMP1(mpi_errno,MPI_ERR_OTHER,"**nomem","**nomem %d",
-			     req->dev.recv_data_sz);
+        MPIU_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %d",
+                             req->dev.recv_data_sz);
     }
-    
+
     new_ptr->pt_single_op->data_recd = 0;
-    
+
     MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_PT_SINGLE_ACCUM);
     req->dev.user_buf = new_ptr->pt_single_op->data;
     req->dev.lock_queue_entry = new_ptr;
-    
+
     *rreqp = req;
-    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len,
-                                              &complete);
+    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
     /* FIXME:  Only change the handling of completion if
-       post_data_receive reset the handler.  There should
-       be a cleaner way to do this */
+     * post_data_receive reset the handler.  There should
+     * be a cleaner way to do this */
     if (!req->dev.OnDataAvail) {
         req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SinglePutAccumComplete;
     }
     if (mpi_errno != MPI_SUCCESS) {
-        MPIU_ERR_SET1(mpi_errno,MPI_ERR_OTHER,"**ch3|postrecv",
+        MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv",
                       "**ch3|postrecv %s", "MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK");
     }
     /* return the number of bytes processed in this function */
     *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
 
-    if (complete)
-    {
+    if (complete) {
         mpi_errno = MPIDI_CH3_ReqHandler_SinglePutAccumComplete(vc, req, &complete);
-        if (complete)
-        {
+        if (complete) {
             *rreqp = NULL;
         }
     }
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACCUMUNLOCK);
     return mpi_errno;
 }
@@ -5742,11 +5596,11 @@ int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_GetResp
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_GetResp( MPIDI_VC_t *vc ATTRIBUTE((unused)), 
-				  MPIDI_CH3_Pkt_t *pkt,
-				  MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
+                                 MPIDI_CH3_Pkt_t * pkt,
+                                 MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &pkt->get_resp;
+    MPIDI_CH3_Pkt_get_resp_t *get_resp_pkt = &pkt->get_resp;
     MPID_Request *req;
     int complete;
     char *data_buf = NULL;
@@ -5754,35 +5608,34 @@ int MPIDI_CH3_PktHandler_GetResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
     int mpi_errno = MPI_SUCCESS;
     MPI_Aint type_size;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
-    
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received get response pkt");
+
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received get response pkt");
 
     data_len = *buflen - sizeof(MPIDI_CH3_Pkt_t);
-    data_buf = (char *)pkt + sizeof(MPIDI_CH3_Pkt_t);
-    
+    data_buf = (char *) pkt + sizeof(MPIDI_CH3_Pkt_t);
+
     MPID_Request_get_ptr(get_resp_pkt->request_handle, req);
-    
+
     MPID_Datatype_get_size_macro(req->dev.datatype, type_size);
     req->dev.recv_data_sz = type_size * req->dev.user_count;
-    
+
     *rreqp = req;
-    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf,
-                                              &data_len, &complete);
-    MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv", "**ch3|postrecv %s", "MPIDI_CH3_PKT_GET_RESP");
-    if (complete)
-    {
+    mpi_errno = MPIDI_CH3U_Receive_data_found(req, data_buf, &data_len, &complete);
+    MPIU_ERR_CHKANDJUMP1(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|postrecv", "**ch3|postrecv %s",
+                         "MPIDI_CH3_PKT_GET_RESP");
+    if (complete) {
         MPIDI_CH3U_Request_complete(req);
         *rreqp = NULL;
     }
     /* return the number of bytes processed in this function */
     *buflen = data_len + sizeof(MPIDI_CH3_Pkt_t);
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -5790,25 +5643,25 @@ int MPIDI_CH3_PktHandler_GetResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #define FUNCNAME MPIDI_CH3_PktHandler_LockGranted
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_LockGranted( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-				      MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_LockGranted(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                     MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_lock_granted_t * lock_granted_pkt = &pkt->lock_granted;
+    MPIDI_CH3_Pkt_lock_granted_t *lock_granted_pkt = &pkt->lock_granted;
     MPID_Win *win_ptr = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received lock granted pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock granted pkt");
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
 
     MPID_Win_get_ptr(lock_granted_pkt->source_win_handle, win_ptr);
     /* set the remote_lock_state flag in the window */
     win_ptr->targets[lock_granted_pkt->target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
-    
+
     *rreqp = NULL;
-    MPIDI_CH3_Progress_signal_completion();	
+    MPIDI_CH3_Progress_signal_completion();
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
     return MPI_SUCCESS;
@@ -5818,29 +5671,32 @@ int MPIDI_CH3_PktHandler_LockGranted( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_PtRMADone
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_PtRMADone( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-				    MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_PtRMADone(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                                   MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
-    MPIDI_CH3_Pkt_pt_rma_done_t * pt_rma_done_pkt = &pkt->pt_rma_done;
+    MPIDI_CH3_Pkt_pt_rma_done_t *pt_rma_done_pkt = &pkt->pt_rma_done;
     MPID_Win *win_ptr = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
-    
+
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
 
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received shared lock ops done pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received shared lock ops done pkt");
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
 
     MPID_Win_get_ptr(pt_rma_done_pkt->source_win_handle, win_ptr);
-    MPIU_Assert(win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE);
+    MPIU_Assert(win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state !=
+                MPIDI_CH3_WIN_LOCK_NONE);
 
-    if (win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state == MPIDI_CH3_WIN_LOCK_FLUSH)
-        win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_GRANTED;
+    if (win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state ==
+        MPIDI_CH3_WIN_LOCK_FLUSH)
+        win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state =
+            MPIDI_CH3_WIN_LOCK_GRANTED;
     else
         win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
 
     *rreqp = NULL;
-    MPIDI_CH3_Progress_signal_completion();	
+    MPIDI_CH3_Progress_signal_completion();
 
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
     return MPI_SUCCESS;
@@ -5851,17 +5707,17 @@ int MPIDI_CH3_PktHandler_PtRMADone( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
 #define FUNCNAME MPIDI_CH3_PktHandler_Unlock
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Unlock( MPIDI_VC_t *vc ATTRIBUTE((unused)),
-                                 MPIDI_CH3_Pkt_t *pkt,
-                                 MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Unlock(MPIDI_VC_t * vc ATTRIBUTE((unused)),
+                                MPIDI_CH3_Pkt_t * pkt,
+                                MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPIDI_CH3_Pkt_unlock_t * unlock_pkt = &pkt->unlock;
+    MPIDI_CH3_Pkt_unlock_t *unlock_pkt = &pkt->unlock;
     MPID_Win *win_ptr = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received unlock pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received unlock pkt");
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     *rreqp = NULL;
@@ -5872,11 +5728,11 @@ int MPIDI_CH3_PktHandler_Unlock( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 
     MPIDI_CH3_Progress_signal_completion();
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_UNLOCK);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -5886,32 +5742,32 @@ int MPIDI_CH3_PktHandler_Unlock( MPIDI_VC_t *vc ATTRIBUTE((unused)),
 #define FUNCNAME MPIDI_CH3_PktHandler_Flush
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_PktHandler_Flush( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
-                                MPIDI_msg_sz_t *buflen, MPID_Request **rreqp )
+int MPIDI_CH3_PktHandler_Flush(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
+                               MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
 {
     int mpi_errno = MPI_SUCCESS;
-    MPIDI_CH3_Pkt_flush_t * flush_pkt = &pkt->flush;
+    MPIDI_CH3_Pkt_flush_t *flush_pkt = &pkt->flush;
     MPID_Win *win_ptr = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
-    MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received flush pkt");
+    MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received flush pkt");
 
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
     *rreqp = NULL;
 
     /* This is a flush request packet */
     if (flush_pkt->target_win_handle != MPI_WIN_NULL) {
-        MPID_Request *req=NULL;
+        MPID_Request *req = NULL;
 
         MPID_Win_get_ptr(flush_pkt->target_win_handle, win_ptr);
 
         flush_pkt->target_win_handle = MPI_WIN_NULL;
         flush_pkt->target_rank = win_ptr->comm_ptr->rank;
 
-        MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+        MPIU_THREAD_CS_ENTER(CH3COMM, vc);
         mpi_errno = MPIDI_CH3_iStartMsg(vc, flush_pkt, sizeof(*flush_pkt), &req);
-        MPIU_THREAD_CS_EXIT(CH3COMM,vc);
+        MPIU_THREAD_CS_EXIT(CH3COMM, vc);
         MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
 
         /* Release the request returned by iStartMsg */
@@ -5927,11 +5783,11 @@ int MPIDI_CH3_PktHandler_Flush( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
         MPIDI_CH3_Progress_signal_completion();
     }
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSH);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
- fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -5947,19 +5803,19 @@ static inline int poke_progress_engine(void)
 
     MPID_Progress_start(&progress_state);
     mpi_errno = MPID_Progress_poke();
-    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno != MPI_SUCCESS)
+        MPIU_ERR_POP(mpi_errno);
     MPID_Progress_end(&progress_state);
 
- fn_exit:
+  fn_exit:
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
-static inline int rma_list_complete( MPID_Win *win_ptr,
-                                       MPIDI_RMA_Ops_list_t *ops_list )
+static inline int rma_list_complete(MPID_Win * win_ptr, MPIDI_RMA_Ops_list_t * ops_list)
 {
-    int ntimes = 0, mpi_errno=0;
+    int ntimes = 0, mpi_errno = 0;
     MPIDI_RMA_Op_t *curr_ptr;
     MPID_Progress_state progress_state;
 
@@ -5969,37 +5825,37 @@ static inline int rma_list_complete( MPID_Win *win_ptr,
     while (!MPIDI_CH3I_RMA_Ops_isempty(ops_list)) {
         int nDone = 0;
         mpi_errno = rma_list_gc(win_ptr, ops_list, NULL, &nDone);
-        if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
-	ntimes++;
-        
-	/* Wait for something to arrive*/
-	/* In some tests, this hung unless the test ensured that 
-	   there was an incomplete request. */
-        curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
+        if (mpi_errno != MPI_SUCCESS)
+            MPIU_ERR_POP(mpi_errno);
+        ntimes++;
 
+        /* Wait for something to arrive */
+        /* In some tests, this hung unless the test ensured that
+         * there was an incomplete request. */
+        curr_ptr = MPIDI_CH3I_RMA_Ops_head(ops_list);
         /* MT: avoid processing unissued operations enqueued by other
            threads in MPID_Progress_wait() */
         if (curr_ptr && !curr_ptr->request) {
             /* This RMA operation has not been issued yet. */
             break;
         }
-	if (curr_ptr && !MPID_Request_is_complete(curr_ptr->request) ) {
-	    MPIR_T_PVAR_TIMER_START_VAR(RMA, list_block_timer);
-	    mpi_errno = MPID_Progress_wait(&progress_state);
-	    /* --BEGIN ERROR HANDLING-- */
-	    if (mpi_errno != MPI_SUCCESS) {
-		MPID_Progress_end(&progress_state);
-		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**winnoprogress");
-	    }
-	    /* --END ERROR HANDLING-- */
-	    MPIR_T_PVAR_TIMER_END_VAR(RMA, list_block_timer);
-	}
-    } /* While list of rma operation is non-empty */
+        if (curr_ptr && !MPID_Request_is_complete(curr_ptr->request)) {
+            MPIR_T_PVAR_TIMER_START_VAR(RMA, list_block_timer);
+            mpi_errno = MPID_Progress_wait(&progress_state);
+            /* --BEGIN ERROR HANDLING-- */
+            if (mpi_errno != MPI_SUCCESS) {
+                MPID_Progress_end(&progress_state);
+                MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**winnoprogress");
+            }
+            /* --END ERROR HANDLING-- */
+            MPIR_T_PVAR_TIMER_END_VAR(RMA, list_block_timer);
+        }
+    }   /* While list of rma operation is non-empty */
     MPID_Progress_end(&progress_state);
     MPIR_T_PVAR_COUNTER_INC_VAR(RMA, list_complete_counter, ntimes);
     MPIR_T_PVAR_TIMER_END_VAR(RMA, list_complete_timer);
 
- fn_fail:
+  fn_fail:
     return mpi_errno;
 }
 
@@ -6009,12 +5865,11 @@ static inline int rma_list_complete( MPID_Win *win_ptr,
    when poking progress engine, so that they will not waste internal
    resources.
 */
-static inline int rma_list_gc( MPID_Win *win_ptr,
-                                              MPIDI_RMA_Ops_list_t *ops_list,
-                                              MPIDI_RMA_Op_t *last_elm,
-					      int *nDone )
+static inline int rma_list_gc(MPID_Win * win_ptr,
+                              MPIDI_RMA_Ops_list_t * ops_list,
+                              MPIDI_RMA_Op_t * last_elm, int *nDone)
 {
-    int mpi_errno=0;
+    int mpi_errno = 0;
     MPIDI_RMA_Op_t *curr_ptr;
     int nComplete = 0;
     int nVisit = 0;
@@ -6029,19 +5884,19 @@ static inline int rma_list_gc( MPID_Win *win_ptr,
             /* This RMA operation has not been issued yet. */
             break;
         }
-	if (MPID_Request_is_complete(curr_ptr->request)) {
-	    /* Once we find a complete request, we complete
-	       as many as possible until we find an incomplete
-	       or null request */
-	    do {
-		nComplete++;
-		mpi_errno = curr_ptr->request->status.MPI_ERROR;
-		/* --BEGIN ERROR HANDLING-- */
-		if (mpi_errno != MPI_SUCCESS) {
-		    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rma_msg");
-		}
-		/* --END ERROR HANDLING-- */
-		MPID_Request_release(curr_ptr->request);
+        if (MPID_Request_is_complete(curr_ptr->request)) {
+            /* Once we find a complete request, we complete
+             * as many as possible until we find an incomplete
+             * or null request */
+            do {
+                nComplete++;
+                mpi_errno = curr_ptr->request->status.MPI_ERROR;
+                /* --BEGIN ERROR HANDLING-- */
+                if (mpi_errno != MPI_SUCCESS) {
+                    MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+                }
+                /* --END ERROR HANDLING-- */
+                MPID_Request_release(curr_ptr->request);
                 MPIDI_CH3I_RMA_Ops_free_and_next(ops_list, &curr_ptr);
                 nVisit++;
 
@@ -6051,43 +5906,41 @@ static inline int rma_list_gc( MPID_Win *win_ptr,
                     /* This RMA operation has not been issued yet. */
                     break;
                 }
-	    }
-	    while (curr_ptr && curr_ptr != last_elm && 
-		   MPID_Request_is_complete(curr_ptr->request)) ;
+            }
+            while (curr_ptr && curr_ptr != last_elm && MPID_Request_is_complete(curr_ptr->request));
             if ((MPIR_CVAR_CH3_RMA_GC_NUM_TESTED >= 0 &&
                  nVisit >= MPIR_CVAR_CH3_RMA_GC_NUM_TESTED) ||
                 (MPIR_CVAR_CH3_RMA_GC_NUM_COMPLETED >= 0 &&
                  nComplete >= MPIR_CVAR_CH3_RMA_GC_NUM_COMPLETED)) {
                 /* MPIR_CVAR_CH3_RMA_GC_NUM_TESTED: Once we tested certain
-                   number of requests, we stop checking the rest of the
-                   operation list and break out the loop. */
+                 * number of requests, we stop checking the rest of the
+                 * operation list and break out the loop. */
                 /* MPIR_CVAR_CH3_RMA_GC_NUM_COMPLETED: Once we found
-                   certain number of completed requests, we stop checking
-                   the rest of the operation list and break out the loop. */
-	    break;
+                 * certain number of completed requests, we stop checking
+                 * the rest of the operation list and break out the loop. */
+                break;
             }
-	}
-	else {
-	    /* proceed to the next entry.  */
-	    curr_ptr    = curr_ptr->next;
+        }
+        else {
+            /* proceed to the next entry.  */
+            curr_ptr = curr_ptr->next;
             nVisit++;
-            if (MPIR_CVAR_CH3_RMA_GC_NUM_TESTED >= 0 &&
-                nVisit >= MPIR_CVAR_CH3_RMA_GC_NUM_TESTED) {
+            if (MPIR_CVAR_CH3_RMA_GC_NUM_TESTED >= 0 && nVisit >= MPIR_CVAR_CH3_RMA_GC_NUM_TESTED) {
                 /* MPIR_CVAR_CH3_RMA_GC_NUM_TESTED: Once we tested certain
-                   number of requests, we stop checking the rest of the
-                   operation list and break out the loop. */
+                 * number of requests, we stop checking the rest of the
+                 * operation list and break out the loop. */
                 break;
             }
-	}
+        }
     } while (curr_ptr && curr_ptr != last_elm);
-        
-    /* if (nComplete) printf( "Completed %d requests\n", nComplete ); */
+
+    /* if (nComplete) printf("Completed %d requests\n", nComplete); */
     MPIR_T_PVAR_COUNTER_INC_VAR(RMA, list_complete_counter, 1);
     MPIR_T_PVAR_TIMER_END_VAR(RMA, list_complete_timer);
 
     *nDone = nComplete;
 
- fn_fail:
+  fn_fail:
     return mpi_errno;
 }
 
@@ -6096,7 +5949,7 @@ static inline int rma_list_gc( MPID_Win *win_ptr,
 #define FUNCNAME MPIDI_CH3_Start_rma_op_target
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_Start_rma_op_target(MPID_Win *win_ptr, MPIDI_CH3_Pkt_flags_t flags)
+int MPIDI_CH3_Start_rma_op_target(MPID_Win * win_ptr, MPIDI_CH3_Pkt_flags_t flags)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_START_RMA_OP_TARGET);
@@ -6105,17 +5958,17 @@ int MPIDI_CH3_Start_rma_op_target(MPID_Win *win_ptr, MPIDI_CH3_Pkt_flags_t flags
 
     /* Lock with NOCHECK is piggybacked on this message.  We should be able to
      * immediately grab the lock.  Otherwise, there is a synchronization error. */
-    if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK &&
-        flags & MPIDI_CH3_PKT_FLAG_RMA_NOCHECK)
-    {
+    if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK && flags & MPIDI_CH3_PKT_FLAG_RMA_NOCHECK) {
         int lock_acquired;
         int lock_mode;
 
         if (flags & MPIDI_CH3_PKT_FLAG_RMA_SHARED) {
             lock_mode = MPI_LOCK_SHARED;
-        } else if (flags & MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE) {
+        }
+        else if (flags & MPIDI_CH3_PKT_FLAG_RMA_EXCLUSIVE) {
             lock_mode = MPI_LOCK_EXCLUSIVE;
-        } else {
+        }
+        else {
             MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_RMA_SYNC, "**ch3|rma_flags");
         }
 
@@ -6123,11 +5976,11 @@ int MPIDI_CH3_Start_rma_op_target(MPID_Win *win_ptr, MPIDI_CH3_Pkt_flags_t flags
         MPIU_ERR_CHKANDJUMP(!lock_acquired, mpi_errno, MPI_ERR_RMA_SYNC, "**ch3|nocheck_invalid");
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_START_RMA_OP_TARGET);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
@@ -6137,7 +5990,7 @@ fn_fail:
 #define FUNCNAME MPIDI_CH3_Finish_rma_op_target
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma_update,
+int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t * vc, MPID_Win * win_ptr, int is_rma_update,
                                    MPIDI_CH3_Pkt_flags_t flags, MPI_Win source_win_handle)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -6146,16 +5999,16 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma
     MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_FINISH_RMA_OP_TARGET);
 
     /* This function should be called by the target process after each RMA
-       operation is completed, to update synchronization state. */
+     * operation is completed, to update synchronization state. */
 
     /* If this is a passive target RMA update operation, increment counter.  This is
-       needed in Win_free to ensure that all ops are completed before a window
-       is freed. */
+     * needed in Win_free to ensure that all ops are completed before a window
+     * is freed. */
     if (win_ptr->current_lock_type != MPID_LOCK_NONE && is_rma_update)
         win_ptr->my_pt_rma_puts_accs++;
 
     /* Last RMA operation from source. If active target RMA, decrement window
-       counter. */
+     * counter. */
     if (flags & MPIDI_CH3_PKT_FLAG_RMA_AT_COMPLETE) {
         MPIU_Assert(win_ptr->current_lock_type == MPID_LOCK_NONE);
 
@@ -6168,22 +6021,26 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma
     }
 
     /* If passive target RMA, release lock on window and grant next lock in the
-       lock queue if there is any.  If requested by the origin, send an ack back
-       to indicate completion at the target. */
+     * lock queue if there is any.  If requested by the origin, send an ack back
+     * to indicate completion at the target. */
     else if (flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK) {
         MPIU_Assert(win_ptr->current_lock_type != MPID_LOCK_NONE);
 
         if (flags & MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK) {
             MPIU_Assert(source_win_handle != MPI_WIN_NULL && vc != NULL);
             mpi_errno = MPIDI_CH3I_Send_pt_rma_done_pkt(vc, win_ptr, source_win_handle);
-            if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+            if (mpi_errno) {
+                MPIU_ERR_POP(mpi_errno);
+            }
         }
 
         mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
-        if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
+        if (mpi_errno) {
+            MPIU_ERR_POP(mpi_errno);
+        }
 
         /* The local process may be waiting for the lock.  Signal completion to
-           wake it up, so it can attempt to grab the lock. */
+         * wake it up, so it can attempt to grab the lock. */
         MPIDI_CH3_Progress_signal_completion();
     }
     else if (flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) {
@@ -6196,7 +6053,7 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma
             MPIDI_CH3_Pkt_flush_t *flush_pkt = &upkt.flush;
             MPID_Request *req = NULL;
 
-            MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received piggybacked flush request");
+            MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received piggybacked flush request");
             MPIU_Assert(source_win_handle != MPI_WIN_NULL && vc != NULL);
 
             MPIDI_Pkt_init(flush_pkt, MPIDI_CH3_PKT_FLUSH);
@@ -6204,10 +6061,11 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma
             flush_pkt->target_win_handle = MPI_WIN_NULL;
             flush_pkt->target_rank = win_ptr->comm_ptr->rank;
 
-            MPIU_THREAD_CS_ENTER(CH3COMM,vc);
+            MPIU_THREAD_CS_ENTER(CH3COMM, vc);
             mpi_errno = MPIDI_CH3_iStartMsg(vc, flush_pkt, sizeof(*flush_pkt), &req);
-            MPIU_THREAD_CS_EXIT(CH3COMM,vc);
-            MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER, "**ch3|rma_msg");
+            MPIU_THREAD_CS_EXIT(CH3COMM, vc);
+            MPIU_ERR_CHKANDJUMP(mpi_errno != MPI_SUCCESS, mpi_errno, MPI_ERR_OTHER,
+                                "**ch3|rma_msg");
 
             /* Release the request returned by iStartMsg */
             if (req != NULL) {
@@ -6216,24 +6074,24 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t *vc, MPID_Win *win_ptr, int is_rma
         }
     }
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_FINISH_RMA_OP_TARGET);
     return mpi_errno;
     /* --BEGIN ERROR HANDLING-- */
-fn_fail:
+  fn_fail:
     goto fn_exit;
     /* --END ERROR HANDLING-- */
 }
 
 
 /* ------------------------------------------------------------------------ */
-/* 
- * For debugging, we provide the following functions for printing the 
+/*
+ * For debugging, we provide the following functions for printing the
  * contents of an RMA packet
  */
 /* ------------------------------------------------------------------------ */
 #ifdef MPICH_DBG_OUTPUT
-int MPIDI_CH3_PktPrint_Put( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+int MPIDI_CH3_PktPrint_Put(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_PUT\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->put.addr));
@@ -6242,10 +6100,11 @@ int MPIDI_CH3_PktPrint_Put( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" dataloop_size. 0x%08X\n", pkt->put.dataloop_size));
     MPIU_DBG_PRINTF((" target ....... 0x%08X\n", pkt->put.target_win_handle));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->put.source_win_handle));
-    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->put.win_ptr));*/
+    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->put.win_ptr)); */
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_Get( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_Get(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_GET\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->get.addr));
@@ -6256,19 +6115,21 @@ int MPIDI_CH3_PktPrint_Get( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" target ....... 0x%08X\n", pkt->get.target_win_handle));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->get.source_win_handle));
     /*
-      MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->get.request));
-      MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
-    */
+     * MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->get.request));
+     * MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->get.win_ptr));
+     */
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_GetResp( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_GetResp(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_GET_RESP\n"));
     MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->get_resp.request_handle));
-    /*MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->get_resp.request));*/
+    /*MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->get_resp.request)); */
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_Accumulate( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_Accumulate(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_ACCUMULATE\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->accum.addr));
@@ -6278,10 +6139,11 @@ int MPIDI_CH3_PktPrint_Accumulate( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" op ........... 0x%08X\n", pkt->accum.op));
     MPIU_DBG_PRINTF((" target ....... 0x%08X\n", pkt->accum.target_win_handle));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->accum.source_win_handle));
-    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->accum.win_ptr));*/
+    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_Accum_Immed( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_Accum_Immed(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_ACCUM_IMMED\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->accum_immed.addr));
@@ -6290,11 +6152,12 @@ int MPIDI_CH3_PktPrint_Accum_Immed( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" op ........... 0x%08X\n", pkt->accum_immed.op));
     MPIU_DBG_PRINTF((" target ....... 0x%08X\n", pkt->accum_immed.target_win_handle));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->accum_immed.source_win_handle));
-    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->accum.win_ptr));*/
+    /*MPIU_DBG_PRINTF((" win_ptr ...... 0x%08X\n", pkt->accum.win_ptr)); */
     fflush(stdout);
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_Lock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_Lock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK\n"));
     MPIU_DBG_PRINTF((" lock_type .... %d\n", pkt->lock.lock_type));
@@ -6302,7 +6165,8 @@ int MPIDI_CH3_PktPrint_Lock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock.source_win_handle));
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_LockPutUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_LockPutUnlock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_PUT_UNLOCK\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->lock_put_unlock.addr));
@@ -6313,7 +6177,8 @@ int MPIDI_CH3_PktPrint_LockPutUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_put_unlock.source_win_handle));
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_LockAccumUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_LockAccumUnlock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->lock_accum_unlock.addr));
@@ -6324,7 +6189,8 @@ int MPIDI_CH3_PktPrint_LockAccumUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_accum_unlock.source_win_handle));
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_LockGetUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_LockGetUnlock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_GET_UNLOCK\n"));
     MPIU_DBG_PRINTF((" addr ......... %p\n", pkt->lock_get_unlock.addr));
@@ -6336,13 +6202,15 @@ int MPIDI_CH3_PktPrint_LockGetUnlock( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
     MPIU_DBG_PRINTF((" request ...... 0x%08X\n", pkt->lock_get_unlock.request_handle));
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_PtRMADone( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_PtRMADone(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_PT_RMA_DONE\n"));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_accum_unlock.source_win_handle));
     return MPI_SUCCESS;
 }
-int MPIDI_CH3_PktPrint_LockGranted( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
+
+int MPIDI_CH3_PktPrint_LockGranted(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
 {
     MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_GRANTED\n"));
     MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_granted.source_win_handle));
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index 685b665..639a8c5 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -17,7 +17,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
 MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_set);
 
 static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
-                    MPID_Comm *comm_ptr, MPID_Win **win_ptr);
+                    MPID_Comm * comm_ptr, MPID_Win ** win_ptr);
 
 
 #define MPID_WIN_FTABLE_SET_DEFAULTS(win_ptr)                   \
@@ -68,29 +68,32 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 #define FUNCNAME MPID_Win_create
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *info, 
-                    MPID_Comm *comm_ptr, MPID_Win **win_ptr)
+int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info * info,
+                    MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_CREATE);
-    
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_CREATE);
 
     /* Check to make sure the communicator hasn't already been revoked */
     if (comm_ptr->revoked) {
-        MPIU_ERR_SETANDJUMP(mpi_errno,MPIX_ERR_REVOKED,"**revoked");
+        MPIU_ERR_SETANDJUMP(mpi_errno, MPIX_ERR_REVOKED, "**revoked");
     }
 
-    mpi_errno = win_init(size, disp_unit, MPI_WIN_FLAVOR_CREATE, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    mpi_errno =
+        win_init(size, disp_unit, MPI_WIN_FLAVOR_CREATE, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     (*win_ptr)->base = base;
 
-    mpi_errno = MPIDI_CH3U_Win_fns.create(base, size, disp_unit, info, comm_ptr, win_ptr); 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    mpi_errno = MPIDI_CH3U_Win_fns.create(base, size, disp_unit, info, comm_ptr, win_ptr);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_CREATE);
     return mpi_errno;
 }
@@ -100,32 +103,37 @@ int MPID_Win_create(void *base, MPI_Aint size, int disp_unit, MPID_Info *info,
 #define FUNCNAME MPID_Win_allocate
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info *info, 
-                    MPID_Comm *comm_ptr, void *baseptr, MPID_Win **win_ptr)
+int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info * info,
+                      MPID_Comm * comm_ptr, void *baseptr, MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_ALLOCATE);
-    
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_ALLOCATE);
 
-    mpi_errno = win_init(size, disp_unit, MPI_WIN_FLAVOR_ALLOCATE, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    mpi_errno =
+        win_init(size, disp_unit, MPI_WIN_FLAVOR_ALLOCATE, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
     /* FOR ALLOCATE, alloc_shm info is default to set to TRUE */
     (*win_ptr)->info_args.alloc_shm = TRUE;
 
     if (info != NULL) {
         int alloc_shm_flag = 0;
-        char shm_alloc_value[MPI_MAX_INFO_VAL+1];
+        char shm_alloc_value[MPI_MAX_INFO_VAL + 1];
         MPIR_Info_get_impl(info, "alloc_shm", MPI_MAX_INFO_VAL, shm_alloc_value, &alloc_shm_flag);
         if ((alloc_shm_flag == 1) && (!strncmp(shm_alloc_value, "false", sizeof("false"))))
             (*win_ptr)->info_args.alloc_shm = FALSE;
     }
 
     mpi_errno = MPIDI_CH3U_Win_fns.allocate(size, disp_unit, info, comm_ptr, baseptr, win_ptr);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_ALLOCATE);
     return mpi_errno;
 }
@@ -135,28 +143,29 @@ int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info *info,
 #define FUNCNAME MPID_Win_create_dynamic
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_create_dynamic(MPID_Info *info, MPID_Comm *comm_ptr,
-                            MPID_Win **win_ptr)
+int MPID_Win_create_dynamic(MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_CREATE_DYNAMIC);
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_CREATE_DYNAMIC);
 
-    mpi_errno = win_init(0 /* spec defines size to be 0 */,
-                         1 /* spec defines disp_unit to be 1 */,
-                         MPI_WIN_FLAVOR_DYNAMIC, MPI_WIN_UNIFIED,
-                         comm_ptr, win_ptr);
+    mpi_errno = win_init(0 /* spec defines size to be 0 */ ,
+                         1 /* spec defines disp_unit to be 1 */ ,
+                         MPI_WIN_FLAVOR_DYNAMIC, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
 
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     (*win_ptr)->base = MPI_BOTTOM;
 
     mpi_errno = MPIDI_CH3U_Win_fns.create_dynamic(info, comm_ptr, win_ptr);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_CREATE_DYNAMIC);
     return mpi_errno;
 }
@@ -167,15 +176,15 @@ int MPID_Win_create_dynamic(MPID_Info *info, MPID_Comm *comm_ptr,
 #define FUNCNAME MPID_Alloc_mem
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-void *MPID_Alloc_mem( size_t size, MPID_Info *info_ptr )
+void *MPID_Alloc_mem(size_t size, MPID_Info * info_ptr)
 {
-    void *ap=NULL;
+    void *ap = NULL;
     MPIDI_STATE_DECL(MPID_STATE_MPID_ALLOC_MEM);
 
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_ALLOC_MEM);
 
     ap = MPIDI_Alloc_mem(size, info_ptr);
-    
+
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_ALLOC_MEM);
     return ap;
 }
@@ -185,7 +194,7 @@ void *MPID_Alloc_mem( size_t size, MPID_Info *info_ptr )
 #define FUNCNAME MPID_Free_mem
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Free_mem( void *ptr )
+int MPID_Free_mem(void *ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_FREE_MEM);
@@ -194,10 +203,10 @@ int MPID_Free_mem( void *ptr )
 
     mpi_errno = MPIDI_Free_mem(ptr);
     if (mpi_errno != MPI_SUCCESS) {
-	MPIU_ERR_POP(mpi_errno);
+        MPIU_ERR_POP(mpi_errno);
     }
-        
- fn_fail:
+
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_FREE_MEM);
     return mpi_errno;
 }
@@ -207,34 +216,38 @@ int MPID_Free_mem( void *ptr )
 #define FUNCNAME MPID_Win_allocate_shared
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info *info, MPID_Comm *comm_ptr,
-                             void *base_ptr, MPID_Win **win_ptr)
+int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info * info, MPID_Comm * comm_ptr,
+                             void *base_ptr, MPID_Win ** win_ptr)
 {
-    int mpi_errno=MPI_SUCCESS;
+    int mpi_errno = MPI_SUCCESS;
 
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_ALLOCATE_SHARED);
-    
+
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPID_WIN_ALLOCATE_SHARED);
 
-    mpi_errno = win_init(size, disp_unit, MPI_WIN_FLAVOR_SHARED, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    mpi_errno =
+        win_init(size, disp_unit, MPI_WIN_FLAVOR_SHARED, MPI_WIN_UNIFIED, comm_ptr, win_ptr);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     /* FOR ALLOCATE_SHARED, alloc_shm info is default to set to TRUE */
     (*win_ptr)->info_args.alloc_shm = TRUE;
 
     if (info != NULL) {
         int alloc_shm_flag = 0;
-        char shm_alloc_value[MPI_MAX_INFO_VAL+1];
+        char shm_alloc_value[MPI_MAX_INFO_VAL + 1];
         MPIR_Info_get_impl(info, "alloc_shm", MPI_MAX_INFO_VAL, shm_alloc_value, &alloc_shm_flag);
         /* if value of 'alloc_shm' info is not set to true, throw an error */
         if (alloc_shm_flag == 1 && strncmp(shm_alloc_value, "true", sizeof("true")))
             MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**infoval");
     }
 
-    mpi_errno = MPIDI_CH3U_Win_fns.allocate_shared(size, disp_unit, info, comm_ptr, base_ptr, win_ptr);
-    if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
+    mpi_errno =
+        MPIDI_CH3U_Win_fns.allocate_shared(size, disp_unit, info, comm_ptr, base_ptr, win_ptr);
+    if (mpi_errno != MPI_SUCCESS)
+        MPIU_ERR_POP(mpi_errno);
 
- fn_fail:
+  fn_fail:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_ALLOCATE_SHARED);
     return mpi_errno;
 }
@@ -245,7 +258,7 @@ int MPID_Win_allocate_shared(MPI_Aint size, int disp_unit, MPID_Info *info, MPID
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)
 static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
-                          MPID_Comm *comm_ptr, MPID_Win **win_ptr)
+                    MPID_Comm * comm_ptr, MPID_Win ** win_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     int i;
@@ -255,7 +268,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
 
     MPIDI_FUNC_ENTER(MPID_STATE_WIN_INIT);
 
-    if(initRMAoptions) {
+    if (initRMAoptions) {
         MPIU_THREADSAFE_INIT_BLOCK_BEGIN(initRMAoptions);
 
         MPIDI_CH3_RMA_Init_Pvars();
@@ -264,45 +277,46 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
         MPIU_THREADSAFE_INIT_BLOCK_END(initRMAoptions);
     }
 
-    *win_ptr = (MPID_Win *)MPIU_Handle_obj_alloc( &MPID_Win_mem );
-    MPIU_ERR_CHKANDJUMP1(!(*win_ptr),mpi_errno,MPI_ERR_OTHER,"**nomem",
-                         "**nomem %s","MPID_Win_mem");
+    *win_ptr = (MPID_Win *) MPIU_Handle_obj_alloc(&MPID_Win_mem);
+    MPIU_ERR_CHKANDJUMP1(!(*win_ptr), mpi_errno, MPI_ERR_OTHER, "**nomem",
+                         "**nomem %s", "MPID_Win_mem");
 
     mpi_errno = MPIR_Comm_dup_impl(comm_ptr, &win_comm_ptr);
-    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
+    if (mpi_errno)
+        MPIU_ERR_POP(mpi_errno);
 
     MPIU_Object_set_ref(*win_ptr, 1);
 
-    (*win_ptr)->fence_issued        = 0;
+    (*win_ptr)->fence_issued = 0;
     /* (*win_ptr)->errhandler is set by upper level; */
     /* (*win_ptr)->base is set by caller; */
-    (*win_ptr)->size                = size;
-    (*win_ptr)->disp_unit           = disp_unit;
-    (*win_ptr)->create_flavor       = create_flavor;
-    (*win_ptr)->model               = model;
-    (*win_ptr)->attributes          = NULL;
-    (*win_ptr)->start_group_ptr     = NULL;
-    (*win_ptr)->start_assert        = 0;
-    (*win_ptr)->comm_ptr            = win_comm_ptr;
+    (*win_ptr)->size = size;
+    (*win_ptr)->disp_unit = disp_unit;
+    (*win_ptr)->create_flavor = create_flavor;
+    (*win_ptr)->model = model;
+    (*win_ptr)->attributes = NULL;
+    (*win_ptr)->start_group_ptr = NULL;
+    (*win_ptr)->start_assert = 0;
+    (*win_ptr)->comm_ptr = win_comm_ptr;
 
     (*win_ptr)->at_completion_counter = 0;
     /* (*win_ptr)->base_addrs[] is set by caller; */
     /* (*win_ptr)->sizes[] is set by caller; */
     /* (*win_ptr)->disp_units[] is set by caller; */
     /* (*win_ptr)->all_win_handles[] is set by caller; */
-    (*win_ptr)->current_lock_type   = MPID_LOCK_NONE;
+    (*win_ptr)->current_lock_type = MPID_LOCK_NONE;
     (*win_ptr)->shared_lock_ref_cnt = 0;
-    (*win_ptr)->lock_queue          = NULL;
-    (*win_ptr)->pt_rma_puts_accs    = NULL;
+    (*win_ptr)->lock_queue = NULL;
+    (*win_ptr)->pt_rma_puts_accs = NULL;
     (*win_ptr)->my_pt_rma_puts_accs = 0;
-    (*win_ptr)->epoch_state         = MPIDI_EPOCH_NONE;
-    (*win_ptr)->epoch_count         = 0;
-    (*win_ptr)->at_rma_ops_list     = NULL;
-    (*win_ptr)->shm_allocated       = FALSE;
+    (*win_ptr)->epoch_state = MPIDI_EPOCH_NONE;
+    (*win_ptr)->epoch_count = 0;
+    (*win_ptr)->at_rma_ops_list = NULL;
+    (*win_ptr)->shm_allocated = FALSE;
 
     /* Initialize the passive target lock state */
     MPIU_CHKPMEM_MALLOC((*win_ptr)->targets, struct MPIDI_Win_target_state *,
-                        sizeof(struct MPIDI_Win_target_state)*MPIR_Comm_size(win_comm_ptr),
+                        sizeof(struct MPIDI_Win_target_state) * MPIR_Comm_size(win_comm_ptr),
                         mpi_errno, "RMA target states array");
 
     for (i = 0; i < MPIR_Comm_size(win_comm_ptr); i++) {
@@ -311,20 +325,20 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
     }
 
     /* Initialize the info flags */
-    (*win_ptr)->info_args.no_locks            = 0;
+    (*win_ptr)->info_args.no_locks = 0;
     (*win_ptr)->info_args.accumulate_ordering = MPIDI_ACC_ORDER_RAR | MPIDI_ACC_ORDER_RAW |
-                                                MPIDI_ACC_ORDER_WAR | MPIDI_ACC_ORDER_WAW;
-    (*win_ptr)->info_args.accumulate_ops      = MPIDI_ACC_OPS_SAME_OP_NO_OP;
-    (*win_ptr)->info_args.same_size           = 0;
+        MPIDI_ACC_ORDER_WAR | MPIDI_ACC_ORDER_WAW;
+    (*win_ptr)->info_args.accumulate_ops = MPIDI_ACC_OPS_SAME_OP_NO_OP;
+    (*win_ptr)->info_args.same_size = 0;
     (*win_ptr)->info_args.alloc_shared_noncontig = 0;
     (*win_ptr)->info_args.alloc_shm = FALSE;
 
     MPID_WIN_FTABLE_SET_DEFAULTS(win_ptr);
 
-fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_WIN_INIT);
     return mpi_errno;
-fn_fail:
+  fn_fail:
     MPIU_CHKPMEM_REAP();
     goto fn_exit;
 }
@@ -334,7 +348,7 @@ fn_fail:
 #define FUNCNAME MPID_Win_set_info
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_set_info(MPID_Win *win, MPID_Info *info)
+int MPID_Win_set_info(MPID_Win * win, MPID_Info * info)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_SET_INFO);
@@ -342,12 +356,14 @@ int MPID_Win_set_info(MPID_Win *win, MPID_Info *info)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_WIN_SET_INFO);
 
     mpi_errno = win->RMAFns.Win_set_info(win, info);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_SET_INFO);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }
 
@@ -356,7 +372,7 @@ int MPID_Win_set_info(MPID_Win *win, MPID_Info *info)
 #define FUNCNAME MPID_Win_get_info
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPID_Win_get_info(MPID_Win *win, MPID_Info **info_used)
+int MPID_Win_get_info(MPID_Win * win, MPID_Info ** info_used)
 {
     int mpi_errno = MPI_SUCCESS;
     MPIDI_STATE_DECL(MPID_STATE_MPID_WIN_GET_INFO);
@@ -364,11 +380,13 @@ int MPID_Win_get_info(MPID_Win *win, MPID_Info **info_used)
     MPIDI_FUNC_ENTER(MPID_STATE_MPID_WIN_GET_INFO);
 
     mpi_errno = win->RMAFns.Win_get_info(win, info_used);
-    if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
+    if (mpi_errno != MPI_SUCCESS) {
+        MPIU_ERR_POP(mpi_errno);
+    }
 
- fn_exit:
+  fn_exit:
     MPIDI_FUNC_EXIT(MPID_STATE_MPID_WIN_GET_INFO);
     return mpi_errno;
- fn_fail:
+  fn_fail:
     goto fn_exit;
 }

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

Summary of changes:
 src/mpid/ch3/include/mpidpkt.h      |  316 +--
 src/mpid/ch3/include/mpidrma.h      |  587 +++---
 src/mpid/ch3/src/ch3u_rma_acc_ops.c |  103 +-
 src/mpid/ch3/src/ch3u_rma_ops.c     |  365 ++--
 src/mpid/ch3/src/ch3u_rma_reqops.c  |  180 +-
 src/mpid/ch3/src/ch3u_rma_sync.c    | 4718 +++++++++++++++++------------------
 src/mpid/ch3/src/mpid_rma.c         |  184 +-
 7 files changed, 3162 insertions(+), 3291 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list