00001
00002
00003
00004
00005
00006
00007
00033 #ifndef _NAMDCENTLB_H_
00034 #define _NAMDCENTLB_H_
00035
00036 #include <CentralLB.h>
00037 #include "NamdCentLB.decl.h"
00038
00039 #include "Node.h"
00040 #include "PatchMap.h"
00041 #include "SimParameters.h"
00042 #include "RefineOnly.h"
00043 #include "Alg7.h"
00044 #include "AlgRecBisection.h"
00045 #include "InfoStream.h"
00046 #include "TorusLB.h"
00047 #include "RefineTorusLB.h"
00048
00049 void CreateNamdCentLB();
00050 NamdCentLB *AllocateNamdCentLB();
00051
00052 class NamdCentLB : public CentralLB {
00053
00054 public:
00055 NamdCentLB();
00056 NamdCentLB(CkMigrateMessage *);
00057 #if CHARM_VERSION > 60301
00058 CLBMigrateMsg* Strategy(LDStats* stats);
00059 #else
00060 CLBMigrateMsg* Strategy(LDStats* stats, int n_pes);
00061 #endif
00062
00063 private:
00064 CmiBool QueryBalanceNow(int step);
00065 CmiBool QueryDumpData();
00066 int buildData(LDStats* stats);
00067 int requiredProxies(PatchID id, int neighborNodes[]);
00068 #if USE_TOPOMAP
00069 int requiredProxiesOnProcGrid(PatchID id, int neighborNodes[]);
00070 #endif
00071 void dumpDataASCII(char *file, int numProcessors, int numPatches,
00072 int numComputes);
00073 void loadDataASCII(char *file, int &numProcessors, int &numPatches,
00074 int &numComputes);
00075
00076 computeInfo *computeArray;
00077 patchInfo *patchArray;
00078 processorInfo *processorArray;
00079 };
00080
00081 #endif