Fixed problem with load balancer instrumentation in presence of local entry methods...
authorEdgar Solomonik <solomon2@illinois.edu>
Tue, 7 Jul 2009 21:56:15 +0000 (21:56 +0000)
committerEdgar Solomonik <solomon2@illinois.edu>
Tue, 7 Jul 2009 21:56:15 +0000 (21:56 +0000)
src/ck-core/cklocation.C
src/ck-core/cklocation.h

index 9c844046ac41c5f1e114c1da1a0442bb185b8291..95d32443fbf2a5420af3687873e35c2e04c3488f 100644 (file)
@@ -1137,15 +1137,15 @@ void CkLocRec_local::migrateMe(int toPe) //Leaving this processor
 }
 
 #if CMK_LBDB_ON
-void CkLocRec_local::startTiming(void) {
-       running=CmiTrue;
+void CkLocRec_local::startTiming(int ignore_running) {
+       if (!ignore_running) running=CmiTrue;
        DEBL((AA"Start timing for %s at %.3fs {\n"AB,idx2str(idx),CkWallTimer()));
        if (enable_measure) the_lbdb->ObjectStart(ldHandle);
 }
-void CkLocRec_local::stopTiming(void) {
+void CkLocRec_local::stopTiming(int ignore_running) {
        DEBL((AA"} Stop timing for %s at %.3fs\n"AB,idx2str(idx),CkWallTimer()));
-       if (running && enable_measure) the_lbdb->ObjectStop(ldHandle);
-       running=CmiFalse;
+       if ((ignore_running || running) && enable_measure) the_lbdb->ObjectStop(ldHandle);
+       if (!ignore_running) running=CmiFalse;
 }
 void CkLocRec_local::setObjTime(double cputime) {
        the_lbdb->EstObjLoad(ldHandle, cputime);
@@ -1208,9 +1208,9 @@ LDObjHandle CkMigratable::timingBeforeCall(int* objstopped){
 #if CMK_LBDB_ON
        if (getLBDB()->RunningObject(&objHandle)) {
                *objstopped = 1;
-               // getLBDB()->ObjectStop(objHandle);
-               myRec->startTiming();
-  }
+               getLBDB()->ObjectStop(objHandle);
+       }
+       myRec->startTiming(1);
 #endif
 
   //DEBS((AA"   Invoking entry %d on element %s\n"AB,epIdx,idx2str(idx)));
@@ -1243,10 +1243,10 @@ void CkMigratable::timingAfterCall(LDObjHandle objHandle,int *objstopped){
 //     if (isDeleted) return CmiFalse;//We were deleted
 //     deletedMarker=NULL;
 //     return CmiTrue;
+       myRec->stopTiming(1);
 #if CMK_LBDB_ON
        if (*objstopped) {
-               // getLBDB()->ObjectStart(objHandle);
-               ckStopTiming();
+                getLBDB()->ObjectStart(objHandle);
        }
 #endif
 
index a8c523a8c491b636da5f48ca69d64434f15781f9..57207b6a24fb29a214c18d9563adb787d2fd9552 100644 (file)
@@ -196,13 +196,13 @@ public:
 
 #if CMK_LBDB_ON  //For load balancing:
   /// Control the load balancer:
-  void startTiming(void);
-  void stopTiming(void);
+  void startTiming(int ignore_running=0);
+  void stopTiming(int ignore_running=0);
   void setObjTime(double cputime);
   double getObjTime();
 #else
-  inline void startTiming(void) {  }
-  inline void stopTiming(void) { }
+  inline void startTiming(int ignore_running=0) {  }
+  inline void stopTiming(int ignore_running=0) { }
 #endif
   inline int getLocalIndex(void) const {return localIdx;}
   inline const CkArrayIndex &getIndex(void) const {return idx;}