
00001 #ifndef _GRIDCOMMREFINELB_H_ 00002 #define _GRIDCOMMREFINELB_H_ 00003 00004 #include <limits.h> 00005 #include "CentralLB.h" 00006 00007 #define CK_LDB_GRIDCOMMREFINELB_TOLERANCE 1.10 00008 00009 #ifndef MAXINT 00010 #define MAXINT 2147483647 00011 #endif 00012 00013 #if CONVERSE_VERSION_VMI 00014 extern "C" int CmiGetCluster (int process); 00015 #endif 00016 00017 void CreateGridCommRefineLB (); 00018 00019 class PE_Data_T 00020 { 00021 public: 00022 CmiBool available; 00023 int cluster; 00024 int num_objs; 00025 int num_lan_objs; 00026 int num_lan_msgs; 00027 int num_wan_objs; 00028 int num_wan_msgs; 00029 double relative_speed; 00030 double scaled_load; 00031 }; 00032 00033 class Object_Data_T 00034 { 00035 public: 00036 CmiBool migratable; 00037 int cluster; 00038 int from_pe; 00039 int to_pe; 00040 int num_lan_msgs; 00041 int num_wan_msgs; 00042 double load; 00043 }; 00044 00045 class GridCommRefineLB : public CentralLB 00046 { 00047 public: 00048 GridCommRefineLB (const CkLBOptions &); 00049 GridCommRefineLB (CkMigrateMessage *msg); 00050 00051 CmiBool QueryBalanceNow (int step); 00052 void work (LDStats *stats); 00053 void pup (PUP::er &p) { CentralLB::pup (p); } 00054 00055 private: 00056 int Get_Cluster (int pe); 00057 void Initialize_PE_Data (CentralLB::LDStats *stats); 00058 int Available_PE_Count (); 00059 int Compute_Number_Of_Clusters (); 00060 void Initialize_Object_Data (CentralLB::LDStats *stats); 00061 void Examine_InterObject_Messages (CentralLB::LDStats *stats); 00062 void Place_Objects_On_PEs (); 00063 void Remap_Objects_To_PEs (int cluster); 00064 int Find_Maximum_WAN_Object (int pe); 00065 int Find_Minimum_WAN_PE (int cluster); 00066 void Remove_Object_From_PE (int target_object, int target_pe); 00067 void Assign_Object_To_PE (int target_object, int target_pe); 00068 00069 int Num_PEs; 00070 int Num_Objects; 00071 int Num_Clusters; 00072 PE_Data_T *PE_Data; 00073 Object_Data_T *Object_Data; 00074 double CK_LDB_GridCommRefineLB_Tolerance; 00075 }; 00076 00077 #endif
1.5.5