NAMD
AlgRecBisection.h
Go to the documentation of this file.
1 
7 #ifndef ALGROB_H
8 #define ALGROB_H
9 
10 //#include "elements.h"
11 #include "PatchMap.h"
12 #include "Rebalancer.h"
13 
14 class AlgRecBisection : public Rebalancer
15 {
16 private:
17 
18 class Partition {
19 public:
20  int refno;
21  double load; // total load in this set
22  int origin[3];
23  int corner[3];
24  int count;
25  int node, mapped;
26 public:
27  Partition(): refno(0), load(0.0), node(-1), mapped(0) {};
28  inline int operator==(const Partition &p) const { return origin[0]==p.origin[0] && origin[1]==p.origin[1] && origin[2]==p.origin[2] && corner[0]==p.corner[0] && corner[1]==p.corner[1] && corner[2]==p.corner[2]; }
29 };
30 
31 typedef struct {
32  int id;
33  int v[3];
34  double load;
35  int refno;
36  int tv;
37 } ComputeLoad;
38 
39 
40 typedef struct {
41  int v;
42  int id;
43 } VecArray;
44 
45 enum {XDIR=0, YDIR, ZDIR};
46 
47 ComputeLoad *computeLoad;
48 VecArray *(vArray[3]);
49 Partition *partitions;
50 Partition top_partition;
51 int npartition;
52 int currentp, refno;
53 
54 void strategy();
55 void rec_divide(int, Partition&);
56 void setVal(int x, int y, int z);
57 int sort_partition(int x, int p, int r);
58 void qsort(int x, int p, int r);
59 void quicksort(int x);
60 void mapPartitionsToNodes();
61 
62 
63 public:
64 AlgRecBisection(computeInfo *computeArray, patchInfo *patchArray,
65  processorInfo *processorArray, int nComps,
66  int nPatches, int nPes);
67 };
68 
69 #endif
70 
71 
72 
73 
BlockLoad::TempStorage load
gridSize z
int operator==(const AtomSigInfo &s1, const AtomSigInfo &s2)
Definition: CompressPsf.C:146
gridSize y
gridSize x
AlgRecBisection(computeInfo *computeArray, patchInfo *patchArray, processorInfo *processorArray, int nComps, int nPatches, int nPes)