kNeighbor: finally behaving as expected of a load balancing benchmark
authorAbhinav S Bhatele <bhatele@illinois.edu>
Tue, 15 Feb 2011 02:47:36 +0000 (20:47 -0600)
committerAbhinav S Bhatele <bhatele@illinois.edu>
Tue, 15 Feb 2011 02:47:36 +0000 (20:47 -0600)
examples/charm++/load_balancing/kNeighbor/kNeighbor.C

index e44f01bd13cb3ff1d3b4b44da0cef935212e4c91..3a4d28cb9c69fa32792fbc3a4b004339ca0c3bbf 100644 (file)
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 
 #define STRIDEK                1
-#define CALCPERSTEP    10
+#define CALCPERSTEP    100
 
 #define DEBUG          0
 
@@ -160,7 +160,7 @@ class Main: public CBase_Main {
       delete msg;
       double wholeStepTime = CmiWallTimer() - gStarttime;
       timeRec[currentStep] = wholeStepTime/CALCPERSTEP;
-      if(currentStep % CALCPERSTEP == 0)
+      if(currentStep % 10 == 0)
        CkPrintf("Step %d with msg size %d finished: max=%f, total=%f\n", currentStep, currentMsgSize, maxTime/CALCPERSTEP, wholeStepTime/CALCPERSTEP);
       beginIteration();
     }
@@ -273,8 +273,7 @@ class Block: public CBase_Block {
 
       numNborsRcvd = 0;
       /* 1: pick a work size and do some computation */
-      int sum = 0;
-      int N = thisIndex*thisIndex % num_chares;
+      int N = (thisIndex * thisIndex / num_chares) * 100;
       for (int i=0; i<N; i++)
        for (int j=0; j<N; j++) {
          sum += (thisIndex * i + j);