Fixing the way to handle immigrant recovering objects.
authorEsteban Meneses <emenese2@illinois.edu>
Wed, 4 Jul 2012 23:01:59 +0000 (18:01 -0500)
committerEsteban Meneses <emenese2@illinois.edu>
Wed, 4 Jul 2012 23:01:59 +0000 (18:01 -0500)
src/ck-core/ckcausalmlog.C
src/ck-core/ckreduction.C
src/ck-core/ckreduction.h

index 92ef43c2b8ce43126db752a49843fbe9c9d776d3..799e06d9ae749bddf4e7e5543e481811afe99bbd 100644 (file)
@@ -2983,6 +2983,8 @@ void _distributedLocationHandler(char *receivedMsg){
        pmem |gID;
        pmem |idx;
        CkLocMgr *mgr = (CkLocMgr*)CkpvAccess(_groupTable)->find(gID).getObj();
+       // CODING
+//     CkReductionMgr *reductionMgr = (CkReductionMgr*)CkpvAccess(_groupTable)->find(idx).getObj();
        donotCountMigration=1;
        mgr->resume(idx,pmem,CmiTrue);
        donotCountMigration=0;
@@ -2996,6 +2998,7 @@ void _distributedLocationHandler(char *receivedMsg){
        // adding object to the list of immigrant recovery objects
        CpvAccess(_immigrantRecObjs)->push_back((CkLocRec_local *)rec);
        CpvAccess(_numImmigrantRecObjs)++;
+       reductionMgr->incImmigrantRecObjs();
        
        CkVec<CkMigratable *> eltList;
        mgr->migratableList((CkLocRec_local *)rec,eltList);
index c1eb410a1cf4e3fa382b00596e181f24955ee67e..c1e2ae7b0ae4d6262b877e079cd31b3102f337d6 100644 (file)
@@ -203,6 +203,9 @@ CkReductionMgr::CkReductionMgr()//Constructor
     }
     totalCount = 0;
     processorCount = 0;
+#endif
+#if defined(_FAULT_CAUSAL_)
+       numImmigrantRecObjs = 0;
 #endif
   disableNotifyChildrenStart = CmiFalse;
   DEBR((AA"In reductionMgr constructor at %d \n"AB,this));
@@ -219,6 +222,10 @@ CkReductionMgr::CkReductionMgr(CkMigrateMessage *m) :CkGroupInitCallback(m)
   nContrib=nRemote=0;
   maxStartRequest=0;
   DEBR((AA"In reductionMgr migratable constructor at %d \n"AB,this));
+#if defined(_FAULT_CAUSAL_)
+       numImmigrantRecObjs = 0;
+#endif
+
 }
 
 void CkReductionMgr::flushStates(int isgroup)
@@ -660,7 +667,7 @@ void CkReductionMgr::finishReduction(void)
   }
   //CkPrintf("[%d]finishReduction called for redNo %d with nContrib %d at %.6f\n",CkMyPe(),redNo, nContrib,CmiWallTimer());
 #if (defined(_FAULT_CAUSAL_))
-       if (nContrib<(lcount+adj(redNo).lcount)-CpvAccess(_numImmigrantRecObjs)){
+       if (nContrib<(lcount+adj(redNo).lcount)-numImmigrantRecObjs){
         DEBR((AA"Need more local messages %d %d\n"AB,nContrib,(lcount+adj(redNo).lcount)));
                return;//Need more local messages
        }
@@ -686,7 +693,7 @@ void CkReductionMgr::finishReduction(void)
     DEBR((AA"Passing reduced data up to parent node %d.\n"AB,treeParent()));
     DEBR((AA"Message gcount is %d+%d+%d.\n"AB,result->gcount,gcount,adj(redNo).gcount));
 #if (defined(_FAULT_CAUSAL_))
-    result->gcount+=gcount+adj(redNo).gcount-CpvAccess(_numImmigrantRecObjs);
+    result->gcount+=gcount+adj(redNo).gcount-numImmigrantRecObjs;
 #else
     result->gcount+=gcount+adj(redNo).gcount;
 #endif
index 9cede818803d3a12ab4d111a56cc4fa554f33323..53c1d122e8cb02cf2336efa022e5109985289cff 100644 (file)
@@ -544,8 +544,20 @@ public:
        */
        int getGCount(){return gcount;};
         static void sanitycheck();
+#if defined(_FAULT_CAUSAL_)
+       void incNumImmigrantRecObjs(){
+               numImmigrantRecObjs++;
+       }
+       void decNumImmigrantRecObjs(){
+               numImmigrantRecObjs--;
+       }
+#endif
+
 private:
 
+#if defined(_FAULT_CAUSAL_)
+       int numImmigrantRecObjs;
+#endif
 
 //Data members
        //Stored callback function (may be NULL if none has been set)