doc: Add serial to list of ci file reserved words
[charm.git] / src / ck-ldb / CommAwareRefineLB.h
1 /**
2  * \addtogroup CkLdb
3 */
4 /*@{*/
5
6 #ifndef _COMMAWARELB_H_
7 #define _COMMAWARELB_H_
8
9 #include "CentralLB.h"
10 #include "CommAwareRefineLB.decl.h"
11
12 void CreateCommAwareRefineLB();
13 BaseLB * AllocateCommAwareRefineLB();
14
15 class CommAwareRefineLB : public CentralLB {
16
17 public:
18   struct HeapData {
19     double load;
20     int    pe;
21     int    id;
22
23   };
24
25   CommAwareRefineLB(const CkLBOptions &);
26   CommAwareRefineLB(CkMigrateMessage *m):CentralLB(m) {
27     lbname = "CommAwareRefineLB";
28   }
29   void work(LDStats* stats);
30 private:
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         CmiBool        Compare(double, double, HeapCmp);
36         HeapData*      BuildCpuArray(BaseLB::LDStats*, int, int *);  
37         HeapData*      BuildObjectArray(BaseLB::LDStats*, int, int *);      
38         CmiBool        QueryBalanceNow(int step);
39 };
40
41 #endif /* _COMMAWARELB_H_ */
42
43 /*@}*/