NAMD
PatchTypes.h
Go to the documentation of this file.
1 
7 #ifndef PATCHTYPES_H
8 #define PATCHTYPES_H
9 
10 #include "NamdTypes.h"
11 #include "Lattice.h"
12 
13 class Flags
14 {
15 public:
16  int step; // timestep number reported to user
17  // Same number may appear multiple times!
18  int sequence; // sequence number of compute call
19  // changes by 1 every time!
20  int doEnergy;
21  int doVirial;
25  int doMolly;
27  // BEGIN LA
29  // END LA
30  int doGBIS;// gbis
31  int doLCPO;//LCPO
33  int maxForceUsed; // may ignore slower force classes
34  int maxForceMerged; // add this and faster to normal
35 
36 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
37  int event_on; // true or false to control NVTX profiling
38 #endif
39 
45 
46  Lattice lattice; // rather than shipping around separately
47 
48  Flags() :
49  step(0),
50  sequence(0),
51  doEnergy(0),
52  doVirial(0),
53  doNonbonded(0),
56  doMolly(0),
57  doMinimize(0),
58  doLoweAndersen(0),
59  doGBIS(0),
60  doLCPO(0),
61  submitLoadStats(0),
62  maxForceUsed(0),
63  maxForceMerged(0),
64 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
65  event_on(0),
66 #endif
67  usePairlists(0),
68  savePairlists(0),
70  maxAtomMovement(0),
72  { }
73 
74  void copyIntFlags(const Flags &flags) {
75  step = flags.step;
76  sequence = flags.sequence;
77  doEnergy = flags.doEnergy;
78  doVirial = flags.doVirial;
79  doNonbonded = flags.doNonbonded;
82  doMolly = flags.doMolly;
83  doMinimize = flags.doMinimize;
85  doGBIS = flags.doGBIS;
86  doLCPO = flags.doLCPO;
88  maxForceUsed = flags.maxForceUsed;
90  lattice = flags.lattice;
91 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
92  event_on = flags.event_on;
93 #endif
94  // usePairlists = flags.usePairlists;
95  // savePairlists = flags.savePairlists;
96  }
97 
98  inline Flags& operator= (const Flags &flags)
99  {
100  memcpy(this, &flags, sizeof(Flags));
101  return *this;
102  }
103 
104 #if 0
105  void print() const {
106  fprintf(stderr, " step = %d\n", step);
107  fprintf(stderr, " sequence = %d\n", sequence);
108  fprintf(stderr, " doEnergy = %d\n", doEnergy);
109  fprintf(stderr, " doVirial = %d\n", doVirial);
110  fprintf(stderr, " doNonbonded = %d\n", doNonbonded);
111  fprintf(stderr, " doFullElectrostatics = %d\n", doFullElectrostatics);
112  fprintf(stderr, " doFullDispersion = %d\n", doFullDispersion);
113  fprintf(stderr, " doMolly = %d\n", doMolly);
114  fprintf(stderr, " doLoweAndersen = %d\n", doLoweAndersen);
115  fprintf(stderr, " doGBIS = %d\n", doGBIS);
116  fprintf(stderr, " doLCPO = %d\n", doLCPO);
117  fprintf(stderr, " submitLoadStats = %d\n", submitLoadStats);
118  fprintf(stderr, " maxForceUsed = %d\n", maxForceUsed);
119  fprintf(stderr, " maxForceMerged = %d\n", maxForceMerged);
120 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED)
121  fprintf(stderr, " event_on = %d\n", event_on);
122 #endif
123  fprintf(stderr, " usePairLists = %d\n", usePairlists);
124  fprintf(stderr, " savePairLists = %d\n", savePairlists);
125  fprintf(stderr, " pairlistTolerance = %g\n", pairlistTolerance);
126  fprintf(stderr, " maxAtomMovement = %g\n", maxAtomMovement);
127  fprintf(stderr, " maxGroupRadius = %g\n", maxGroupRadius);
128  fprintf(stderr, " lattice =\n");
129  fprintf(stderr, " a.x=%g a.y=%g a.z=%g\n",
130  lattice.a().x, lattice.a().y, lattice.a().z);
131  fprintf(stderr, " b.x=%g b.y=%g b.z=%g\n",
132  lattice.b().x, lattice.b().y, lattice.b().z);
133  fprintf(stderr, " c.x=%g c.y=%g c.z=%g\n",
134  lattice.c().x, lattice.c().y, lattice.c().z);
135  fprintf(stderr, " o.x=%g o.y=%g o.z=%g\n",
137  }
138 #endif
139 };
140 
141 class Results
142 {
143 public:
144  enum { normal=0, nbond=1, slow=2, amdf=3,
145 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
147 #else
148  nbond_virial=4, slow_virial=5, maxNumForces=6 };
149 #endif
150  Force *f[maxNumForces];
151 };
152 
153 #endif
154 
NAMD_HOST_DEVICE Vector c() const
Definition: Lattice.h:270
Flags()
Definition: PatchTypes.h:48
Definition: Vector.h:72
Flags & operator=(const Flags &flags)
Definition: PatchTypes.h:98
int savePairlists
Definition: PatchTypes.h:41
BigReal z
Definition: Vector.h:74
int usePairlists
Definition: PatchTypes.h:40
int doLoweAndersen
Definition: PatchTypes.h:28
void copyIntFlags(const Flags &flags)
Definition: PatchTypes.h:74
int doEnergy
Definition: PatchTypes.h:20
int doFullElectrostatics
Definition: PatchTypes.h:23
int submitLoadStats
Definition: PatchTypes.h:32
BigReal x
Definition: Vector.h:74
int maxForceUsed
Definition: PatchTypes.h:33
int sequence
Definition: PatchTypes.h:18
int doNonbonded
Definition: PatchTypes.h:22
NAMD_HOST_DEVICE Vector b() const
Definition: Lattice.h:269
BigReal maxAtomMovement
Definition: PatchTypes.h:43
int doVirial
Definition: PatchTypes.h:21
BigReal y
Definition: Vector.h:74
int doLCPO
Definition: PatchTypes.h:31
Lattice lattice
Definition: PatchTypes.h:46
BigReal pairlistTolerance
Definition: PatchTypes.h:42
int doGBIS
Definition: PatchTypes.h:30
int doFullDispersion
Definition: PatchTypes.h:24
int maxForceMerged
Definition: PatchTypes.h:34
NAMD_HOST_DEVICE Vector a() const
Definition: Lattice.h:268
BigReal maxGroupRadius
Definition: PatchTypes.h:44
NAMD_HOST_DEVICE Vector origin() const
Definition: Lattice.h:278
int doMolly
Definition: PatchTypes.h:25
int doMinimize
Definition: PatchTypes.h:26
double BigReal
Definition: common.h:123
int step
Definition: PatchTypes.h:16