00001 00005 00006 #ifndef _REFINEKLB_H_ 00007 #define _REFINEKLB_H_ 00008 00009 #include "CentralLB.h" 00010 #include "RefinerApprox.h" 00011 #include "RefineKLB.decl.h" 00012 00013 class minheap; 00014 class maxheap; 00015 00016 void CreateRefineKLB(); 00017 BaseLB *AllocateRefineKLB(); 00018 00019 class RefineKLB : public CBase_RefineKLB { 00020 protected: 00021 computeInfo *computes; 00022 processorInfo *processors; 00023 minHeap *pes; 00024 maxHeap *computesHeap; 00025 int P; 00026 int numComputes; 00027 double averageLoad; 00028 00029 double overLoad; 00030 void performGreedyMoves(int count, BaseLB::LDStats* stats,int *from_procs, int *to_procs, int numMoves); 00031 00032 public: 00033 RefineKLB(const CkLBOptions &); 00034 RefineKLB(CkMigrateMessage *m):CBase_RefineKLB(m) { lbname = (char *)"RefineKLB"; } 00035 void work(LDStats* stats); 00036 private: 00037 bool QueryBalanceNow(int step) { return true; } 00038 00039 protected: 00040 /* 00041 void create(LDStats* stats, int count); 00042 void assign(computeInfo *c, int p); 00043 void assign(computeInfo *c, processorInfo *p); 00044 void deAssign(computeInfo *c, processorInfo *pRec); 00045 void computeAverage(); 00046 double computeMax(); 00047 int refine(); 00048 */ 00049 }; 00050 00051 #endif /* _REFINEKLB_H_ */ 00052