auto tune the SetLBPeriod based on how long is actually takes to run
authorEric Bohm <ebohm@illinois.edu>
Sat, 26 Feb 2011 00:41:55 +0000 (18:41 -0600)
committerEric Bohm <ebohm@illinois.edu>
Sat, 26 Feb 2011 00:41:55 +0000 (18:41 -0600)
the problem

examples/charm++/load_balancing/stencil3d/stencil3d.C

index 161fa22d96cb4e4adc34a1dbd8b1d6e7ef5a944b..5163b1eaa547eafb6cbccc2c0a73dfc8505d185f 100644 (file)
@@ -314,7 +314,11 @@ class Stencil: public CBase_Stencil {
        if(thisIndex.x == 0 && thisIndex.y == 0 && thisIndex.z == 0)
          startTime = CmiWallTimer();
        if(iterations % LBPERIOD == 0)
-         AtSync();
+         {
+           // auto tune the LBPeriod to half as long as it takes to run the iters between LB steps
+           LBSetPeriod((endTime-startTime)*LBPERIOD/2.0);
+           AtSync();
+         }
        else
          contribute(0, 0, CkReduction::concat, CkCallback(CkIndex_Stencil::doStep(), thisProxy));
       }