Merge branch 'charm' of charmgit:charm into charm
[charm.git] / tests / charm++ / loadbalancing / jacobi2D / Jacobi2D.h
1
2 #include <vector>
3 using std::vector;
4 #include "pup_stl.h"
5
6 #include "Jacobi2D.decl.h"
7
8 #define  MIGRATE_STEPS              10
9
10  class TheMain: public CBase_TheMain  {
11   public: enum {NUM_CHUNKS=6};
12   public: enum {CHUNK_SIZE=64};
13   public: TheMain(CkArgMsg *);
14   public: virtual void pup(PUP::er &p);
15  };
16
17 typedef float arr_t[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
18 PUPbytes(arr_t)
19
20  class JacobiChunk: public CBase_JacobiChunk  {
21   public: JacobiChunk(CkMigrateMessage *m) {}
22   private: float data[TheMain::CHUNK_SIZE+2][TheMain::CHUNK_SIZE+2];
23   private: int numIters;
24   private: int numGot;
25   private: int numDone;
26   private: int numNeighbors;
27   private: float maxDelta;
28   private: double startTime;
29   private: double startT;
30   public: JacobiChunk();
31   public: void setStartTime(double t);
32   public: void startNextIter();
33   public: void getLeft(float left[]);
34   public: void getRight(float right[]);
35   public: void getTop(float top[]);
36   public: void getBottom(float bottom[]);
37   public: void refine();
38   public: void done(float delta);
39   public: virtual void pup(PUP::er &p);
40   public: void stepping(CkReductionMsg *m);
41   public: void print(CkReductionMsg *m);
42   public: 
43     virtual void ResumeFromSync();
44     virtual void UserSetLBLoad();
45  };
46