Base the feedback on the first iteration data
authorHarshitha <gplkrsh2@illinois.edu>
Sun, 14 Oct 2012 02:08:57 +0000 (21:08 -0500)
committerHarshitha <gplkrsh2@illinois.edu>
Sun, 14 Oct 2012 02:08:57 +0000 (21:08 -0500)
src/ck-ldb/AdaptiveLB.C
src/ck-ldb/HybridLB.C
src/ck-ldb/MetaBalancer.C
src/ck-ldb/MetaBalancer.h

index ef65f3d3414239af972b77a8116bcbdd3755346b..4207876f5207bbe5833e8ced06a394d92809058c 100644 (file)
@@ -99,11 +99,11 @@ void AdaptiveLB::work(LDStats* stats)
   int lb_type;
   double comm_ratio, comm_refine_ratio;
 
-  GetPrevLBData(lb_type, lb_max_avg_ratio, tmp);
-  GetLBDataForLB(1, refine_max_avg_ratio, tmp);
-  GetLBDataForLB(0, greedy_max_avg_ratio, tmp);
-  GetLBDataForLB(2, tmp, comm_ratio);
-  GetLBDataForLB(3, tmp, comm_refine_ratio);
+//  GetPrevLBData(lb_type, lb_max_avg_ratio, tmp);
+//  GetLBDataForLB(1, refine_max_avg_ratio, tmp);
+//  GetLBDataForLB(0, greedy_max_avg_ratio, tmp);
+//  GetLBDataForLB(2, tmp, comm_ratio);
+//  GetLBDataForLB(3, tmp, comm_refine_ratio);
 
   CkPrintf("AdaptiveLB> Previous LB %d\n", lb_type);
 
@@ -149,8 +149,8 @@ void AdaptiveLB::work(LDStats* stats)
       CkPrintf("---REFINE LB\n");
     }
   }
-  UpdateLBDBWithData(lb_type, stats->after_lb_max, stats->after_lb_avg,
-      stats->local_comm, stats->remote_comm);
+//  UpdateLBDBWithData(lb_type, stats->after_lb_max, stats->after_lb_avg,
+//      stats->local_comm, stats->remote_comm);
 
   delete parr;
   delete ogr;
index 342633e383c1afe6a0284656bc7b8a024f3932f4..d827beeffe0282e3696c2342d7c0797998057da6 100644 (file)
@@ -50,6 +50,7 @@ HybridLB::~HybridLB()
 void HybridLB::work(LDStats* stats)
 {
 #if CMK_LBDB_ON
+       theLbdb->ResetAdaptive();
   LevelData *lData = levelData[currentLevel];
 
   // TODO: let's generate LBMigrateMsg ourself
index 96a2dadc3fc55a8f090f296143d409bc3751e681..993b32c30f7f2ff19be38691df4b7f1436f85d9f 100644 (file)
@@ -289,6 +289,10 @@ void MetaBalancer::ReceiveMinStats(CkReductionMsg *msg) {
   data.idle_time = avg_idle;
   adaptive_lbdb.history_data.push_back(data);
 
+  if (iteration_n == 1) {
+    adaptive_struct.info_first_iter.max_avg_ratio = max/avg;
+  }
+
   // If lb period inform is in progress, dont inform again.
   // If this is the lb data corresponding to the final lb period informed, then
   // don't recalculate as some of the processors might have already gone into
@@ -320,6 +324,7 @@ void MetaBalancer::ReceiveMinStats(CkReductionMsg *msg) {
   int tmp_lb_type;
   double tmp_max_avg_ratio, tmp_comm_ratio;
   GetPrevLBData(tmp_lb_type, tmp_max_avg_ratio, tmp_comm_ratio);
+
   double tolerate_imb = IMB_TOLERANCE * tmp_max_avg_ratio;
 
   if (generatePlan(period, ratio_at_t)) {
@@ -795,6 +800,9 @@ void MetaBalancer::GetPrevLBData(int& lb_type, double& lb_max_avg_ratio,
   lb_max_avg_ratio = 1;
   remote_local_comm_ratio = 1;
   GetLBDataForLB(lb_type, lb_max_avg_ratio, remote_local_comm_ratio);
+
+  // Based on the first iteration
+  lb_max_avg_ratio = adaptive_struct.info_first_iter.max_avg_ratio;
 }
 
 void MetaBalancer::GetLBDataForLB(int lb_type, double& lb_max_avg_ratio,
index 1c51fe3c6b2ed46f07593875e4e841253d8983df..055946575e709ff6b20b78b8b7f560162bfb0caa 100644 (file)
@@ -147,6 +147,7 @@ private:
     AdaptiveLBInfo refine_info;
     AdaptiveLBInfo comm_info;
     AdaptiveLBInfo comm_refine_info;
+    AdaptiveLBInfo info_first_iter;
   } adaptive_struct;
 
 public: