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

Service Account noreply at mpich.org
Tue Aug 4 00:02:34 CDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  0bf19e5964a1436b64a5408e25a84a9c84c57c10 (commit)
       via  d6736337379e54a38e3ddbb513c6a6de99085d93 (commit)
       via  16da069598460e9482bbce66ed108c0ebed980f9 (commit)
       via  277290f386a2c08f8ff08f3c28e376dbecb84579 (commit)
       via  e14a94eed62a1db783020023aed712c558620cdb (commit)
      from  d0372e05410f30a9ea260609325417ec58479905 (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/0bf19e5964a1436b64a5408e25a84a9c84c57c10

commit 0bf19e5964a1436b64a5408e25a84a9c84c57c10
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Mon Aug 3 22:30:46 2015 -0500

    Bug-fix: call check_and_set_req_completion for OP piggybacked with lock.
    
    For op piggybacked with LOCK, after lock granted ACK is received,
    origin side should not complete and delete the operation immediately,
    because data in GET-like operations may not be received completely.
    Origin side should set req cb function to let the request to complete
    the operation.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index bb9d51f..3b5a70c 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -734,6 +734,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
     MPIDI_RMA_Target_t *target = NULL;
     MPIDI_RMA_Op_t *op = NULL;
     MPIDI_CH3_Pkt_flags_t op_flags = MPIDI_CH3_PKT_FLAG_NONE;
+    int op_completed ATTRIBUTE((unused)) = FALSE;
     int mpi_errno = MPI_SUCCESS;
 
     mpi_errno = MPIDI_CH3I_Win_find_target(win_ptr, target_rank, &target);
@@ -752,18 +753,6 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
 
     if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
 
-        if (op->reqs_size > 0) {
-            MPID_Request **req = NULL;
-            if (op->reqs_size == 1)
-                req = &(op->single_req);
-            else
-                req = &(op->multi_reqs[0]);
-
-            MPIU_Assert((*req) != NULL);
-            MPID_Request_release((*req));
-            (*req) = NULL;
-        }
-
         if ((op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE || op->pkt.type == MPIDI_CH3_PKT_GET_ACCUM)
             && op->issued_stream_count != ALL_STREAM_UNITS_ISSUED) {
             /* Now we successfully issue out the first stream unit,
@@ -783,23 +772,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
             }
         }
 
-        if (op->ureq != NULL) {
-            /* Complete user request and release the ch3 ref */
-            mpi_errno = MPID_Request_complete(op->ureq);
-            if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
-            }
-        }
-
-        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_net_ops_list_head), op);
-
-        if (target->pending_net_ops_list_head == NULL) {
-            win_ptr->num_targets_with_pending_net_ops--;
-            MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
-            if (win_ptr->num_targets_with_pending_net_ops == 0) {
-                MPIDI_CH3I_Win_set_inactive(win_ptr);
-            }
-        }
+        check_and_set_req_completion(win_ptr, target, op, &op_completed);
     }
     else if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_DISCARDED ||
              flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED) {

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

commit d6736337379e54a38e3ddbb513c6a6de99085d93
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Mon Aug 3 22:30:11 2015 -0500

    move static function check_and_set_req_completion to header file.
    
    This static function checks the completion of requests in RMA
    operation and sets completion cb function if requests are not
    completed. Originally it was only used in RMA issuing progress,
    now we need to use it in handle_lock_with_op as well, so here
    we move it to the header file.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 91816f0..bb9d51f 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -641,6 +641,93 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
     goto fn_exit;
 }
 
