more load balancing time to use LBRealType.
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 24 Mar 2011 06:48:16 +0000 (01:48 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 24 Mar 2011 06:48:16 +0000 (01:48 -0500)
src/ck-ldb/CentralLB.h
src/ck-ldb/HbmLB.C
src/ck-ldb/LBDBManager.C
src/ck-ldb/LBDBManager.h
src/ck-ldb/LBDatabase.h
src/ck-ldb/LBMachineUtil.C
src/ck-ldb/LBMachineUtil.h
src/ck-ldb/NborBaseLB.h
src/ck-ldb/lbdb.C
src/ck-ldb/lbdb.h

index 5cbd7041dfccada73f770113aee8506f69385097..30f227f139eddcd0e5ef99f25c8255137aa09907 100644 (file)
@@ -273,12 +273,12 @@ class CLBStatsMsg {
 public:
   int from_pe;
   int pe_speed;
-  double total_walltime;
-  double idletime;
-  double bg_walltime;
+  LBRealType total_walltime;
+  LBRealType idletime;
+  LBRealType bg_walltime;
 #if CMK_LB_CPUTIMER
-  double total_cputime;
-  double bg_cputime;
+  LBRealType total_cputime;
+  LBRealType bg_cputime;
 #endif
   int n_objs;
   LDObjData *objData;
index 6baa3b5da3a58b7a7fa1e8cca7d2c94de7c3845b..4d24bfb7b82049855ba4c9768ff7464295693ba6 100644 (file)
@@ -133,7 +133,7 @@ void HbmLB::ProcessAtSync()
   }
 
   // build LDStats
-  double total_walltime, total_cputime, idletime, bg_walltime, bg_cputime;
+  LBRealType total_walltime, total_cputime, idletime, bg_walltime, bg_cputime;
   theLbdb->TotalTime(&total_walltime,&total_cputime);
   theLbdb->IdleTime(&idletime);
   theLbdb->BackgroundLoad(&bg_walltime,&bg_cputime);
index 0cebbffe67ed10773bd5828ed053920bd1e01306..d5f614d1d2fc6f0edb3ac5f4126aac53645a0b47 100644 (file)
@@ -403,13 +403,13 @@ void LBDB::SetupPredictor(LDPredictModelFn on, LDPredictWindowFn onWin, LDPredic
   predictCBFn->data = data;
 }
 
-void LBDB::BackgroundLoad(double* bg_walltime, double* bg_cputime)
+void LBDB::BackgroundLoad(LBRealType* bg_walltime, LBRealType* bg_cputime)
 {
-  double total_walltime;
-  double total_cputime;
+  LBRealType total_walltime;
+  LBRealType total_cputime;
   TotalTime(&total_walltime, &total_cputime);
 
-  double idletime;
+  LBRealType idletime;
   IdleTime(&idletime);
 
   *bg_walltime = total_walltime - idletime - obj_walltime;
@@ -421,8 +421,8 @@ void LBDB::BackgroundLoad(double* bg_walltime, double* bg_cputime)
 #endif
 }
 
-void LBDB::GetTime(double *total_walltime,double *total_cputime,
-                   double *idletime, double *bg_walltime, double *bg_cputime)
+void LBDB::GetTime(LBRealType *total_walltime,LBRealType *total_cputime,
+                   LBRealType *idletime, LBRealType *bg_walltime, LBRealType *bg_cputime)
 {
   TotalTime(total_walltime,total_cputime);
 
index 689f2295fd23cab863cc8c7a051afdd63455ea04..2b21503c68a0463730f5092d0670e2bef0d03446 100644 (file)
@@ -165,13 +165,13 @@ public:
   void RemoveStartLBFn(LDStartLBFn fn);
   void StartLB();
 
-  inline void IdleTime(double* walltime) 
+  inline void IdleTime(LBRealType* walltime) 
        { machineUtil.IdleTime(walltime); };
-  inline void TotalTime(double* walltime, double* cputime) 
+  inline void TotalTime(LBRealType* walltime, LBRealType* cputime) 
        { machineUtil.TotalTime(walltime,cputime); };
-  void BackgroundLoad(double* walltime, double* cputime);
-  void GetTime(double *total_walltime,double *total_cputime,
-                   double *idletime, double *bg_walltime, double *bg_cputime);
+  void BackgroundLoad(LBRealType* walltime, LBRealType* cputime);
+  void GetTime(LBRealType *total_walltime,LBRealType *total_cputime,
+                   LBRealType *idletime, LBRealType *bg_walltime, LBRealType *bg_cputime);
   void ClearLoads(void);
 
   /**
index 40638158a8beaf42fc1027322be265d3e1f778ad..a414439eb78675728c82fd31df37d8032e3d98f3 100644 (file)
@@ -286,20 +286,20 @@ public:
   inline int GetCommDataSz(void) { return LDGetCommDataSz(myLDHandle); };
   inline void GetCommData(LDCommData *data) { LDGetCommData(myLDHandle,data); };
 
-  inline void BackgroundLoad(double *walltime, double *cputime) {
+  inline void BackgroundLoad(LBRealType *walltime, LBRealType *cputime) {
     LDBackgroundLoad(myLDHandle,walltime,cputime);
   }
 
-  inline void IdleTime(double *walltime) {
+  inline void IdleTime(LBRealType *walltime) {
     LDIdleTime(myLDHandle,walltime);
   };
 
-  inline void TotalTime(double *walltime, double *cputime) {
+  inline void TotalTime(LBRealType *walltime, LBRealType *cputime) {
     LDTotalTime(myLDHandle,walltime,cputime);
   }
 
-  inline void GetTime(double *total_walltime,double *total_cputime,
-                   double *idletime, double *bg_walltime, double *bg_cputime) {
+  inline void GetTime(LBRealType *total_walltime,LBRealType *total_cputime,
+                   LBRealType *idletime, LBRealType *bg_walltime, LBRealType *bg_cputime) {
     LDGetTime(myLDHandle, total_walltime, total_cputime, idletime, bg_walltime, bg_cputime);
   }
 
index bcb7c89b79caf73f4f4c07fc3eea2878272d9b40..9530c1d4450233a0bf922a7a8697fc84cfe8e90d 100644 (file)
@@ -130,7 +130,7 @@ void LBMachineUtil::Clear()
   start_idle = -1.;
 }
 
-void LBMachineUtil::TotalTime(double* walltime, double* cputime)
+void LBMachineUtil::TotalTime(LBRealType* walltime, LBRealType* cputime)
 {
   if (state == on) {
     const double cur_wall = CkWallTimer();
index d2bad7e1f384d7d06ede6c5825ef81aa13b5f1c8..9bc347ee18ef9eb4f8f8a0c25e6f9bdd3201738a 100644 (file)
@@ -19,17 +19,17 @@ public:
   void StatsOn();
   void StatsOff();
   void Clear();
-  void TotalTime(double* walltime, double* cputime);
-  void IdleTime(double* walltime) { *walltime = total_idletime; };
+  void TotalTime(LBRealType* walltime, LBRealType* cputime);
+  void IdleTime(LBRealType* walltime) { *walltime = total_idletime; };
 
 private:
   enum { off, on } state;
-  double total_walltime;
-  double total_idletime;
+  LBRealType total_walltime;
+  LBRealType total_idletime;
   double start_totalwall;
   double start_idle;
 #if CMK_LB_CPUTIMER
-  double total_cputime;
+  LBRealType total_cputime;
   double start_totalcpu;
 #endif
 
index f8f417dd3e8d2212bbbeb9e559af1209c20bfb82..354627eb4621e82c89de5bc019b42924daf6db5b 100644 (file)
@@ -44,14 +44,14 @@ public:
 
   struct LDStats {  // Passed to Strategy
     int from_pe;
-    double total_walltime;
-    double idletime;
-    double bg_walltime;
-    double obj_walltime;
+    LBRealType total_walltime;
+    LBRealType idletime;
+    LBRealType bg_walltime;
+    LBRealType obj_walltime;
 #if CMK_LB_CPUTIMER
-    double total_cputime;
-    double bg_cputime;
-    double obj_cputime;
+    LBRealType total_cputime;
+    LBRealType bg_cputime;
+    LBRealType obj_cputime;
 #endif
     int pe_speed;
     CmiBool available;
index 772609a46017af2bebb06cfc365350d6d838fb6d..9d322ee96295b52c3f8e24967c75867f74317ec4 100644 (file)
@@ -247,7 +247,7 @@ extern "C" void LDMulticastSend(const LDOMHandle &destOM, LDObjid *destids, int
 }
 
 extern "C" void LDBackgroundLoad(LDHandle _db,
-                                double* walltime, double* cputime)
+                                LBRealType* walltime, LBRealType* cputime)
 {
   LBDB *const db = (LBDB*)(_db.handle);
   db->BackgroundLoad(walltime,cputime);
@@ -255,7 +255,7 @@ extern "C" void LDBackgroundLoad(LDHandle _db,
   return;
 }
 
-extern "C" void LDIdleTime(LDHandle _db,double* walltime)
+extern "C" void LDIdleTime(LDHandle _db,LBRealType* walltime)
 {
   LBDB *const db = (LBDB*)(_db.handle);
   db->IdleTime(walltime);
@@ -263,7 +263,7 @@ extern "C" void LDIdleTime(LDHandle _db,double* walltime)
   return;
 }
 
-extern "C" void LDTotalTime(LDHandle _db,double* walltime, double* cputime)
+extern "C" void LDTotalTime(LDHandle _db,LBRealType* walltime, LBRealType* cputime)
 {
   LBDB *const db = (LBDB*)(_db.handle);
   db->TotalTime(walltime,cputime);
@@ -271,9 +271,9 @@ extern "C" void LDTotalTime(LDHandle _db,double* walltime, double* cputime)
   return;
 }
 
-extern "C" void LDGetTime(LDHandle _db, double *total_walltime,
-                   double *total_cputime,
-                   double *idletime, double *bg_walltime, double *bg_cputime)
+extern "C" void LDGetTime(LDHandle _db, LBRealType *total_walltime,
+                   LBRealType *total_cputime,
+                   LBRealType *idletime, LBRealType *bg_walltime, LBRealType *bg_cputime)
 {
   LBDB *const db = (LBDB*)(_db.handle);
   db->GetTime(total_walltime, total_cputime, idletime, bg_walltime, bg_cputime);
index 198c8c8e667dd93c7dab7e0a8d399d2b8c6cc535..5830d9e7723cf61ecb48f7931d3738d631fd53df 100644 (file)
@@ -303,11 +303,11 @@ void LDGetObjData(LDHandle _lbdb, LDObjData *data);
 int LDGetCommDataSz(LDHandle _lbdb);
 void LDGetCommData(LDHandle _lbdb, LDCommData *data);
 
-void LDBackgroundLoad(LDHandle _lbdb, double *walltime, double *cputime);
-void LDIdleTime(LDHandle _lbdb, double *walltime);
-void LDTotalTime(LDHandle _lbdb, double *walltime, double *cputime);
-void LDGetTime(LDHandle _db, double *total_walltime,double *total_cputime,
-                   double *idletime, double *bg_walltime, double *bg_cputime);
+void LDBackgroundLoad(LDHandle _lbdb, LBRealType *walltime, LBRealType *cputime);
+void LDIdleTime(LDHandle _lbdb, LBRealType *walltime);
+void LDTotalTime(LDHandle _lbdb, LBRealType *walltime, LBRealType *cputime);
+void LDGetTime(LDHandle _db, LBRealType *total_walltime,LBRealType *total_cputime,
+                   LBRealType *idletime, LBRealType *bg_walltime, LBRealType *bg_cputime);
 
 void LDClearLoads(LDHandle _lbdb);
 int  LDMigrate(LDObjHandle h, int dest);