ldb examples: removed four load balancing examples
authorAbhinav S Bhatele <bhatele@illinois.edu>
Wed, 29 Dec 2010 08:05:52 +0000 (02:05 -0600)
committerAbhinav S Bhatele <bhatele@illinois.edu>
Wed, 29 Dec 2010 08:05:52 +0000 (02:05 -0600)
They essentially do the same thing and so one example will replace them all

34 files changed:
examples/charm++/imbalanced/LB_Bench.C [deleted file]
examples/charm++/imbalanced/LB_Bench.ci [deleted file]
examples/charm++/imbalanced/Makefile [deleted file]
examples/charm++/imbalanced/README [deleted file]
examples/charm++/simple_imbalance/LB_Test.C [deleted file]
examples/charm++/simple_imbalance/LB_Test.ci [deleted file]
examples/charm++/simple_imbalance/Makefile [deleted file]
tests/charm++/Makefile
tests/charm++/load_balancing/Makefile [moved from tests/charm++/loadbalancing/Makefile with 94% similarity]
tests/charm++/load_balancing/lb_test/Makefile [moved from tests/charm++/loadbalancing/lb_test/Makefile with 100% similarity]
tests/charm++/load_balancing/lb_test/README [moved from tests/charm++/loadbalancing/lb_test/README with 100% similarity]
tests/charm++/load_balancing/lb_test/Topo.C [moved from tests/charm++/loadbalancing/lb_test/Topo.C with 100% similarity]
tests/charm++/load_balancing/lb_test/Topo.ci [moved from tests/charm++/loadbalancing/lb_test/Topo.ci with 100% similarity]
tests/charm++/load_balancing/lb_test/Topo.h [moved from tests/charm++/loadbalancing/lb_test/Topo.h with 100% similarity]
tests/charm++/load_balancing/lb_test/lb_test.C [moved from tests/charm++/loadbalancing/lb_test/lb_test.C with 100% similarity]
tests/charm++/load_balancing/lb_test/lb_test.ci [moved from tests/charm++/loadbalancing/lb_test/lb_test.ci with 100% similarity]
tests/charm++/load_balancing/lb_test/predictor/Makefile [moved from tests/charm++/loadbalancing/lb_test/predictor/Makefile with 100% similarity]
tests/charm++/load_balancing/lb_test/predictor/test.C [moved from tests/charm++/loadbalancing/lb_test/predictor/test.C with 100% similarity]
tests/charm++/load_balancing/lb_test/predictor/test.ci [moved from tests/charm++/loadbalancing/lb_test/predictor/test.ci with 100% similarity]
tests/charm++/load_balancing/lb_test/predictor/test.h [moved from tests/charm++/loadbalancing/lb_test/predictor/test.h with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/Makefile [moved from tests/charm++/loadbalancing/lb_test/sim/Makefile with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/Topo.C [moved from tests/charm++/loadbalancing/lb_test/sim/Topo.C with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/Topo.ci [moved from tests/charm++/loadbalancing/lb_test/sim/Topo.ci with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/Topo.h [moved from tests/charm++/loadbalancing/lb_test/sim/Topo.h with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/sim.C [moved from tests/charm++/loadbalancing/lb_test/sim/sim.C with 100% similarity]
tests/charm++/load_balancing/lb_test/sim/sim.ci [moved from tests/charm++/loadbalancing/lb_test/sim/sim.ci with 100% similarity]
tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.C [deleted file]
tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.ci [deleted file]
tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.h [deleted file]
tests/charm++/loadbalancing/jacobi2D-periodic-lb/Makefile [deleted file]
tests/charm++/loadbalancing/jacobi2D/Jacobi2D.C [deleted file]
tests/charm++/loadbalancing/jacobi2D/Jacobi2D.ci [deleted file]
tests/charm++/loadbalancing/jacobi2D/Jacobi2D.h [deleted file]
tests/charm++/loadbalancing/jacobi2D/Makefile [deleted file]

diff --git a/examples/charm++/imbalanced/LB_Bench.C b/examples/charm++/imbalanced/LB_Bench.C
deleted file mode 100644 (file)
index aa0c4c0..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-#include "LB_Bench.decl.h"
-#include "charm++.h"
-
-// See README for documentation
-
-/*readonly*/ CProxy_Main mainProxy;
-/*readonly*/ int num_chare_rows;
-/*readonly*/ int num_chare_cols;
-
-// We want to wrap entries around, and because mod operator % sometimes misbehaves on negative values, 
-// I just wrote these simple wrappers that will make the mod work as expected. -1 maps to the highest value.
-#define wrap_x(a)  (((a)+num_chare_cols)%num_chare_cols)
-#define wrap_y(a)  (((a)+num_chare_rows)%num_chare_rows)
-
-CkArrayID a;
-
-#define total_iterations 200
-
-class Main : public CBase_Main
-{
-public:
-  int done_count;
-  CProxy_LB_Bench array;
-  int num_chares;
-
-  Main(CkArgMsg* m) {
-       if (m->argc < 2) {
-         CkPrintf("%s [number chares per dimension]\n", m->argv[0]);
-         CkAbort("Abort");
-       }
-
-       // store the main proxy
-       mainProxy = thisProxy;
-
-       num_chare_rows = atoi(m->argv[1]);
-       num_chare_cols = atoi(m->argv[1]);
-
-       // print info
-       CkPrintf("Running on %d processors with a %d x %d chare array\n", CkNumPes(), num_chare_rows, num_chare_cols);
-
-       // Create new array of worker chares
-       array = CProxy_LB_Bench::ckNew(num_chare_cols, num_chare_rows);
-
-       // save the total number of worker chares we have in this simulation
-       num_chares = num_chare_rows*num_chare_cols;
-
-       //Start the computation
-       done_count = 0;
-       array.startup();
-  }
-
-  // Each worker reports back to here when it completes an iteration
-  void report_done() {
-       done_count++;
-       if (num_chares == done_count) {
-         CkPrintf("Done\n");
-         CkExit();
-       }
-  }
-
-};
-
-class LB_Bench: public CBase_LB_Bench {
-public:
-  int iterations;
-  int received_right, received_left, received_up, received_down;
-
-  // Constructor
-  LB_Bench() : iterations(0), received_right(0), received_down(0), received_up(0), received_left(0) {
-       /*      iterations=0;
-         received_right=0;
-         received_left=0;
-         received_up=0;
-         received_down=0;
-       */
-  }
-
-  // For migration
-  LB_Bench(CkMigrateMessage* m) {}
-
-  // Destructor
-  ~LB_Bench() { }
-
-  // Perform one iteration of work
-  // The first step is to send the local state to the neighbors
-  void startup(void) {
-       next_iter();
-  }
-
-  void next_iter(){
-       thisProxy(wrap_x(thisIndex.x-1), thisIndex.y).fromRight();
-       thisProxy(wrap_x(thisIndex.x+1), thisIndex.y).fromLeft();
-       thisProxy(thisIndex.x, wrap_y(thisIndex.y-1)).fromDown();
-       thisProxy(thisIndex.x, wrap_y(thisIndex.y+1)).fromUp();
-
-       if(iterations % 10 ==5 &&  usesAtSync==CmiTrue )
-         AtSync();
-
-
-  }
-
-  void fromRight() {
-       received_right ++;
-       //      CkPrintf("%d,%d R=%d L=%d D=%d U=%d\n", thisIndex.x, thisIndex.y, received_right, received_left, received_down, received_up);
-       //      CkAssert(received_right <= 2);
-       check_and_compute();
-  }
-
-  void fromLeft() {
-       received_left ++;
-       //      CkPrintf("%d,%d R=%d L=%d D=%d U=%d\n", thisIndex.x, thisIndex.y, received_right, received_left, received_down, received_up);
-       //      CkAssert(received_left <= 2);
-       check_and_compute();
-  }
-
-  void fromDown() {
-       received_down ++;
-       //      CkPrintf("%d,%d R=%d L=%d D=%d U=%d\n", thisIndex.x, thisIndex.y, received_right, received_left, received_down, received_up);
-       //CkAssert(received_down <= 2);
-       check_and_compute();
-  }
-
-  void fromUp() {
-       received_up ++;
-       //      CkPrintf("%d,%d R=%d L=%d D=%d U=%d\n", thisIndex.x, thisIndex.y, received_right, received_left, received_down, received_up);
-       //      CkAssert(received_up <= 2);
-       check_and_compute();
-  }
-
-  void check_and_compute() {
-       if(received_right>0 && received_left>0 && received_up>0 && received_down>0) {
-         //CkPrintf("%d,%d ====================== \n", thisIndex.x, thisIndex.y);
-
-         received_right --;
-         received_left --;
-         received_down --;
-         received_up --;
-         
-         //      CkPrintf("%d,%d R=%d L=%d D=%d U=%d\n", thisIndex.x, thisIndex.y, received_right, received_left, received_down, received_up);
-
-         if(iterations < total_iterations){
-               iterations++;
-               thisProxy(thisIndex.x,thisIndex.y).compute();
-         } else {
-               mainProxy.report_done();
-         }
-
-       }
-  }
-
-
-  void compute() {
-       double work_factor = 1.0;
-
-       //      CkPrintf("my x index is %d of %d, iteration=%d\n", thisIndex.x, num_chare_cols, iterations);
-       if(thisIndex.x >= num_chare_cols*0.40 && thisIndex.x <= num_chare_cols*0.60){
-         const double start_activate=0.4*(double)total_iterations;
-         const double end_activate=0.7*(double)total_iterations;
-         double fraction_activated;
-
-         if(iterations < start_activate)
-               fraction_activated = 0.0;
-         else if(iterations > end_activate)
-               fraction_activated = 1.0;
-         else
-               fraction_activated = ((double)iterations-start_activate) / (end_activate-start_activate); 
-
-         if( ((double)thisIndex.y / ((double)num_chare_rows-1.0)) <= fraction_activated)
-               work_factor += num_chare_rows*2.0;
-         //      CkPrintf("x index %d has work_factor %f at iteration %d\n", thisIndex.x, work_factor, iterations);
-       }
-
-       double a[2000], b[2000], c[2000];
-       for(int j=0;j<100*work_factor;j++){
-         for(int i=0;i<2000;i++){
-               a[i] = 7.0;
-               b[i] = 5.0;
-         }
-         for(int i=0;i<2000/2;i++){
-               c[i] = a[2*i]*b[2*i+1]*a[i];
-               c[2*i] = a[2*i];
-         }
-       }
-
-       next_iter();
-  }
-
-
-  void ResumeFromSync(void) { //Called by Load-balancing framework
-       // CkPrintf("Element %d,%d resumeFromSync on PE %d\n",thisIndex.x, thisIndex.y, CkMyPe());
-  }
-
-
-  virtual void pup(PUP::er &p)
-  {
-    CBase_LB_Bench::pup(p);
-    p | iterations;
-    p | received_right;
-    p | received_left;
-    p | received_up;
-    p | received_down;
-  }
-
-
-
-
-};
-
-#include "LB_Bench.def.h"
diff --git a/examples/charm++/imbalanced/LB_Bench.ci b/examples/charm++/imbalanced/LB_Bench.ci
deleted file mode 100644 (file)
index bc946d8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-mainmodule LB_Bench {
-  readonly CProxy_Main mainProxy;
-  readonly int num_chare_rows;
-  readonly int num_chare_cols;
-
-  mainchare Main {
-    entry Main(CkArgMsg *m);
-    entry void report_done();
-  };
-
-  array [2D] LB_Bench {
-    // Normal Charm++ entry methods
-    entry LB_Bench(void);
-    entry void compute();
-    entry void fromLeft();
-    entry void fromRight();
-    entry void fromUp();
-    entry void fromDown();
-    entry void startup();
-    entry void next_iter();
-  };
-};
diff --git a/examples/charm++/imbalanced/Makefile b/examples/charm++/imbalanced/Makefile
deleted file mode 100644 (file)
index 0466ea8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-CHARMC=../../../bin/charmc $(OPTS)
-
-OBJS = LB_Bench.o
-PROJ= -tracemode projections -tracemode summary
-
-all: LB_Bench LB_Bench_Proj LB_Bench_Proj_LB
-
-LB_Bench: $(OBJS)
-       $(CHARMC) -language charm++ -o LB_Bench $(OBJS)
-
-LB_Bench_Proj: $(OBJS)
-       $(CHARMC) -language charm++ -o LB_Bench_Proj $(PROJ) $(OBJS)
-
-LB_Bench_Proj_LB: $(OBJS)
-       $(CHARMC) -language charm++ -o LB_Bench_Proj_LB -module CommonLBs $(PROJ) $(OBJS)
-
-LB_Bench.decl.h: LB_Bench.ci
-       $(CHARMC)  LB_Bench.ci
-
-test: LB_Bench_Proj_LB
-       rm logs/* 
-       srun  --sockets-per-node=2 LB_Bench_Proj_LB 16 +traceroot logs/ +LBPeriod 2
-
-clean:
-       rm -f *.decl.h *.def.h conv-host *.o LB_Bench charmrun *~ *.core LB_Bench_Proj *.projrc *.sts logs/*
-
-LB_Bench.o: LB_Bench.C LB_Bench.decl.h
-       $(CHARMC) -c LB_Bench.C
diff --git a/examples/charm++/imbalanced/README b/examples/charm++/imbalanced/README
deleted file mode 100644 (file)
index c2cc7bd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-Author: Isaac Dooley
-
-A simple benchmarking example for use with load balancing schemes. The program uses a 2-d array of chares, each communicating with its 4 neighbors. The program mimics the load pattern of the code named Fractography3-d.
-
-
-Beginning: 
-
-CCCCCCCCCCCC        Legend: C fixed constant amount of work
-CCCCCCCCCCCC                L large amount of work
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-
-Middle:
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-LLLLLLCCCCCC
-LLLLLLCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-
-
-End
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-LLLLLLLLLLLL
-LLLLLLLLLLLL
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-CCCCCCCCCCCC
-
diff --git a/examples/charm++/simple_imbalance/LB_Test.C b/examples/charm++/simple_imbalance/LB_Test.C
deleted file mode 100644 (file)
index b92c28f..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-#include "LB_Test.decl.h"
-
-/*readonly*/ CProxy_Main mainProxy;
-/*readonly*/ int num_chare_blocks;
-/*readonly*/ int workWeight;
-/*readonly*/ int total_iterations;
-
-class Main : public CBase_Main
-{
-public:
-  int report_count;
-  int iter_count;
-  int done_count;
-  CProxy_LB_Test arrayProxy;
-  double timestamp;
-  double workStartTimestamp;
-  double totalChareWorkTime;
-
-  Main(CkArgMsg* m) {
-    CkAssert(CkMyPe() == 0);
-    if ((m->argc < 3) || (m->argc > 4)) {
-      CkPrintf("Usage: %s <num chare blocks/pe> <total iter> [work weight]\n", 
-              m->argv[0]);
-      CkAbort("Abort");
-    }
-    num_chare_blocks = atoi(m->argv[1]);
-    total_iterations = atoi(m->argv[2]);
-    workWeight = 1;
-    if (m->argc == 4) {
-      workWeight = atoi(m->argv[3]);
-    }
-
-    timestamp = CkWallTimer();
-    totalChareWorkTime = 0.0;
-    report_count = 0;
-    iter_count = 0;
-    done_count = 0;
-
-    // store the main proxy
-    mainProxy = thisProxy;
-
-    // print info
-    CkPrintf("Running on %d processors with %d chares per pe\n", 
-            CkNumPes(), num_chare_blocks*4);
-
-    // Create new array of worker chares. The element constructors will
-    // contact this object to start the computation.
-    arrayProxy = CProxy_LB_Test::ckNew(num_chare_blocks*4*CkNumPes());
-
-  }
-
-  void report_in() {
-    report_count++;
-    if (num_chare_blocks*4*CkNumPes() == report_count) {
-      workStartTimestamp = CkWallTimer();
-      CkPrintf("All array elements ready at %f seconds. Computation Begins\n",
-              workStartTimestamp - timestamp);
-      report_count = 0;
-      for (int i=0; i<num_chare_blocks*4*CkNumPes(); i++) {
-       arrayProxy[i].next_iter();
-      }
-    }
-  }
-
-  // Reduction callback client
-  void iterBarrier(double chareWorkTime) {
-    iter_count++;
-    totalChareWorkTime += chareWorkTime;
-    if (num_chare_blocks*4*CkNumPes() == iter_count) {
-      iter_count = 0;
-      for (int i=0; i<num_chare_blocks*4*CkNumPes(); i++) {
-       arrayProxy[i].next_iter();
-      }
-    }
-  }
-
-  // Each worker reports back to here when it completes all work
-  void report_done() {
-    done_count++;
-    if (num_chare_blocks*4*CkNumPes() == done_count) {
-      CkPrintf("Total work performed = %f seconds\n", totalChareWorkTime);
-      CkPrintf("Average total chare work per iteration = %f seconds\n",
-              totalChareWorkTime/total_iterations);
-      CkPrintf("Average iteration time = %f seconds\n",
-              (CkWallTimer() - workStartTimestamp)/total_iterations);
-      CkPrintf("Done after %f seconds\n", CkWallTimer() - timestamp);
-      CkExit();
-    }
-  }
-};
-
-class LB_Test: public CBase_LB_Test {
-public:
-  int iteration;
-  int work_factor;
-
-  // Initialization and start of iterations. 
-  // Chares starting on even-numbered processors get a single work
-  // unit. 
-  // Chares starting on odd-numbered processors get two work units.
-  // NOTE: These work factors do not change after migration! That's
-  //       the point of this example!
-  LB_Test() {
-    if (CkMyPe() % 2 == 0) {
-      work_factor = 1;
-    } else {
-      work_factor = 2;
-    }
-    iteration = 0;
-    usesAtSync = CmiTrue;
-    mainProxy.report_in();
-  }
-
-  // For migration
-  LB_Test(CkMigrateMessage* m) {
-  }
-
-  // Destructor
-  ~LB_Test() {
-  }
-
-  // Load Balancing happens halfway into the computation
-  void next_iter() {
-    if (iteration < total_iterations) {
-      if ((iteration == total_iterations/2) && usesAtSync) {
-       AtSync();
-      } else {
-       compute();
-      }
-    } else {
-      mainProxy.report_done();
-    }
-  }
-
-  void compute() {
-    double timeStamp = CkWallTimer();
-    //    double a[2000], b[2000], c[2000];
-    // This is to get around the tiny default stack size used by the
-    // bigsim emulator on certain machines.
-    double *a;
-    double *b;
-    double *c;
-    a = new double[2000];
-    b = new double[2000];
-    c = new double[2000];
-    for(int j=0;j<1000*work_factor;j++){
-      for(int i=0;i<2000;i++){
-       a[i] = 7.0;
-       b[i] = 5.0;
-      }
-      for(int i=0;i<2000/2;i++){
-       c[i] = a[2*i]*b[2*i+1]*a[i];
-       c[2*i] = a[2*i];
-      }
-    }
-    delete [] a;
-    delete [] b;
-    delete [] c;
-    double timeTaken = CkWallTimer() - timeStamp;
-    // Sanity output
-    if (((iteration == 0) || (iteration == total_iterations-1)) &&
-       ((thisIndex == 0) || (thisIndex == 1))) {
-      CkPrintf("[%d] Array Element %d took %f seconds at iteration %d\n", 
-              CkMyPe(), thisIndex, timeTaken, iteration);
-    }
-    iteration++;
-    mainProxy.iterBarrier(timeTaken);
-  }
-  
-  void ResumeFromSync(void) { // Called by Load-balancing framework
-    compute();
-  }
-  
-  void pup(PUP::er &p)
-  {
-    CBase_LB_Test::pup(p);
-    p | iteration;
-    p | work_factor;
-  }
-};
-
-#include "LB_Test.def.h"
diff --git a/examples/charm++/simple_imbalance/LB_Test.ci b/examples/charm++/simple_imbalance/LB_Test.ci
deleted file mode 100644 (file)
index bae3a12..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-mainmodule LB_Test {
-  readonly CProxy_Main mainProxy;
-  readonly int num_chare_blocks;
-  readonly int workWeight;
-  readonly int total_iterations;
-
-  mainchare Main {
-    entry Main(CkArgMsg *m);
-    entry void report_in();
-    entry void iterBarrier(double chareWorkTime);
-    entry void report_done();
-  };
-
-  array [1D] LB_Test {
-    // Normal Charm++ entry methods
-    entry LB_Test(void);
-    entry void next_iter();
-  };
-};
diff --git a/examples/charm++/simple_imbalance/Makefile b/examples/charm++/simple_imbalance/Makefile
deleted file mode 100644 (file)
index 890de77..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-CHARMC=../../../bin/charmc $(OPTS)
-
-OBJS = LB_Test.o
-
-all: LB_Test LB_Test_LB
-
-LB_Test: $(OBJS)
-       $(CHARMC) -language charm++ -o LB_Test $(OBJS)
-
-LB_Test_LB: $(OBJS)
-       $(CHARMC) -language charm++ -o LB_Test_LB -module CommonLBs $(OBJS)
-
-LB_Test.decl.h: LB_Test.ci
-       $(CHARMC)  LB_Test.ci
-
-clean:
-       rm -f *.decl.h *.def.h conv-host *.o LB_Test LB_Test_LB charmrun *~ *.core
-
-LB_Test.o: LB_Test.C LB_Test.decl.h
-       $(CHARMC) -c LB_Test.C
index 526bea0a597289f5e97229e850a4ab660e54043f..539cb8ce9ebfbe1436c7b0bec205cd20c78e4151 100644 (file)
@@ -1,4 +1,4 @@
-DIRS=megatest pingpong simplearrayhello loadbalancing chkpt delegation queue sdag
+DIRS=megatest pingpong simplearrayhello load_balancing chkpt delegation queue sdag
 
 all:
        for d in $(DIRS); do \
@@ -12,7 +12,7 @@ test:
 
 # skip sdag, megatest and commtest
 bgtest:
-       for d in pingpong simplearrayhello loadbalancing chkpt delegation; do \
+       for d in pingpong simplearrayhello load_balancing chkpt delegation; do \
                (cd $$d; $(MAKE) bgtest OPTS='$(OPTS)' || exit 1) || exit 1; \
        done
 
similarity index 94%
rename from tests/charm++/loadbalancing/Makefile
rename to tests/charm++/load_balancing/Makefile
index 3a50aff09622ae82b0b19d7de2cc6f244fcff0ce..46e60773ff6907d6d13ac4e0b9c9bdd26a211aaa 100644 (file)
@@ -1,4 +1,4 @@
-DIRS= lb_test jacobi2D
+DIRS= lb_test
 
 all:
        for d in $(DIRS); do \
diff --git a/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.C b/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.C
deleted file mode 100644 (file)
index 9ea59e4..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-
-#include "Jacobi2D.h"
-
-#define ITERATIONS 1000
-
-  TheMain::TheMain(CkArgMsg *)
-  {
-   CkPrintf("ChareArray %d sq, data array %d sq, iterations %d\n", TheMain::NUM_CHUNKS, TheMain::CHUNK_SIZE, ITERATIONS);
-   int i;
-   int j;
-   CProxy_JacobiChunk jc = CProxy_JacobiChunk::ckNew();
-   for(i = 0;(i < TheMain::NUM_CHUNKS);(i++))   for(j = 0;(j < TheMain::NUM_CHUNKS);(j++))      jc(i,j).insert();
-   jc.doneInserting();
-   jc(0,0).setStartTime(CmiWallTimer());
-   jc.startNextIter();
-  }
-  void TheMain::pup(PUP::er &p) {
-   CBase_TheMain::pup(p);
-  }
-
-  JacobiChunk::JacobiChunk() {
-   int i;
-   int j;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))   data[i][j] = (100.0 + (((i + j) % 2)?(-1):1));
-   numGot = 0;
-   numIters = 0;
-   numDone = 0;
-   numNeighbors = 4;
-   if (((thisIndex.x == 0) || (thisIndex.x == (TheMain::NUM_CHUNKS - 1))))
-   (--numNeighbors);
-   if (((thisIndex.y == 0) || (thisIndex.y == (TheMain::NUM_CHUNKS - 1))))
-   (--numNeighbors);
-   maxDelta = 0.0;
-   numIters = ITERATIONS;
-   usesAtSync = false;
-   //usesAtSync = true;
-   usesAutoMeasure = true;
-  }
-
-  void JacobiChunk::setStartTime(double t)
-  {
-     CkPrintf("Start time = %f\n", t);
-     startTime = t;
-  }
-
-  void JacobiChunk::startNextIter()
-  {
-    int i;
-    if (thisIndex.x == 0 && thisIndex.y == 0) CmiPrintf("startNextIter: %d\n", numIters);
-    if ((thisIndex.x > 0))
-    thisProxy((thisIndex.x - 1),thisIndex.y).getBottom(data[1]);
-    if ((thisIndex.x < (TheMain::NUM_CHUNKS - 1)))
-    thisProxy((thisIndex.x + 1),thisIndex.y).getTop(data[TheMain::CHUNK_SIZE]);
-    float tmp[TheMain::CHUNK_SIZE + 2];
-    if ((thisIndex.y > 0))
-    {
-     for(i = 0;(i <= (TheMain::CHUNK_SIZE + 1));(i++))     tmp[i] = data[i][1];
-     thisProxy(thisIndex.x,(thisIndex.y - 1)).getRight(tmp);
-    }
-    if ((thisIndex.y < (TheMain::NUM_CHUNKS - 1)))
-    {
-     for(i = 0;(i <= (TheMain::CHUNK_SIZE + 1));(i++))     tmp[i] = data[i][TheMain::CHUNK_SIZE];
-     thisProxy(thisIndex.x,(thisIndex.y + 1)).getLeft(tmp);
-    }
-  }
-
-  void JacobiChunk::getLeft(float left[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][0] = left[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getRight(float right[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][(TheMain::CHUNK_SIZE + 1)] = right[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getTop(float top[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[0][i] = top[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getBottom(float bottom[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[(TheMain::CHUNK_SIZE + 1)][i] = bottom[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::refine()
-  {
-//      double t = CmiWallTimer();
-   int i;
-   int j;
-   if ((thisIndex.y == 0))
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][0] = data[i][1];
-   else
-   if ((thisIndex.y == (TheMain::NUM_CHUNKS - 1)))
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][(TheMain::CHUNK_SIZE + 1)] = data[i][TheMain::CHUNK_SIZE];
-   if ((thisIndex.x == 0))
-   for(i = 0;(i <= TheMain::CHUNK_SIZE);(i++))   data[0][i] = data[1][i];
-   else
-   if ((thisIndex.x == (TheMain::NUM_CHUNKS - 1)))
-   for(i = 0;(i <= TheMain::CHUNK_SIZE);(i++))   data[(TheMain::CHUNK_SIZE + 1)][i] = data[TheMain::CHUNK_SIZE][i];
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))   data[i][j] = (((((data[(i - 1)][j] + data[i][j]) + data[(i + 1)][j]) + data[i][(j - 1)]) + data[i][(j + 1)]) / 5.0);
-//     CkPrintf("Iteration time in microsecs = %d\n", (int )((CmiWallTimer() - t) * 1.0e6));
-   if (false)
-   {
-     int i,j;
-     maxDelta = 0;
-     for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))    for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))    {
-      float delta = (data[i][j] - data[(i - 1)][j]);
-      if ((delta < 0))
-      delta *= (-1);
-      if ((delta > maxDelta))
-      maxDelta = delta;
-     }
-   }
-
-     // reduction
-   CkCallback cb(CkIndex_JacobiChunk::stepping(NULL), thisProxy(0,0));
-   contribute(sizeof(float), &maxDelta, CkReduction::sum_float, cb);
-  }
-
-  void JacobiChunk::done(float delta)
-  {
-   if ((delta > maxDelta))
-     maxDelta = delta;
-   double t = CmiWallTimer();
-   CkPrintf("From %d %d: %f\n", thisIndex.x, thisIndex.y, maxDelta);
-   CkPrintf("End time = %f, Total time in microsecs = %u\n", t, (unsigned long)((t - startTime) * 1.0e6));
-   CkExit();
-  }
-  void JacobiChunk::pup(PUP::er &p) {
-   CBase_JacobiChunk::pup(p);
-   p|startTime;
-   p|numNeighbors;
-   p|numDone;
-   p|numGot;
-   p|numIters;
-   p|maxDelta;
-   p((char*)data, (TheMain::CHUNK_SIZE+2)*(TheMain::CHUNK_SIZE+2)*sizeof(float));
-  }
-
-  void JacobiChunk::ResumeFromSync() {
-   startNextIter();
-  }
-
-  // a callback function to set object load
-  void JacobiChunk::UserSetLBLoad() {
-    setObjTiming(1.0);
-  }
-
-  void JacobiChunk::stepping(CkReductionMsg *m) {   // on PE 0
-   float max_delta = *(float*)m->getData();
-   delete m;
-   numIters --;
-   if (numIters > 0) {
-     /*
-     if (numIters % MIGRATE_STEPS == 3){
-       CkPrintf("bcast atsync\n");
-       thisProxy.AtSync();
-     }
-     else
-       */
-       thisProxy.startNextIter();
-   }
-   else
-       done(max_delta);
-  }
-
-
-#include "Jacobi2D.def.h"
diff --git a/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.ci b/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.ci
deleted file mode 100644 (file)
index 7da46ac..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-mainmodule Jacobi2D {
- mainchare TheMain  {
-  entry TheMain(CkArgMsg *);
- }
- array [2D] JacobiChunk  {
-  entry JacobiChunk();
-  entry void setStartTime(double t);
-  entry void startNextIter();
-  entry void getLeft(float left[TheMain::CHUNK_SIZE+2]);
-  entry void getRight(float right[TheMain::CHUNK_SIZE+2]);
-  entry void getTop(float top[TheMain::CHUNK_SIZE+2]);
-  entry void getBottom(float bottom[TheMain::CHUNK_SIZE+2]);
-  entry void refine();
-  entry void AtSync();
-  entry void stepping(CkReductionMsg *m);
- }
-}
diff --git a/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.h b/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Jacobi2D.h
deleted file mode 100644 (file)
index e2657eb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#include <vector>
-using std::vector;
-#include "pup_stl.h"
-
-#include "Jacobi2D.decl.h"
-
-#define  MIGRATE_STEPS              10
-
- class TheMain: public CBase_TheMain  {
-  public: enum {NUM_CHUNKS=20};
-  public: enum {CHUNK_SIZE=64};
-  public: TheMain(CkArgMsg *);
-  public: virtual void pup(PUP::er &p);
- };
-
-typedef float arr_t[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
-PUPbytes(arr_t)
-
- class JacobiChunk: public CBase_JacobiChunk  {
-  public: JacobiChunk(CkMigrateMessage *m) {}
-  private: float data[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
-  private: int numIters;
-  private: int numGot;
-  private: int numDone;
-  private: int numNeighbors;
-  private: float maxDelta;
-  private: double startTime;
-  public: JacobiChunk();
-  public: void setStartTime(double t);
-  public: void startNextIter();
-  public: void getLeft(float left[]);
-  public: void getRight(float right[]);
-  public: void getTop(float top[]);
-  public: void getBottom(float bottom[]);
-  public: void refine();
-  public: void done(float delta);
-  public: virtual void pup(PUP::er &p);
-  public: void stepping(CkReductionMsg *m);
-  public: 
-    virtual void ResumeFromSync();
-    virtual void UserSetLBLoad();
- };
-
diff --git a/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Makefile b/tests/charm++/loadbalancing/jacobi2D-periodic-lb/Makefile
deleted file mode 100644 (file)
index a2d9bf2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-CHARMC=../../../../bin/charmc $(OPTS)
-FNAME=Jacobi2D
-
-all: pgm
-
-pgm:  $(FNAME).o
-       $(CHARMC) $(FNAME).o -o pgm -language charm++ -module CommonLBs
-
-$(FNAME).o : $(FNAME).C $(FNAME).h $(FNAME).ci
-       $(CHARMC) -c $(FNAME).ci $(FNAME).C
-
-clean:
-       rm -f *.o conv-host pgm charmrun *.def.h *.decl.h
-
-test:  pgm
-       ./charmrun +p4 ./pgm +LBPeriod 3 +balancer RotateLB +LBDebug $(TESTOPTS)
-
-bgtest:  pgm
-       ./charmrun +p4 ./pgm +LBPeriod 3 +balancer RotateLB +LBDebug +x2 +y4 +z1 +cth1 +wth1
diff --git a/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.C b/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.C
deleted file mode 100644 (file)
index f6339cb..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-
-#include "Jacobi2D.h"
-
-#define ITERATIONS 10
-
-  TheMain::TheMain(CkArgMsg *)
-  {
-   CkPrintf("ChareArray %d sq, data array %d sq, iterations %d\n", TheMain::NUM_CHUNKS, TheMain::CHUNK_SIZE, ITERATIONS);
-   CProxy_JacobiChunk jc = CProxy_JacobiChunk::ckNew(TheMain::NUM_CHUNKS,TheMain::NUM_CHUNKS);
-   jc(0,0).setStartTime(CmiWallTimer());
-   jc.startNextIter();
-  }
-  void TheMain::pup(PUP::er &p) {
-   CBase_TheMain::pup(p);
-  }
-
-  JacobiChunk::JacobiChunk() {
-   int i;
-   int j;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))   data[i][j] = (100.0 + (((i + j) % 2)?(-1):1));
-   numGot = 0;
-   numIters = 0;
-   numDone = 0;
-   numNeighbors = 4;
-   if (((thisIndex.x == 0) || (thisIndex.x == (TheMain::NUM_CHUNKS - 1))))
-   (--numNeighbors);
-   if (((thisIndex.y == 0) || (thisIndex.y == (TheMain::NUM_CHUNKS - 1))))
-   (--numNeighbors);
-   maxDelta = 0.0;
-   numIters = ITERATIONS;
-   usesAtSync = true;
-   usesAutoMeasure = true;
-  }
-
-  void JacobiChunk::setStartTime(double t)
-  {
-     CkPrintf("Start time = %f\n", t);
-     startTime = t;
-  }
-
-  void JacobiChunk::startNextIter()
-  {
-    int i;
-    startT = CmiWallTimer();
-    if (thisIndex.x == 0 && thisIndex.y == 0) CmiPrintf("startNextIter: %d\n", numIters);
-    if ((thisIndex.x > 0))
-    thisProxy((thisIndex.x - 1),thisIndex.y).getBottom(data[1]);
-    if ((thisIndex.x < (TheMain::NUM_CHUNKS - 1)))
-    thisProxy((thisIndex.x + 1),thisIndex.y).getTop(data[TheMain::CHUNK_SIZE]);
-    float tmp[TheMain::CHUNK_SIZE + 2];
-    if ((thisIndex.y > 0))
-    {
-     for(i = 0;(i <= (TheMain::CHUNK_SIZE + 1));(i++))     tmp[i] = data[i][1];
-     thisProxy(thisIndex.x,(thisIndex.y - 1)).getRight(tmp);
-    }
-    if ((thisIndex.y < (TheMain::NUM_CHUNKS - 1)))
-    {
-     for(i = 0;(i <= (TheMain::CHUNK_SIZE + 1));(i++))     tmp[i] = data[i][TheMain::CHUNK_SIZE];
-     thisProxy(thisIndex.x,(thisIndex.y + 1)).getLeft(tmp);
-    }
-  }
-
-  void JacobiChunk::getLeft(float left[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][0] = left[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getRight(float right[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][(TheMain::CHUNK_SIZE + 1)] = right[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getTop(float top[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[0][i] = top[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::getBottom(float bottom[])
-  {
-   int i;
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[(TheMain::CHUNK_SIZE + 1)][i] = bottom[i];
-   if (((++numGot) == numNeighbors))
-   {
-    numGot = 0;
-    refine();
-   }
-  }
-  void JacobiChunk::refine()
-  {
-//      double t = CmiWallTimer();
-   int i;
-   int j;
-   if ((thisIndex.y == 0))
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][0] = data[i][1];
-   else
-   if ((thisIndex.y == (TheMain::NUM_CHUNKS - 1)))
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   data[i][(TheMain::CHUNK_SIZE + 1)] = data[i][TheMain::CHUNK_SIZE];
-   if ((thisIndex.x == 0))
-   for(i = 0;(i <= TheMain::CHUNK_SIZE);(i++))   data[0][i] = data[1][i];
-   else
-   if ((thisIndex.x == (TheMain::NUM_CHUNKS - 1)))
-   for(i = 0;(i <= TheMain::CHUNK_SIZE);(i++))   data[(TheMain::CHUNK_SIZE + 1)][i] = data[TheMain::CHUNK_SIZE][i];
-   for (int k=0; k<(thisIndex.x*TheMain::NUM_CHUNKS + thisIndex.y)*100; k++)
-   for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))   for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))   data[i][j] = (((((data[(i - 1)][j] + data[i][j]) + data[(i + 1)][j]) + data[i][(j - 1)]) + data[i][(j + 1)]) / 5.0);
-//     CkPrintf("Iteration time in microsecs = %d\n", (int )((CmiWallTimer() - t) * 1.0e6));
-   if (false)
-   {
-     int i,j;
-     maxDelta = 0;
-     for(i = 1;(i <= TheMain::CHUNK_SIZE);(i++))    for(j = 1;(j <= TheMain::CHUNK_SIZE);(j++))    {
-      float delta = (data[i][j] - data[(i - 1)][j]);
-      if ((delta < 0))
-      delta *= (-1);
-      if ((delta > maxDelta))
-      maxDelta = delta;
-     }
-   }
-
-   double t = CmiWallTimer() - startT;
-   CkCallback cb2(CkIndex_JacobiChunk::print(NULL), thisProxy(0,0));
-   contribute(sizeof(double), &t, CkReduction::max_double, cb2);
-
-     // reduction
-   CkCallback cb(CkIndex_JacobiChunk::stepping(NULL), thisProxy(0,0));
-   contribute(sizeof(float), &maxDelta, CkReduction::max_float, cb);
-  }
-
-  void JacobiChunk::done(float delta)
-  {
-   if ((delta > maxDelta))
-     maxDelta = delta;
-   double t = CmiWallTimer();
-   CkPrintf("From %d %d: %f\n", thisIndex.x, thisIndex.y, maxDelta);
-   CkPrintf("End time = %f, Total time in microsecs = %u\n", t, (unsigned long)((t - startTime) * 1.0e6));
-   CkExit();
-  }
-  void JacobiChunk::pup(PUP::er &p) {
-   CBase_JacobiChunk::pup(p);
-   p|startTime;
-   p|numNeighbors;
-   p|numDone;
-   p|numGot;
-   p|numIters;
-   p|maxDelta;
-   p((char*)data, (TheMain::CHUNK_SIZE+2)*(TheMain::CHUNK_SIZE+2)*sizeof(float));
-  }
-
-  void JacobiChunk::ResumeFromSync() {
-   startNextIter();
-  }
-
-  // a callback function to set object load
-  void JacobiChunk::UserSetLBLoad() {
-    setObjTime(1.0);
-  }
-
-  void JacobiChunk::print(CkReductionMsg *m) {   // on PE 0
-   double maxT = *(double*)m->getData();
-   CmiPrintf("Iter: %d takes %fs.\n", numIters, maxT);
-  }
-
-  void JacobiChunk::stepping(CkReductionMsg *m) {   // on PE 0
-   float max_delta = *(float*)m->getData();
-   delete m;
-   numIters --;
-   if (numIters > 0) {
-     if (numIters % MIGRATE_STEPS == 5) {
-       thisProxy.AtSync();
-     }
-     else
-       thisProxy.startNextIter();
-   }
-   else
-       done(max_delta);
-  }
-
-
-#include "Jacobi2D.def.h"
diff --git a/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.ci b/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.ci
deleted file mode 100644 (file)
index ba7401a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-mainmodule Jacobi2D {
- mainchare TheMain  {
-  entry TheMain(CkArgMsg *);
- }
- array [2D] JacobiChunk  {
-  entry JacobiChunk();
-  entry void setStartTime(double t);
-  entry void startNextIter();
-  entry void getLeft(float left[TheMain::CHUNK_SIZE+2]);
-  entry void getRight(float right[TheMain::CHUNK_SIZE+2]);
-  entry void getTop(float top[TheMain::CHUNK_SIZE+2]);
-  entry void getBottom(float bottom[TheMain::CHUNK_SIZE+2]);
-  entry void refine();
-  entry void AtSync();
-  entry void stepping(CkReductionMsg *m);
-  entry void print(CkReductionMsg *m);
- }
-}
diff --git a/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.h b/tests/charm++/loadbalancing/jacobi2D/Jacobi2D.h
deleted file mode 100644 (file)
index 80f411e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-
-#include <vector>
-using std::vector;
-#include "pup_stl.h"
-
-#include "Jacobi2D.decl.h"
-
-#define  MIGRATE_STEPS              10
-
- class TheMain: public CBase_TheMain  {
-  public: enum {NUM_CHUNKS=6};
-  public: enum {CHUNK_SIZE=64};
-  public: TheMain(CkArgMsg *);
-  public: virtual void pup(PUP::er &p);
- };
-
-typedef float arr_t[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
-PUPbytes(arr_t)
-
- class JacobiChunk: public CBase_JacobiChunk  {
-  public: JacobiChunk(CkMigrateMessage *m) {}
-  private: float data[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
-  private: int numIters;
-  private: int numGot;
-  private: int numDone;
-  private: int numNeighbors;
-  private: float maxDelta;
-  private: double startTime;
-  private: double startT;
-  public: JacobiChunk();
-  public: void setStartTime(double t);
-  public: void startNextIter();
-  public: void getLeft(float left[]);
-  public: void getRight(float right[]);
-  public: void getTop(float top[]);
-  public: void getBottom(float bottom[]);
-  public: void refine();
-  public: void done(float delta);
-  public: virtual void pup(PUP::er &p);
-  public: void stepping(CkReductionMsg *m);
-  public: void print(CkReductionMsg *m);
-  public: 
-    virtual void ResumeFromSync();
-    virtual void UserSetLBLoad();
- };
-
diff --git a/tests/charm++/loadbalancing/jacobi2D/Makefile b/tests/charm++/loadbalancing/jacobi2D/Makefile
deleted file mode 100644 (file)
index 62e5c7c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-OPTS   = -O3
-CHARMC = ../../../../bin/charmc $(OPTS)
-LBLIB  = -module CommonLBs #-L$(HOME)/work/scotch/scotch_5.1.10b/lib/ -lscotch -lscotcherr -L$(HOME)/work/metis-4.0/ -lmetis
-FNAME  = Jacobi2D
-
-all: pgm
-
-pgm:  $(FNAME).o
-       $(CHARMC) $(FNAME).o -o pgm -language charm++ $(LBLIB)
-
-$(FNAME).o : $(FNAME).C $(FNAME).h $(FNAME).ci
-       $(CHARMC) -c $(FNAME).ci $(FNAME).C
-
-clean:
-       rm -f *.o conv-host pgm charmrun *.def.h *.decl.h pgm.exe pgm.pdb pgm.ilk
-
-test:  pgm
-       ./charmrun +p4 ./pgm +balancer RandCentLB +LBDebug 1 $(TESTOPTS)
-
-bgtest:  pgm
-       ./charmrun +p4 ./pgm +balancer RandCentLB +LBDebug 1 +x2 +y4 +z1 +cth1 +wth1