Fix hash table usage for XLC
[charm.git] / src / ck-ldb / TempAwareGreedyLB.h
blob752fca7895ed937a373ccd12898465cec3cf185f
1 /**
2 * \addtogroup CkLdb
3 */
4 /*@{*/
6 #ifndef _GREEDYLB_H_
7 #define _GREEDYLB_H_
9 #include "CentralLB.h"
10 #include "TempAwareGreedyLB.decl.h"
12 void CreateTempAwareGreedyLB();
13 BaseLB * AllocateTempAwareGreedyLB();
15 class TempAwareGreedyLB : public CBase_TempAwareGreedyLB {
17 public:
18 struct HeapData {
19 double load;
20 int pe;
21 int id;
24 TempAwareGreedyLB(const CkLBOptions &);
25 TempAwareGreedyLB(CkMigrateMessage *m) : CBase_TempAwareGreedyLB(m) { lbname = "GreedyLB"; }
26 void work(LDStats* stats);
27 private:
28 class ProcLoadGreater;
29 class ObjLoadGreater;
31 enum HeapCmp {GT = '>', LT = '<'};
32 void Heapify(HeapData*, int, int, HeapCmp);
33 void HeapSort(HeapData*, int, HeapCmp);
34 void BuildHeap(HeapData*, int, HeapCmp);
35 bool Compare(double, double, HeapCmp);
36 HeapData* BuildCpuArray(BaseLB::LDStats*, int, int *);
37 HeapData* BuildObjectArray(BaseLB::LDStats*, int, int *);
38 bool QueryBalanceNow(int step);
41 #endif /* _HEAPCENTLB_H_ */
43 /*@}*/