+
+#undef FUNCNAME
+#define FUNCNAME check_and_set_req_completion
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
+                                               MPIDI_RMA_Op_t * rma_op, int *op_completed)
+{
+    int i, mpi_errno = MPI_SUCCESS;
+    MPID_Request **req = NULL;
+    MPIDI_STATE_DECL(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+
+    MPIDI_RMA_FUNC_ENTER(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+
+    (*op_completed) = FALSE;
+
+    if (rma_op->reqs_size > 0) {
+        for (i = 0; i < rma_op->reqs_size; i++) {
+            if (rma_op->reqs_size == 1)
+                req = &(rma_op->single_req);
+            else
+                req = &(rma_op->multi_reqs[i]);
+
+            if ((*req) == NULL)
+                continue;
+
+            if (MPID_Request_is_complete((*req))) {
+                MPID_Request_release((*req));
+                (*req) = NULL;
+            }
+            else {
+                MPID_Request_release((*req));
+                (*req)->request_completed_cb = MPIDI_CH3_Req_handler_rma_op_complete;
+                (*req)->dev.source_win_handle = win_ptr->handle;
+                (*req)->dev.rma_op_ptr = rma_op;
+
+                rma_op->ref_cnt++;
+
+                if (rma_op->ureq != NULL) {
+                    MPID_cc_set(&(rma_op->ureq->cc), rma_op->ref_cnt);
+                    (*req)->dev.request_handle = rma_op->ureq->handle;
+                }
+            }
+        }
+    }
+
+    if (rma_op->ref_cnt == 0) {
+        if (rma_op->ureq != NULL) {
+            mpi_errno = MPID_Request_complete(rma_op->ureq);
+            if (mpi_errno != MPI_SUCCESS) {
+                MPIU_ERR_POP(mpi_errno);
+            }
+        }
+        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_net_ops_list_head), rma_op);
+
+        (*op_completed) = TRUE;
+    }
+    else {
+        MPIDI_RMA_Op_t **list_ptr = NULL;
+
+        MPIDI_CH3I_RMA_Get_issued_list_ptr(target, rma_op, list_ptr, mpi_errno);
+        if (mpi_errno != MPI_SUCCESS) {
+            MPIU_ERR_POP(mpi_errno);
+        }
+
+        MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_net_ops_list_head), rma_op);
+        MPIDI_CH3I_RMA_Ops_append(list_ptr, rma_op);
+
+        win_ptr->active_req_cnt += rma_op->ref_cnt;
+    }
+
+    if (target->pending_net_ops_list_head == NULL) {
+        win_ptr->num_targets_with_pending_net_ops--;
+        MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
+        if (win_ptr->num_targets_with_pending_net_ops == 0) {
+            MPIDI_CH3I_Win_set_inactive(win_ptr);
+        }
+    }
+
+  fn_exit:
+    MPIDI_RMA_FUNC_EXIT(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
+    return mpi_errno;
+  fn_fail:
+    goto fn_exit;
+}
+
+
 static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
                                           int target_rank, MPIDI_CH3_Pkt_flags_t flags)
 {
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 54c5bc5..8efc6af 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -259,92 +259,6 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
 
 
 #undef FUNCNAME
-#define FUNCNAME check_and_set_req_completion
-#undef FCNAME
-#define FCNAME MPIU_QUOTE(FUNCNAME)
-static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target,
-                                               MPIDI_RMA_Op_t * rma_op, int *op_completed)
-{
-    int i, mpi_errno = MPI_SUCCESS;
-    MPID_Request **req = NULL;
-    MPIDI_STATE_DECL(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
-
-    MPIDI_RMA_FUNC_ENTER(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
-
-    (*op_completed) = FALSE;
-
-    if (rma_op->reqs_size > 0) {
-        for (i = 0; i < rma_op->reqs_size; i++) {
-            if (rma_op->reqs_size == 1)
-                req = &(rma_op->single_req);
-            else
-                req = &(rma_op->multi_reqs[i]);
-
-            if ((*req) == NULL)
-                continue;
-
-            if (MPID_Request_is_complete((*req))) {
-                MPID_Request_release((*req));
-                (*req) = NULL;
-            }
-            else {
-                MPID_Request_release((*req));
-                (*req)->request_completed_cb = MPIDI_CH3_Req_handler_rma_op_complete;
-                (*req)->dev.source_win_handle = win_ptr->handle;
-                (*req)->dev.rma_op_ptr = rma_op;
-
-                rma_op->ref_cnt++;
-
-                if (rma_op->ureq != NULL) {
-                    MPID_cc_set(&(rma_op->ureq->cc), rma_op->ref_cnt);
-                    (*req)->dev.request_handle = rma_op->ureq->handle;
-                }
-            }
-        }
-    }
-
-    if (rma_op->ref_cnt == 0) {
-        if (rma_op->ureq != NULL) {
-            mpi_errno = MPID_Request_complete(rma_op->ureq);
-            if (mpi_errno != MPI_SUCCESS) {
-                MPIU_ERR_POP(mpi_errno);
-            }
-        }
-        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_net_ops_list_head), rma_op);
-
-        (*op_completed) = TRUE;
-    }
-    else {
-        MPIDI_RMA_Op_t **list_ptr = NULL;
-
-        MPIDI_CH3I_RMA_Get_issued_list_ptr(target, rma_op, list_ptr, mpi_errno);
-        if (mpi_errno != MPI_SUCCESS) {
-            MPIU_ERR_POP(mpi_errno);
-        }
-
-        MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_net_ops_list_head), rma_op);
-        MPIDI_CH3I_RMA_Ops_append(list_ptr, rma_op);
-
-        win_ptr->active_req_cnt += rma_op->ref_cnt;
-    }
-
-    if (target->pending_net_ops_list_head == NULL) {
-        win_ptr->num_targets_with_pending_net_ops--;
-        MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
-        if (win_ptr->num_targets_with_pending_net_ops == 0) {
-            MPIDI_CH3I_Win_set_inactive(win_ptr);
-        }
-    }
-
-  fn_exit:
-    MPIDI_RMA_FUNC_EXIT(MPID_STATE_CHECK_AND_SET_REQ_COMPLETION);
-    return mpi_errno;
-  fn_fail:
-    goto fn_exit;
-}
-
-
-#undef FUNCNAME
 #define FUNCNAME issue_ops_target
 #undef FCNAME
 #define FCNAME MPIU_QUOTE(FUNCNAME)

