doc: Add serial to list of ci file reserved words
[charm.git] / src / ck-ldb / TempAwareGreedyLB.h
1 /**
2  * \addtogroup CkLdb
3 */
4 /*@{*/
5
6 #ifndef _GREEDYLB_H_
7 #define _GREEDYLB_H_
8
9 #include "CentralLB.h"
10 #include "TempAwareGreedyLB.decl.h"
11
12 void CreateTempAwareGreedyLB();
13 BaseLB * AllocateTempAwareGreedyLB();
14
15 class TempAwareGreedyLB : public CentralLB {
16
17 public:
18   struct HeapData {
19     double load;
20     int    pe;
21     int    id;
22   };
23
24   TempAwareGreedyLB(const CkLBOptions &);
25   TempAwareGreedyLB(CkMigrateMessage *m):CentralLB(m) { lbname = "GreedyLB"; }
26   void work(LDStats* stats);
27 private:
28         enum           HeapCmp {GT = '>', LT = '<'};
29         void           Heapify(HeapData*, int, int, HeapCmp);
30         void           HeapSort(HeapData*, int, HeapCmp);
31         void           BuildHeap(HeapData*, int, HeapCmp);
32         CmiBool        Compare(double, double, HeapCmp);
33         HeapData*      BuildCpuArray(BaseLB::LDStats*, int, int *);  
34         HeapData*      BuildObjectArray(BaseLB::LDStats*, int, int *);      
35         CmiBool        QueryBalanceNow(int step);
36 };
37
38 #endif /* _HEAPCENTLB_H_ */
39
40 /*@}*/