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