fixing bug in the case of pause
authorHarshitha <gplkrsh2@illinois.edu>
Fri, 9 Mar 2012 10:01:49 +0000 (04:01 -0600)
committerHarshitha <gplkrsh2@illinois.edu>
Fri, 9 Mar 2012 10:01:49 +0000 (04:01 -0600)
src/ck-ldb/CentralLB.C

index 3a5eb6b3e0efb4dce7c3512f10154a12b021485d..86bf2d0dae0851ad2f5afe5102ed60b9ec09a53b 100644 (file)
@@ -366,6 +366,7 @@ void CentralLB::SendMinStats() {
   lb_data[1] = total_load;
   lb_data[2] = 1;
   lb_data[3] = adaptive_struct.lb_no_iterations;
+  CkPrintf("[%d] sends total load %lf at iter %d\n", CkMyPe(), total_load, adaptive_struct.lb_no_iterations);
 
   if (adaptive_struct.lb_no_iterations != 0) {
     CkCallback cb(CkIndex_CentralLB::ReceiveMinStats((CkReductionMsg*)NULL), 
@@ -582,8 +583,10 @@ void CentralLB::LoadBalanceDecision(int req_no, int period) {
   if (local_state == PAUSE) {
     if (adaptive_struct.lb_no_iterations < adaptive_struct.lb_ideal_period) {
       local_state = DECIDED;
+      SendMinStats();
       ResumeClients(0);
     } else {
+      local_state = LOAD_BALANCE;
       ProcessAtSync();
     }
     return;