MSA: Beginnings of split-phase synchronization
authorPhil Miller <mille121@illinois.edu>
Sun, 12 Jul 2009 18:42:49 +0000 (13:42 -0500)
committerPhil Miller <mille121@illinois.edu>
Thu, 10 Dec 2009 22:22:57 +0000 (16:22 -0600)
src/libs/ck-libs/multiphaseSharedArrays/msa-DistPageMgr.h
src/libs/ck-libs/multiphaseSharedArrays/msa-distArray.h

index e151763a3bccc9eb1a5e1886459b79faf9e7ae59..a84e6410aace7180a428096b8bf79c61ded33b44 100644 (file)
@@ -1004,6 +1004,20 @@ public:
                        FlushCache();
                }
 
+       void SyncRelease()
+               {
+                       syncThreadCount++;
+
+                       MSADEBPRINT(printf("Sync syncThreadCount %d \n",syncThreadCount););
+                       if(syncThreadCount < numberLocalWorkerThreads)
+                       {
+                               return;
+                       }
+
+                       FlushCache();
+                       EmptyCache();
+               }
+
     // MSA_CacheGroup::
     inline void Sync()
                {
@@ -1068,6 +1082,7 @@ public:
     inline CProxy_PageArray_t getArray() { return pageArray; }
 
     // TODO: Can this SyncAck and other simple Acks be made efficient?
+// Yes - Replace calls to this with contributes to a reduction that calls pageArray.Sync()
     inline void SyncAck()
                {
                        CkAssert(CkMyPe() == 0);  // SyncAck is only called on PE 0
index 0a68e3a2140d1e70678d8b01eeed95198ae8abb3..760f3d42fc9dcbfecd84a21577f7c497240f47be 100644 (file)
@@ -803,6 +803,9 @@ public:
                     for (; iz < mz; ++iz)
                         Handle::msa.set(ix, iy, iz) = buf[i++];
         }
+
+    private:
+        Write(Write &);
     };
 
     class Accum : public Handle
@@ -1015,6 +1018,13 @@ public:
 
     static const int DEFAULT_SYNC_SINGLE = 0;
 
+    inline void syncRelease(Handle &m)
+    {
+        m.checkInvalidate(this);
+        delete &m;
+        cache->SyncRelease();
+    }
+
     inline Read &syncToRead(Handle &m, int single = DEFAULT_SYNC_SINGLE)
     {
         m.checkInvalidate(this);