[mpich-commits] r10673 - in mpich2/trunk/src/mpid/ch3: include src

dinan at mcs.anl.gov dinan at mcs.anl.gov
Tue Nov 27 17:39:53 CST 2012


Author: dinan
Date: 2012-11-27 17:39:53 -0600 (Tue, 27 Nov 2012)
New Revision: 10673

Modified:
   mpich2/trunk/src/mpid/ch3/include/mpidpre.h
   mpich2/trunk/src/mpid/ch3/include/mpidrma.h
   mpich2/trunk/src/mpid/ch3/src/ch3u_rma_sync.c
Log:
RMA State Tracking: Improved PSCW

This refinement to the existing PSCW state tracking more cleanly captures the
PSCW state and further restricts erroneous usage.

Reviewer: goodell

Modified: mpich2/trunk/src/mpid/ch3/include/mpidpre.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/include/mpidpre.h	2012-11-27 22:39:33 UTC (rev 10672)
+++ mpich2/trunk/src/mpid/ch3/include/mpidpre.h	2012-11-27 23:39:53 UTC (rev 10673)
@@ -204,7 +204,9 @@
 enum MPIDI_Win_epoch_states {
     MPIDI_EPOCH_NONE = 0,
     MPIDI_EPOCH_FENCE,
-    MPIDI_EPOCH_PSCW,    /* Post/Complete, Start/Wait  */
+    MPIDI_EPOCH_POST,
+    MPIDI_EPOCH_START,
+    MPIDI_EPOCH_PSCW,           /* Both post and start have been called. */
     MPIDI_EPOCH_LOCK,
     MPIDI_EPOCH_LOCK_ALL
 };

Modified: mpich2/trunk/src/mpid/ch3/include/mpidrma.h
===================================================================
--- mpich2/trunk/src/mpid/ch3/include/mpidrma.h	2012-11-27 22:39:33 UTC (rev 10672)
+++ mpich2/trunk/src/mpid/ch3/include/mpidrma.h	2012-11-27 23:39:53 UTC (rev 10673)
@@ -291,6 +291,7 @@
                                                                 int target)
 {
     if (win_ptr->epoch_state == MPIDI_EPOCH_FENCE ||
+        win_ptr->epoch_state == MPIDI_EPOCH_START ||
         win_ptr->epoch_state == MPIDI_EPOCH_PSCW)
     {
         return &win_ptr->at_rma_ops_list;

Modified: mpich2/trunk/src/mpid/ch3/src/ch3u_rma_sync.c
===================================================================
--- mpich2/trunk/src/mpid/ch3/src/ch3u_rma_sync.c	2012-11-27 22:39:33 UTC (rev 10672)
+++ mpich2/trunk/src/mpid/ch3/src/ch3u_rma_sync.c	2012-11-27 23:39:53 UTC (rev 10673)
@@ -1269,16 +1269,15 @@
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_POST);
 
-    /* FIXME: Can we further restrict the ordering or quantity of generalized
-       active target calls?  E.g. post must precede start, start/complete may
-       be called once, etc? */
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_NONE &&
-                        win_ptr->epoch_state != MPIDI_EPOCH_PSCW,
+                        win_ptr->epoch_state != MPIDI_EPOCH_START,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Track access epoch state */
-    win_ptr->epoch_state = MPIDI_EPOCH_PSCW;
-    win_ptr->epoch_count++;
+    if (win_ptr->epoch_state == MPIDI_EPOCH_START)
+        win_ptr->epoch_state = MPIDI_EPOCH_PSCW;
+    else
+        win_ptr->epoch_state = MPIDI_EPOCH_POST;
 
     /* Even though we would want to reset the fence counter to keep
      * the user from using the previous fence to mark the beginning of
@@ -1423,12 +1422,14 @@
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_START);
 
     MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_NONE &&
-                        win_ptr->epoch_state != MPIDI_EPOCH_PSCW,
+                        win_ptr->epoch_state != MPIDI_EPOCH_POST,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Track access epoch state */
-    win_ptr->epoch_state = MPIDI_EPOCH_PSCW;
-    win_ptr->epoch_count++;
+    if (win_ptr->epoch_state == MPIDI_EPOCH_POST)
+        win_ptr->epoch_state = MPIDI_EPOCH_PSCW;
+    else
+        win_ptr->epoch_state = MPIDI_EPOCH_START;
 
     /* Even though we would want to reset the fence counter to keep
      * the user from using the previous fence to mark the beginning of
@@ -1498,12 +1499,14 @@
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_COMPLETE);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW,
+    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW &&
+                        win_ptr->epoch_state != MPIDI_EPOCH_START,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Track access epoch state */
-    win_ptr->epoch_count--;
-    if (win_ptr->epoch_count == 0)
+    if (win_ptr->epoch_state == MPIDI_EPOCH_PSCW)
+        win_ptr->epoch_state = MPIDI_EPOCH_POST;
+    else
         win_ptr->epoch_state = MPIDI_EPOCH_NONE;
 
     comm_ptr = win_ptr->comm_ptr;
@@ -1752,12 +1755,14 @@
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_WAIT);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW,
+    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW &&
+                        win_ptr->epoch_state != MPIDI_EPOCH_POST,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     /* Track access epoch state */
-    win_ptr->epoch_count--;
-    if (win_ptr->epoch_count == 0)
+    if (win_ptr->epoch_state == MPIDI_EPOCH_PSCW)
+        win_ptr->epoch_state = MPIDI_EPOCH_START;
+    else
         win_ptr->epoch_state = MPIDI_EPOCH_NONE;
 
     /* wait for all operations from other processes to finish */
@@ -1805,7 +1810,8 @@
 
     MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_TEST);
 
-    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW,
+    MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state != MPIDI_EPOCH_PSCW &&
+                        win_ptr->epoch_state != MPIDI_EPOCH_POST,
                         mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
 
     mpi_errno = MPID_Progress_test();
@@ -1817,8 +1823,9 @@
 
     /* Track access epoch state */
     if (*flag) {
-        win_ptr->epoch_count--;
-        if (win_ptr->epoch_count == 0)
+        if (win_ptr->epoch_state == MPIDI_EPOCH_PSCW)
+            win_ptr->epoch_state = MPIDI_EPOCH_START;
+        else
             win_ptr->epoch_state = MPIDI_EPOCH_NONE;
     }
 



More information about the commits mailing list