adaptively adjust LB period time lim/old_cache
authorGengbin Zheng <gzheng@illinois.edu>
Tue, 19 Jul 2011 20:58:15 +0000 (15:58 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Tue, 19 Jul 2011 20:58:15 +0000 (15:58 -0500)
src/ck-ldb/LBDBManager.C
src/ck-ldb/LBDBManager.h

index d5f614d1d2fc6f0edb3ac5f4126aac53645a0b47..92dd4ea72c8806770b12c123a908778a3584eaa7 100644 (file)
@@ -35,6 +35,10 @@ void LBDB::batsyncer::resumeFromSync(void *bs)
 {
   LBDB::batsyncer *s=(LBDB::batsyncer *)bs;
 //  CmiPrintf("[%d] LBDB::batsyncer::resumeFromSync with %gs\n", CkMyPe(), s->period);
+  double curT = CmiWallTimer();
+  if (s->nextT<curT)  s->period *= 2;
+  s->nextT = curT + s->period;
+
   CcdCallFnAfterOnPE((CcdVoidFn)gotoSync, (void *)s, 1000*s->period, CkMyPe());
 }
 
@@ -43,6 +47,7 @@ void LBDB::batsyncer::init(LBDB *_db,double initPeriod)
 {
   db=_db;
   period=initPeriod;
+  nextT = CmiWallTimer() + period;
   BH = db->AddLocalBarrierClient((LDResumeFn)resumeFromSync,(void*)(this));
   //This just does a CcdCallFnAfter
   resumeFromSync((void *)this);
index 2b21503c68a0463730f5092d0670e2bef0d03446..5658cb73d762b5e6bf9b6c126d7e0f314ec8e82d 100644 (file)
@@ -219,6 +219,7 @@ public:
   private:
     LBDB *db; //Enclosing LBDB object
     double period;//Time (seconds) between builtin-atsyncs  
+    double nextT;
     LDBarrierClient BH;//Handle for the builtin-atsync barrier 
     static void gotoSync(void *bs);
     static void resumeFromSync(void *bs);