http://git.mpich.org/mpich.git/commitdiff/16da069598460e9482bbce66ed108c0ebed980f9

commit 16da069598460e9482bbce66ed108c0ebed980f9
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Sun Aug 2 21:48:35 2015 -0500

    Split pending op list into pending_net_ops_list and pending_user_ops_list.
    
    Here we split pending op list in the target object into two lists:
    (1) pending_net_ops_list and (2) pending_user_ops_list.
    
    (1) is used to store operations that are held to wait for network events
    (synchronization), and (2) is used to store operations that are held to
    wait for user events (MPI_Win_unlock/flush/flush_local posted). When
    user events happen, we move the operation in (2) to (1).
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index bf2cd7d..1702f45 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -54,7 +54,8 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL_EXTERN(RMA, rma_rmaqueue_alloc);
             (win_)->states.access_state != MPIDI_RMA_LOCK_ALL_ISSUED && \
             (target_)->access_state != MPIDI_RMA_LOCK_CALLED &&         \
             (target_)->access_state != MPIDI_RMA_LOCK_ISSUED &&         \
-            (target_)->pending_op_list_head == NULL &&                  \
+            (target_)->pending_net_ops_list_head == NULL &&             \
+            (target_)->pending_user_ops_list_head == NULL &&            \
             (target_)->issued_read_op_list_head == NULL &&              \
             (target_)->issued_write_op_list_head == NULL &&             \
             (target_)->issued_dt_op_list_head == NULL) {                \
@@ -300,7 +301,8 @@ static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr
     e->issued_read_op_list_head = NULL;
     e->issued_write_op_list_head = NULL;
     e->issued_dt_op_list_head = NULL;
-    e->pending_op_list_head = NULL;
+    e->pending_net_ops_list_head = NULL;
+    e->pending_user_ops_list_head = NULL;
     e->next_op_to_issue = NULL;
 
     e->target_rank = -1;
@@ -333,7 +335,8 @@ static inline int MPIDI_CH3I_Win_target_free(MPID_Win * win_ptr, MPIDI_RMA_Targe
     MPIU_Assert(e->issued_read_op_list_head == NULL);
     MPIU_Assert(e->issued_write_op_list_head == NULL);
     MPIU_Assert(e->issued_dt_op_list_head == NULL);
-    MPIU_Assert(e->pending_op_list_head == NULL);
+    MPIU_Assert(e->pending_net_ops_list_head == NULL);
+    MPIU_Assert(e->pending_user_ops_list_head == NULL);
 
     /* use PREPEND when return objects back to the pool
      * in order to improve cache performance */
@@ -451,18 +454,39 @@ static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t *
         }
     }
 
