NAMD
NamdHybridLB.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $Source: /home/cvs/namd/cvsroot/namd2/src/NamdHybridLB.h,v $
3  * $Author: jim $
4  * $Date: 2013/08/29 02:20:58 $
5  * $Revision: 1.15 $
6  *****************************************************************************/
7 
8 #ifndef _NAMDHYBRIDLB_H_
9 #define _NAMDHYBRIDLB_H_
10 
11 #include <HybridBaseLB.h>
12 #include "NamdHybridLB.decl.h"
13 
14 #include "Node.h"
15 #include "PatchMap.h"
16 #include "SimParameters.h"
17 #include "RefineOnly.h"
18 #include "Alg7.h"
19 #include "AlgRecBisection.h"
20 #include "InfoStream.h"
21 #include "NamdCentLB.h"
22 #include "NamdDummyLB.h"
23 #include "TorusLB.h"
24 #include "RefineTorusLB.h"
25 
26 void CreateNamdHybridLB();
27 
31 class LocalLBInfoMsg: public CMessage_LocalLBInfoMsg{
32 public:
33  int n_moves;
34  int startPE;
35  int endPE;
36  MigrateInfo *moves;
37  double *cpuloads;
38 
39  // Constructor
41 
42  // Pup method
43  void pup(PUP::er &p) {
44  int i;
45  p | n_moves;
46  p | startPE;
47  p | endPE;
48  for (i=0; i<n_moves; ++i) p | moves[i];
49  for (i=0; i<endPE-startPE+1; ++i) p | cpuloads[i];
50  }
51 
52 };
53 
54 class SplitComputesMsg;
55 
56 class NamdHybridLB : public HybridBaseLB {
57 
58 public:
59  NamdHybridLB(const CkLBOptions& opt);
60  NamdHybridLB(CkMigrateMessage *m):HybridBaseLB(m) {}
62  //void CollectInfo(Location *loc, int n, int fromlevel);
64 
65 private:
66  CProxy_NamdHybridLB thisProxy;
67  int updateCount;
68  int splitCount;
69  SplitComputesMsg **splitComputesMsgs;
70  bool collectFlag;
71  bool updateFlag;
72  int parent_backup;
73  Location *loc_backup;
74  int n_backup;
75  int fromlevel_backup;
76 
77  int *from_procs;
78  computeInfo *computeArray;
79  patchInfo *patchArray;
80  processorInfo *processorArray;
81 
82  double *peLoads;
83  int startPE;
84  int endPE;
85 
86  bool QueryBalanceNow(int step);
87  bool QueryDumpData();
88  // LBVectorMigrateMsg* VectorStrategy(LDStats* stats);
89 
90  CLBMigrateMsg* Strategy(LDStats* stats);
91  LBMigrateMsg* GrpLevelStrategy(LDStats* stats);
92 
93  int buildData(LDStats* stats);
94  int requiredProxies(PatchID id, int neighborNodes[]);
95  void dumpDataASCII(char *file, int numProcessors, int numPatches,
96  int numComputes);
97 
98  // centralized load balancer for load balancing all the children processors
99  NamdCentLB *centralLB;
100  NamdDummyLB *dummyLB;
101 };
102 
103 #endif /* _NAMDHYBRIDLB_H_ */
void UpdateLocalLBInfo(LocalLBInfoMsg *msg)
Definition: NamdHybridLB.C:178
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
NamdHybridLB(const CkLBOptions &opt)
Default constructor.
Definition: NamdHybridLB.C:65
double * cpuloads
Definition: NamdHybridLB.h:37
void splitComputes(SplitComputesMsg *)
Definition: NamdHybridLB.C:219
void CreateNamdHybridLB()
Definition: NamdHybridLB.C:49
int PatchID
Definition: NamdTypes.h:182
MigrateInfo * moves
Definition: NamdHybridLB.h:36
NamdHybridLB(CkMigrateMessage *m)
Definition: NamdHybridLB.h:60
void pup(PUP::er &p)
Definition: NamdHybridLB.h:43