Move BGQ XLC flag setting from header to compiler command line
[charm.git] / src / ck-ldb / OrbLB.h
blobc22317d1b075ad13cee9e2c0b31a65f6b5a7ac0e
1 /**
2 * \addtogroup CkLdb
3 */
4 /*@{*/
6 #ifndef _ORBLB_H_
7 #define _ORBLB_H_
9 #include "CentralLB.h"
10 #include "OrbLB.decl.h"
12 void CreateOrbLB();
13 BaseLB *AllocateOrbLB(void);
15 class OrbLB : public CBase_OrbLB {
16 public:/* <- Sun CC demands Partition be public for ComputeLoad to access it. */
18 class Partition {
19 public:
20 int refno;
21 double load; // total load in this set
22 int origin[3]; // box coordinates
23 int corner[3];
24 int count; // number of objects in this partition
25 int node, mapped;
26 CkVec<int> bkpes; // background processors
27 public:
28 Partition(): refno(0), load(0.0), node(-1), mapped(0) {};
31 private:
32 struct ComputeLoad {
33 int id;
34 int v[3];
35 double load;
36 int refno;
37 double tv;
38 Partition * partition;
42 struct VecArray {
43 int v;
44 int id;
47 enum {XDIR=0, YDIR, ZDIR};
49 LDStats* statsData;
50 int P;
51 ComputeLoad *computeLoad;
52 int nObjs;
53 VecArray *(vArray[3]);
54 Partition *partitions;
55 Partition top_partition;
56 int npartition;
57 int currentp, refno;
58 bool use_udata;
60 void init();
61 void strategy();
62 void rec_divide(int, Partition&);
63 void setVal(int x, int y, int z);
64 int sort_partition(int x, int p, int r);
65 void qsort(int x, int p, int r);
66 void quicksort(int x);
67 void mapPartitionsToNodes();
69 public:
70 double overLoad;
72 public:
73 OrbLB(const CkLBOptions &);
74 OrbLB(const CkLBOptions &, bool userdata);
75 OrbLB(CkMigrateMessage *m):CBase_OrbLB(m) { init(); }
77 void work(LDStats* stats);
78 bool QueryBalanceNow(int step);
82 #endif /* _ORBLB_H_ */
84 /*@}*/