-    if (target->pending_op_list_head == NULL)
-        win_ptr->num_targets_with_pending_net_ops++;
+    /* Note that if it is a request-based RMA, do not put it in pending user list,
+     * otherwise a wait call before unlock will be blocked. */
+    if (MPIR_CVAR_CH3_RMA_DELAY_ISSUING_FOR_PIGGYBACKING && op->ureq == NULL) {
+        if (target->pending_user_ops_list_head != NULL) {
+            MPIDI_RMA_Op_t *user_op = target->pending_user_ops_list_head;
+            /* Move head element of user pending list to net pending list */
+            if (target->pending_net_ops_list_head == NULL)
+                win_ptr->num_targets_with_pending_net_ops++;
+            MPL_DL_DELETE(target->pending_user_ops_list_head, user_op);
+            MPL_DL_APPEND(target->pending_net_ops_list_head, user_op);
+
+            if (target->next_op_to_issue == NULL)
+                target->next_op_to_issue = user_op;
+        }
 
-    /* Enqueue operation into pending list. */
-    MPL_DL_APPEND(target->pending_op_list_head, op);
-    if (target->next_op_to_issue == NULL)
-        target->next_op_to_issue = op;
+        /* Enqueue operation into user pending list. */
+        MPL_DL_APPEND(target->pending_user_ops_list_head, op);
+    }
+    else {
+        /* Enqueue operation into net pending list. */
+        if (target->pending_net_ops_list_head == NULL)
+            win_ptr->num_targets_with_pending_net_ops++;
+        MPL_DL_APPEND(target->pending_net_ops_list_head, op);
+
+        if (target->next_op_to_issue == NULL)
+            target->next_op_to_issue = op;
+    }
 
-    if (win_ptr->states.access_state == MPIDI_RMA_FENCE_GRANTED ||
-        win_ptr->states.access_state == MPIDI_RMA_PSCW_GRANTED ||
-        win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_GRANTED ||
-        target->access_state == MPIDI_RMA_LOCK_GRANTED)
+    if (target->pending_net_ops_list_head != NULL &&
+        (win_ptr->states.access_state == MPIDI_RMA_FENCE_GRANTED ||
+         win_ptr->states.access_state == MPIDI_RMA_PSCW_GRANTED ||
+         win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_GRANTED ||
+         target->access_state == MPIDI_RMA_LOCK_GRANTED))
         MPIDI_CH3I_Win_set_active(win_ptr);
 
   fn_exit:
