MSA: Set PageArray's synchronization reduction client at contribute time
authorPhil Miller <mille121@illinois.edu>
Fri, 17 Jul 2009 07:28:35 +0000 (02:28 -0500)
committerPhil Miller <mille121@illinois.edu>
Thu, 10 Dec 2009 22:22:59 +0000 (16:22 -0600)
src/libs/ck-libs/multiphaseSharedArrays/msa-DistPageMgr.ci
src/libs/ck-libs/multiphaseSharedArrays/msa-DistPageMgr.h
src/libs/ck-libs/multiphaseSharedArrays/msa-distArray.h

index 9510fa95fc16849beff4d47b10231b84b6a4e159..0adf3b1d1d4d8fb580428db25fcca3727af6a593 100644 (file)
@@ -15,7 +15,7 @@ module msa
         entry void enrollAck(int originator);  // internal method
         entry void enrollDone();  // internal method
         entry void SyncAck();
-        entry void SyncDone();
+        entry void SyncDone(CkReductionMsg *);
 
         // Push data to its home and wait for notice that everyone else has caught up
                entry [threaded] void FinishSync();
index 70fcd9863aafed994a3c24b3efc524a261e4b6ef..5ee3e591937f667d65ff030da8cbac05fc67f7ef 100644 (file)
@@ -1093,8 +1093,9 @@ public:
                        }               
                }
 
-    inline void SyncDone()
+    inline void SyncDone(CkReductionMsg *m)
                {
+                       delete m;
                        //ckout << "[" << CkMyPe() << "] Sync Done indication" << endl;
                        //ckout << "[" << CkMyPe() << "] Sync Done indication" << endl;
                        /* Reset for next sync */
@@ -1387,8 +1388,9 @@ public:
     // MSA_PageArray::
     inline void Sync()
                {
-                       MSADEBPRINT(printf("MSA_PageArray::Sync about to call contribute \n");); 
-                       contribute(0, NULL, CkReduction::concat);
+                       MSADEBPRINT(printf("MSA_PageArray::Sync about to call contribute \n"););
+                       CkCallback cb(CkIndex_MSA_CacheGroup<ENTRY_TYPE, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE>::SyncDone(NULL), cache);
+                       contribute(0, NULL, CkReduction::concat, cb);
                }
 
     inline void emit(int ID, int index)
index bdc5a9116721163b0d2f851367bcdf6b209266e5..ca51f84857363c0e4c57ed77faf5a07121465104 100644 (file)
@@ -992,7 +992,7 @@ public:
         CProxy_PageArray_t pageArray = CProxy_PageArray_t::ckNew(nPages);
         cg = CProxy_CacheGroup_t::ckNew(nPages, pageArray, maxBytes, nEntries, num_wrkrs);
         pageArray.setCacheProxy(cg);
-        pageArray.ckSetReductionClient(new CkCallback(CkIndex_MSA_CacheGroup<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE>::SyncDone(), cg));
+        //pageArray.ckSetReductionClient(new CkCallback(CkIndex_MSA_CacheGroup<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE>::SyncDone(), cg));
         cache = cg.ckLocalBranch();
     }