#251: Reset spring cleaning conditions on every shot to avoid pile-up
authorPhil Miller <mille121@illinois.edu>
Wed, 14 Aug 2013 23:49:02 +0000 (18:49 -0500)
committerPhil Miller <mille121@illinois.edu>
Tue, 20 Aug 2013 23:17:39 +0000 (18:17 -0500)
src/ck-core/ckarray.C
src/ck-core/ckarray.h
src/ck-core/cklocation.C
src/ck-core/cklocation.h

index a1ffcb22084e9c944952108bc9f5dc02dc8e5861..34fbb3c106f56c56cfb7d80adb7f0508e1bbb03e 100644 (file)
@@ -507,12 +507,20 @@ inline void CkArray::springCleaning(void)
 {
   DEBK((AA"Starting spring cleaning\n"AB));
   broadcaster->springCleaning();
+  setupSpringCleaning();
 }
 
 void CkArray::staticSpringCleaning(void *forArray,double curWallTime) {
        ((CkArray *)forArray)->springCleaning();
 }
 
+void CkArray::setupSpringCleaning() {
+ // set up broadcast cleaner
+ if (!stableLocations)
+      springCleaningCcd = CcdCallOnCondition(CcdPERIODIC_1minute,
+                                             staticSpringCleaning, (void *)this);
+}
+
 /********************* Little CkArray Utilities ******************/
 
 CProxy_ArrayBase::CProxy_ArrayBase(const ArrayElement *e)
@@ -756,10 +764,8 @@ CkArray::CkArray(CkArrayOptions &opts,
     stableLocations(opts.staticInsertion && !opts.anytimeMigration),
     numInitial(opts.getNumInitial()), isInserting(true)
 {
-  if (!stableLocations)
-      springCleaningCcd = CcdCallOnConditionKeep(CcdPERIODIC_1minute,
-                                                 staticSpringCleaning, (void *)this);
-  
+  setupSpringCleaning();
+
   //set the field in one my parent class (CkReductionMgr)
   if(opts.disableNotifyChildInRed)
          disableNotifyChildrenStart = true; 
@@ -831,7 +837,7 @@ CkArray::CkArray(CkMigrateMessage *m)
 CkArray::~CkArray()
 {
   if (!stableLocations)
-    CcdCancelCallOnConditionKeep(CcdPERIODIC_1minute, springCleaningCcd);
+    CcdCancelCallOnCondition(CcdPERIODIC_1minute, springCleaningCcd);
 }
 
 #if CMK_ERROR_CHECKING
@@ -860,11 +866,7 @@ void CkArray::pup(PUP::er &p){
                /// Restore our default listeners:
                broadcaster=(CkArrayBroadcaster *)(CkArrayListener *)(listeners[0]);
                reducer=(CkArrayReducer *)(CkArrayListener *)(listeners[1]);
-                /// set up broadcast cleaner
-                if (!stableLocations)
-                    springCleaningCcd =
-                      CcdCallOnConditionKeep(CcdPERIODIC_1minute,
-                                             staticSpringCleaning, (void *)this);
+                setupSpringCleaning();
        }
 }
 
index 0082b8800d076ec03b612892b27fabca796accc8..123ad24e51569264652944abf3ebd21f2ad4ad54 100644 (file)
@@ -755,6 +755,7 @@ private:
 //Spring cleaning
   void springCleaning(void);
   static void staticSpringCleaning(void *forWhom,double curWallTime);
+  void setupSpringCleaning();
   int springCleaningCcd;
 
 //ArrayListeners:
index b3f7d2cdccca577736c7ed5d546898aa09408c70..e92d748bab0ff2784737acf32a71c3458fb4eaea 100644 (file)
@@ -2003,6 +2003,8 @@ inline void CkLocMgr::springCleaning(void)
   }
   CmiImmediateUnlock(hashImmLock);
   delete it;
+
+  setupSpringCleaning();
 }
 void CkLocMgr::staticSpringCleaning(void *forWhom,double curWallTime) {
        DEBK((AA"Starting spring cleaning at %.2f\n"AB,CkWallTimer()));
@@ -2093,9 +2095,7 @@ CkLocMgr::CkLocMgr(CkArrayOptions opts)
        firstFree=localLen=0;
        duringMigration=false;
        nSprings=0;
-#if !CMK_GLOBAL_LOCATION_UPDATE
-       springCleaningCcd = CcdCallOnConditionKeepOnPE(CcdPERIODIC_1minute,staticSpringCleaning,(void *)this, CkMyPe());
-#endif
+        setupSpringCleaning();
 
 //Register with the map object
        mapID = opts.getMap();
@@ -2124,10 +2124,14 @@ CkLocMgr::CkLocMgr(CkMigrateMessage* m)
        firstFree=localLen=0;
        duringMigration=false;
        nSprings=0;
+        setupSpringCleaning();
+       hashImmLock = CmiCreateImmediateLock();
+}
+
+void CkLocMgr::setupSpringCleaning() {
 #if !CMK_GLOBAL_LOCATION_UPDATE
-       springCleaningCcd = CcdCallOnConditionKeepOnPE(CcdPERIODIC_1minute,staticSpringCleaning,(void *)this, CkMyPe());
+       springCleaningCcd = CcdCallOnConditionOnPE(CcdPERIODIC_1minute,staticSpringCleaning,(void *)this, CkMyPe());
 #endif
-       hashImmLock = CmiCreateImmediateLock();
 }
 
 CkLocMgr::~CkLocMgr() {
@@ -2136,7 +2140,7 @@ CkLocMgr::~CkLocMgr() {
   the_lbdb->RemoveLocalBarrierReceiver(lbBarrierReceiver);
   the_lbdb->UnregisterOM(myLBHandle);
 #endif
-  CcdCancelCallOnConditionKeep(CcdPERIODIC_1minute, springCleaningCcd);
+  CcdCancelCallOnCondition(CcdPERIODIC_1minute, springCleaningCcd);
   map->unregisterArray(mapHandle);
   CmiDestroyLock(hashImmLock);
 }
index 151cb11fd3daf2d32b645211a246fd515b32f900..4242c4fe39d1ec8a75c4f85146071b0ae5c8a4d6 100644 (file)
@@ -499,6 +499,7 @@ public:
        //Occasionally clear out stale remote pointers
        static void staticSpringCleaning(void *mgr,double curWallTime);
        void springCleaning(void);
+       void setupSpringCleaning();
        int nSprings;
        int springCleaningCcd;