diff --git a/src/mpid/ch3/include/mpid_rma_types.h b/src/mpid/ch3/include/mpid_rma_types.h
index 2763af5..3014c0a 100644
--- a/src/mpid/ch3/include/mpid_rma_types.h
+++ b/src/mpid/ch3/include/mpid_rma_types.h
@@ -68,7 +68,8 @@ typedef struct MPIDI_RMA_Target {
     struct MPIDI_RMA_Op *issued_read_op_list_head;
     struct MPIDI_RMA_Op *issued_write_op_list_head;
     struct MPIDI_RMA_Op *issued_dt_op_list_head;
-    struct MPIDI_RMA_Op *pending_op_list_head;
+    struct MPIDI_RMA_Op *pending_net_ops_list_head;     /* pending operations that are waiting for network events */
+    struct MPIDI_RMA_Op *pending_user_ops_list_head;    /* pending operations that are waiting for user events */
     struct MPIDI_RMA_Op *next_op_to_issue;
     struct MPIDI_RMA_Target *next;
     struct MPIDI_RMA_Target *prev;
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 7b3868e..91816f0 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -616,13 +616,13 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
 
     if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
         t->access_state = MPIDI_RMA_LOCK_GRANTED;
-        if (t->pending_op_list_head)
+        if (t->pending_net_ops_list_head)
             MPIDI_CH3I_Win_set_active(win_ptr);
     }
 
     if (win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_GRANTED ||
         t->access_state == MPIDI_RMA_LOCK_GRANTED) {
-        if (t->pending_op_list_head == NULL) {
+        if (t->pending_net_ops_list_head == NULL) {
             int made_progress ATTRIBUTE((unused)) = 0;
             mpi_errno =
                 MPIDI_CH3I_RMA_Make_progress_target(win_ptr, t->target_rank, &made_progress);
@@ -704,9 +704,9 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
             }
         }
 
-        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), op);
+        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_net_ops_list_head), op);
 
