-
Notifications
You must be signed in to change notification settings - Fork 29
/
Orb3dLB.h
50 lines (38 loc) · 1.12 KB
/
Orb3dLB.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* \addtogroup CkLdb
*/
/*@{*/
#ifndef _ORB3DLB_H_
#define _ORB3DLB_H_
#include "CentralLB.h"
#include "MapStructures.h"
#include "Orb3dLB.decl.h"
#include "TaggedVector3D.h"
#include <queue>
class Orb3dLB : public CBase_Orb3dLB {
friend class MultistepLB;
private:
bool firstRound;
bool centroidsAllocated;
ComparatorFn compares[NDIMS];
ComparatorFn pc[NDIMS];
// pointer to stats->to_proc
decltype(LDStats::to_proc) *mapping;
int procsPerNode;
CkVec<TPObject> tps;
CkVec<Node> nodes;
void init();
bool QueryBalanceNow(int step);
void printData(BaseLB::LDStats &stats, int phase, int *revObjMap);
public:
Orb3dLB(const CkLBOptions &);
Orb3dLB(CkMigrateMessage *m) : CBase_Orb3dLB(m) {init();}
void work(BaseLB::LDStats* stats);
void directMap(int tpstart, int tpend, int nodestart, int nodeend);
void map(int tpstart, int tpend, int nodestart, int nodeend, int xs, int ys, int zs, int dim);
int nextDim(int dim, int xs, int ys, int zs);
void partitionEvenLoad(int tpstart, int tpend, int &tpmid);
void halveNodes(int nodestart, int nodeend, int &nodemid);
};
#endif /* _ORB3DLB_H_ */
/*@}*/