Merging
[charm.git] / src / ck-ldb / CentralLB.h
index 0d70342590dc44c9abb365803aeae93929ca8970..31e0d5a3f6fc4b2555823aec353600c6f8d85086 100644 (file)
@@ -84,17 +84,23 @@ public:
   void AtSync(void); // Everything is at the PE barrier
   void ProcessAtSync(void); // Receive a message from AtSync to avoid
                             // making projections output look funny
-
+  //void ProcessAtSyncMin(void);
   void SendStats();
+  //void SendMinStats();
   void ReceiveCounts(CkReductionMsg *);
+  //void ReceiveMinStats(CkReductionMsg *);
   void ReceiveStats(CkMarshalledCLBStatsMessage &msg); // Receive stats on PE 0
   void ReceiveStatsViaTree(CkMarshalledCLBStatsMessage &msg); // Receive stats using a tree structure  
   
   void depositData(CLBStatsMsg *m);
   void LoadBalance(void); 
   void ResumeClients(int);                      // Resuming clients needs
-                                               // to be resumed via message
-  void ResumeClients(CkReductionMsg *);
+
+ // void LoadBalanceDecision(int, int);
+ // void LoadBalanceDecisionFinal(int, int);
+ // void ReceiveIterationNo(int, int); // Receives the current iter no
+
+  void ResumeClients(CkReductionMsg *); // to be resumed via message
   void ReceiveMigration(LBMigrateMsg *);       // Receive migration data
   void ProcessReceiveMigration(CkReductionMsg  *);
 #if (defined(_FAULT_MLOG_) || defined(_FAULT_CAUSAL_))
@@ -233,6 +239,24 @@ protected:
                       LBMigrateMsg* msg, LBSimulation* simResults);
   void removeNonMigratable(LDStats* statsDataList, int count);
 
+  virtual void UpdateLBDBWithData(int is_prev_lb_refine, double lb_max,
+      double lb_avg, double local_comm, double remote_comm) {
+    theLbdb->UpdateAfterLBData(is_prev_lb_refine, lb_max, lb_avg, local_comm,
+        remote_comm);
+  }
+
+  virtual void GetPrevLBData(int& is_prev_lb_refine, double& lb_max_avg_ratio,
+      double& local_remote_comm_ratio) {
+    theLbdb->GetPrevLBData(is_prev_lb_refine, lb_max_avg_ratio,
+        local_remote_comm_ratio);
+  }
+
+  virtual void GetLBDataForLB(int prev_lb, double& lb_max_avg_ratio, double&
+      local_remote_comm_ratio) {
+    theLbdb->GetLBDataForLB(prev_lb, lb_max_avg_ratio, local_remote_comm_ratio);
+  }
+
+
 private:  
   CProxy_CentralLB thisProxy;
   int myspeed;
@@ -248,10 +272,14 @@ private:
   LBMigrateMsg   *storedMigrateMsg;
   int  reduction_started;
 
+
   FutureModel *predicted_model;
 
   void BuildStatsMsg();
   void buildStats();
+  bool generatePlan(int& period);
+  bool getLineEq(double& aslope, double& ac, double& mslope, double& mc);
+  bool getPeriodForLinear(double a, double b, double c, int& period);
 
 public:
   int useMem();