-        if (target->pending_op_list_head == NULL) {
+        if (target->pending_net_ops_list_head == NULL) {
             win_ptr->num_targets_with_pending_net_ops--;
             MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
             if (win_ptr->num_targets_with_pending_net_ops == 0) {
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 7eb23cd..54c5bc5 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -105,13 +105,34 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
     if (target == NULL)
         goto fn_exit;
 
+    /* When user event happens, move op in user pending list to network pending list */
+    if (target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH ||
+        target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH_LOCAL ||
+        target->sync.sync_flag == MPIDI_RMA_SYNC_UNLOCK || target->win_complete_flag) {
+
+        MPIDI_RMA_Op_t *user_op = target->pending_user_ops_list_head;
+
+        if (user_op != NULL) {
+            if (target->pending_net_ops_list_head == NULL)
+                win_ptr->num_targets_with_pending_net_ops++;
+
+            MPL_DL_DELETE(target->pending_user_ops_list_head, user_op);
+            MPL_DL_APPEND(target->pending_net_ops_list_head, user_op);
+
+            if (target->next_op_to_issue == NULL)
+                target->next_op_to_issue = user_op;
+        }
+    }
+
     switch (target->access_state) {
     case MPIDI_RMA_LOCK_CALLED:
         if (target->sync.sync_flag == MPIDI_RMA_SYNC_NONE ||
             target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH_LOCAL ||
             target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH) {
-            if (target->pending_op_list_head == NULL ||
-                !target->pending_op_list_head->piggyback_lock_candidate) {
+            if ((target->pending_net_ops_list_head == NULL ||
+                 !target->pending_net_ops_list_head->piggyback_lock_candidate) &&
+                (target->pending_user_ops_list_head == NULL ||
+                 !target->pending_user_ops_list_head->piggyback_lock_candidate)) {
                 /* issue lock request */
                 target->access_state = MPIDI_RMA_LOCK_ISSUED;
                 if (target->target_rank == rank) {
@@ -129,7 +150,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
             }
         }
         else if (target->sync.sync_flag == MPIDI_RMA_SYNC_UNLOCK) {
-            if (target->pending_op_list_head == NULL) {
+            if (target->pending_net_ops_list_head == NULL) {
                 /* No RMA operation has ever been posted to this target,
                  * finish issuing, no need to acquire the lock. Cleanup
                  * function will clean it up. */
@@ -145,8 +166,8 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
                  * in pending list, this operation must be the only operation
                  * and it is prepared to piggyback LOCK and UNLOCK. */
                 MPIU_Assert(MPIR_CVAR_CH3_RMA_DELAY_ISSUING_FOR_PIGGYBACKING);
-                MPIU_Assert(target->pending_op_list_head->next == NULL);
-                MPIU_Assert(target->pending_op_list_head->piggyback_lock_candidate);
+                MPIU_Assert(target->pending_net_ops_list_head->next == NULL);
+                MPIU_Assert(target->pending_net_ops_list_head->piggyback_lock_candidate);
             }
         }
         break;
@@ -154,7 +175,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
     case MPIDI_RMA_LOCK_GRANTED:
     case MPIDI_RMA_NONE:
         if (target->win_complete_flag) {
-            if (target->pending_op_list_head == NULL) {
+            if (target->pending_net_ops_list_head == NULL) {
                 MPIDI_CH3_Pkt_flags_t flags = MPIDI_CH3_PKT_FLAG_NONE;
                 if (target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH && target->put_acc_issued) {
                     flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH;
@@ -172,7 +193,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
             }
         }
         else if (target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH) {
-            if (target->pending_op_list_head == NULL) {
+            if (target->pending_net_ops_list_head == NULL) {
                 if (target->target_rank != rank) {
                     if (target->put_acc_issued) {
 
@@ -191,7 +212,7 @@ static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Ta
             }
         }
         else if (target->sync.sync_flag == MPIDI_RMA_SYNC_UNLOCK) {
-            if (target->pending_op_list_head == NULL) {
+            if (target->pending_net_ops_list_head == NULL) {
                 if (target->target_rank == rank) {
                     mpi_errno = MPIDI_CH3I_Release_lock(win_ptr);
                     if (mpi_errno != MPI_SUCCESS)
@@ -289,7 +310,7 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar
                 MPIU_ERR_POP(mpi_errno);
             }
         }
-        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), rma_op);
+        MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_net_ops_list_head), rma_op);
 
         (*op_completed) = TRUE;
     }
@@ -301,13 +322,13 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar
             MPIU_ERR_POP(mpi_errno);
         }
 
-        MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head), rma_op);
+        MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_net_ops_list_head), rma_op);
         MPIDI_CH3I_RMA_Ops_append(list_ptr, rma_op);
 
         win_ptr->active_req_cnt += rma_op->ref_cnt;
     }
 
-    if (target->pending_op_list_head == NULL) {
+    if (target->pending_net_ops_list_head == NULL) {
         win_ptr->num_targets_with_pending_net_ops--;
         MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
         if (win_ptr->num_targets_with_pending_net_ops == 0) {
@@ -337,7 +358,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
     (*made_progress) = 0;
 
     if (win_ptr->num_targets_with_pending_net_ops == 0 || target == NULL ||
-        target->pending_op_list_head == NULL)
+        target->pending_net_ops_list_head == NULL)
         goto fn_exit;
 
     /* Issue out operations in the list. */
@@ -352,18 +373,6 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
             break;
         }
 
-        if (MPIR_CVAR_CH3_RMA_DELAY_ISSUING_FOR_PIGGYBACKING && curr_op->next == NULL &&
-            target->sync.sync_flag == MPIDI_RMA_SYNC_NONE && curr_op->ureq == NULL) {
-            /* If DELAY_ISSUING_FOR_PIGGYBACKING is turned on,
-             * skip the last OP if sync_flag is NONE since we
-             * want to leave it to the ending synchronization
-             * so that we can piggyback UNLOCK / FLUSH.
-             * However, if it is a request-based RMA, do not
-             * skip it (otherwise a wait call before unlock
-             * will be blocked). */
-            break;
-        }
-
         flags = MPIDI_CH3_PKT_FLAG_NONE;
 
         if (first_op) {
@@ -630,7 +639,8 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
     for (i = 0; i < win_ptr->num_slots; i++) {
         if (win_ptr->slots[i].target_list_head != NULL) {
             curr_target = win_ptr->slots[i].target_list_head;
-            while (curr_target != NULL && curr_target->pending_op_list_head == NULL)
+            while (curr_target != NULL && curr_target->pending_net_ops_list_head == NULL &&
+                   curr_target->pending_user_ops_list_head == NULL)
                 curr_target = curr_target->next;
             if (curr_target != NULL)
                 break;

http://git.mpich.org/mpich.git/commitdiff/277290f386a2c08f8ff08f3c28e376dbecb84579

commit 277290f386a2c08f8ff08f3c28e376dbecb84579
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Mon Aug 3 09:51:50 2015 -0500

    Rename variable num_targets_with_pending_ops to num_targets_with_pending_net_ops
    
    Originally we use num_targets_with_pending_ops to keep track of
    number of targets that have non-empty pending operation list. Now
    we want to only keep track of targets that have non-empty pending
    operation list for network events. We rename the variable here.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/include/mpid_rma_oplist.h b/src/mpid/ch3/include/mpid_rma_oplist.h
index 62637af..bf2cd7d 100644
--- a/src/mpid/ch3/include/mpid_rma_oplist.h
+++ b/src/mpid/ch3/include/mpid_rma_oplist.h
@@ -452,7 +452,7 @@ static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t *
     }
 
     if (target->pending_op_list_head == NULL)
-        win_ptr->num_targets_with_pending_ops++;
+        win_ptr->num_targets_with_pending_net_ops++;
 
     /* Enqueue operation into pending list. */
     MPL_DL_APPEND(target->pending_op_list_head, op);
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index bc61055..6390bbc 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -329,8 +329,9 @@ typedef struct MPIDI_Win_basic_info {
         enum MPIDI_RMA_states access_state;                              \
         enum MPIDI_RMA_states exposure_state;                            \
     } states;                                                            \
-    int num_targets_with_pending_ops; /* keep track of number of targets \
-                                         tht has pending operations. */  \
+    int num_targets_with_pending_net_ops; /* keep track of number of     \
+                                             targets that has non-empty  \
+                                             net pending op list. */     \
     int active_req_cnt; /* keep track of number of active requests in    \
                            current epoch, i.e., number of issued but     \
                            incomplete RMA operations. */                 \
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index d47258c..7b3868e 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -592,7 +592,7 @@ static inline int handle_lock_ack(MPID_Win * win_ptr, int target_rank, MPIDI_CH3
             if (win_ptr->outstanding_locks == 0) {
                 win_ptr->states.access_state = MPIDI_RMA_LOCK_ALL_GRANTED;
 
-                if (win_ptr->num_targets_with_pending_ops) {
+                if (win_ptr->num_targets_with_pending_net_ops) {
                     mpi_errno = MPIDI_CH3I_Win_set_active(win_ptr);
                     if (mpi_errno != MPI_SUCCESS) {
                         MPIU_ERR_POP(mpi_errno);
@@ -707,9 +707,9 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
         MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head), op);
 
         if (target->pending_op_list_head == NULL) {
-            win_ptr->num_targets_with_pending_ops--;
-            MPIU_Assert(win_ptr->num_targets_with_pending_ops >= 0);
-            if (win_ptr->num_targets_with_pending_ops == 0) {
+            win_ptr->num_targets_with_pending_net_ops--;
+            MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
+            if (win_ptr->num_targets_with_pending_net_ops == 0) {
                 MPIDI_CH3I_Win_set_inactive(win_ptr);
             }
         }
diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c
index 82d0df4..7eb23cd 100644
--- a/src/mpid/ch3/src/ch3u_rma_progress.c
+++ b/src/mpid/ch3/src/ch3u_rma_progress.c
@@ -308,9 +308,9 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar
     }
 
     if (target->pending_op_list_head == NULL) {
-        win_ptr->num_targets_with_pending_ops--;
-        MPIU_Assert(win_ptr->num_targets_with_pending_ops >= 0);
-        if (win_ptr->num_targets_with_pending_ops == 0) {
+        win_ptr->num_targets_with_pending_net_ops--;
+        MPIU_Assert(win_ptr->num_targets_with_pending_net_ops >= 0);
+        if (win_ptr->num_targets_with_pending_net_ops == 0) {
             MPIDI_CH3I_Win_set_inactive(win_ptr);
         }
     }
@@ -336,7 +336,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
 
     (*made_progress) = 0;
 
-    if (win_ptr->num_targets_with_pending_ops == 0 || target == NULL ||
+    if (win_ptr->num_targets_with_pending_net_ops == 0 || target == NULL ||
         target->pending_op_list_head == NULL)
         goto fn_exit;
 
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 9b2c726..92fbccd 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -458,7 +458,7 @@ static int fence_barrier_complete(MPID_Request * sreq)
         if (win_ptr->states.access_state == MPIDI_RMA_FENCE_ISSUED) {
             win_ptr->states.access_state = MPIDI_RMA_FENCE_GRANTED;
 
-            if (win_ptr->num_targets_with_pending_ops) {
+            if (win_ptr->num_targets_with_pending_net_ops) {
                 mpi_errno = MPIDI_CH3I_Win_set_active(win_ptr);
                 if (mpi_errno != MPI_SUCCESS) {
                     MPIU_ERR_POP(mpi_errno);
@@ -823,7 +823,7 @@ static int start_req_complete(MPID_Request * req)
     if (win_ptr->sync_request_cnt == 0) {
         win_ptr->states.access_state = MPIDI_RMA_PSCW_GRANTED;
 
-        if (win_ptr->num_targets_with_pending_ops)
+        if (win_ptr->num_targets_with_pending_net_ops)
             MPIDI_CH3I_Win_set_active(win_ptr);
     }
 
diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c
index cba9e8e..025fbba 100644
--- a/src/mpid/ch3/src/mpid_rma.c
+++ b/src/mpid/ch3/src/mpid_rma.c
@@ -288,7 +288,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
     (*win_ptr)->shm_allocated = FALSE;
     (*win_ptr)->states.access_state = MPIDI_RMA_NONE;
     (*win_ptr)->states.exposure_state = MPIDI_RMA_NONE;
-    (*win_ptr)->num_targets_with_pending_ops = 0;
+    (*win_ptr)->num_targets_with_pending_net_ops = 0;
     (*win_ptr)->active_req_cnt = 0;
     (*win_ptr)->start_ranks_in_win_grp = NULL;
     (*win_ptr)->start_grp_size = 0;

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

commit e14a94eed62a1db783020023aed712c558620cdb
Author: Xin Zhao <xinzhao3 at illinois.edu>
Date:   Mon Aug 3 13:31:48 2015 -0500

    Bug-fix when Lock Ack is LOCK_QUEUED_DATA_QUEUED.
    
    When flag in Lock Ack is LOCK_QUEUED_DATA_QUEUED, it means that
    the entire operation is queued on the target side, at this point,
    we should not complete and delete that operation. When origin side
    receives Lock Ack with LOCK_GRANTED, it will delete that operation
    from the list.
    
    Signed-off-by: Pavan Balaji <balaji at anl.gov>

diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index c0f843a..d47258c 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -663,8 +663,7 @@ static inline int handle_lock_ack_with_op(MPID_Win * win_ptr,
     MPIU_Assert(op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
                 op_flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE);
 
-    if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED ||
-        flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED) {
+    if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED) {
 
         if (op->reqs_size > 0) {
             MPID_Request **req = NULL;

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

Summary of changes:
 src/mpid/ch3/include/mpid_rma_oplist.h |   50 ++++++++---
 src/mpid/ch3/include/mpid_rma_types.h  |    3 +-
 src/mpid/ch3/include/mpidpre.h         |    5 +-
 src/mpid/ch3/include/mpidrma.h         |  127 +++++++++++++++++++++--------
 src/mpid/ch3/src/ch3u_rma_progress.c   |  142 ++++++++------------------------
 src/mpid/ch3/src/ch3u_rma_sync.c       |    4 +-
 src/mpid/ch3/src/mpid_rma.c            |    2 +-
 7 files changed, 171 insertions(+), 162 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list