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;
24  int doMolly;
26  // BEGIN LA
28  // END LA
29  int doGBIS;// gbis
30  int doLCPO;//LCPO
32  int maxForceUsed; // may ignore slower force classes
33  int maxForceMerged; // add this and faster to normal
34 
35 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
36  int event_on; // true or false to control NVTX profiling
37 #endif
38 
44 
45  Lattice lattice; // rather than shipping around separately
46 
47  Flags() :
48  step(0),
49  sequence(0),
50  doEnergy(0),
51  doVirial(0),
52  doNonbonded(0),
54  doMolly(0),
55  doMinimize(0),
56  doLoweAndersen(0),
57  doGBIS(0),
58  doLCPO(0),
59  submitLoadStats(0),
60  maxForceUsed(0),
61  maxForceMerged(0),
62 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
63  event_on(0),
64 #endif
65  usePairlists(0),
66  savePairlists(0),
68  maxAtomMovement(0),
70  { }
71 
72  void copyIntFlags(const Flags &flags) {
73  step = flags.step;
74  sequence = flags.sequence;
75  doEnergy = flags.doEnergy;
76  doVirial = flags.doVirial;
77  doNonbonded = flags.doNonbonded;
79  doMolly = flags.doMolly;
80  doMinimize = flags.doMinimize;
82  doGBIS = flags.doGBIS;
83  doLCPO = flags.doLCPO;
85  maxForceUsed = flags.maxForceUsed;
87  lattice = flags.lattice;
88 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
89  event_on = flags.event_on;
90 #endif
91  // usePairlists = flags.usePairlists;
92  // savePairlists = flags.savePairlists;
93  }
94 
95  inline Flags& operator= (const Flags &flags)
96  {
97  memcpy(this, &flags, sizeof(Flags));
98  return *this;
99  }
100 
101 #if 0
102  void print() const {
103  fprintf(stderr, " step = %d\n", step);
104  fprintf(stderr, " sequence = %d\n", sequence);
105  fprintf(stderr, " doEnergy = %d\n", doEnergy);
106  fprintf(stderr, " doVirial = %d\n", doVirial);
107  fprintf(stderr, " doNonbonded = %d\n", doNonbonded);
108  fprintf(stderr, " doFullElectrostatics = %d\n", doFullElectrostatics);
109  fprintf(stderr, " doMolly = %d\n", doMolly);
110  fprintf(stderr, " doLoweAndersen = %d\n", doLoweAndersen);
111  fprintf(stderr, " doGBIS = %d\n", doGBIS);
112  fprintf(stderr, " doLCPO = %d\n", doLCPO);
113  fprintf(stderr, " submitLoadStats = %d\n", submitLoadStats);
114  fprintf(stderr, " maxForceUsed = %d\n", maxForceUsed);
115  fprintf(stderr, " maxForceMerged = %d\n", maxForceMerged);
116 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED)
117  fprintf(stderr, " event_on = %d\n", event_on);
118 #endif
119  fprintf(stderr, " usePairLists = %d\n", usePairlists);
120  fprintf(stderr, " savePairLists = %d\n", savePairlists);
121  fprintf(stderr, " pairlistTolerance = %g\n", pairlistTolerance);
122  fprintf(stderr, " maxAtomMovement = %g\n", maxAtomMovement);
123  fprintf(stderr, " maxGroupRadius = %g\n", maxGroupRadius);
124  fprintf(stderr, " lattice =\n");
125  fprintf(stderr, " a.x=%g a.y=%g a.z=%g\n",
126  lattice.a().x, lattice.a().y, lattice.a().z);
127  fprintf(stderr, " b.x=%g b.y=%g b.z=%g\n",
128  lattice.b().x, lattice.b().y, lattice.b().z);
129  fprintf(stderr, " c.x=%g c.y=%g c.z=%g\n",
130  lattice.c().x, lattice.c().y, lattice.c().z);
131  fprintf(stderr, " o.x=%g o.y=%g o.z=%g\n",
133  }
134 #endif
135 };
136 
137 class Results
138 {
139 public:
140  enum { normal=0, nbond=1, slow=2, amdf=3,
141 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
143 #else
144  nbond_virial=4, slow_virial=5, maxNumForces=6 };
145 #endif
146  Force *f[maxNumForces];
147 };
148 
149 #endif
150 
NAMD_HOST_DEVICE Vector c() const
Definition: Lattice.h:270
Flags()
Definition: PatchTypes.h:47
Definition: Vector.h:72
Flags & operator=(const Flags &flags)
Definition: PatchTypes.h:95
int savePairlists
Definition: PatchTypes.h:40
BigReal z
Definition: Vector.h:74
int usePairlists
Definition: PatchTypes.h:39
int doLoweAndersen
Definition: PatchTypes.h:27
void copyIntFlags(const Flags &flags)
Definition: PatchTypes.h:72
int doEnergy
Definition: PatchTypes.h:20
int doFullElectrostatics
Definition: PatchTypes.h:23
int submitLoadStats
Definition: PatchTypes.h:31
BigReal x
Definition: Vector.h:74
int maxForceUsed
Definition: PatchTypes.h:32
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:42
int doVirial
Definition: PatchTypes.h:21
BigReal y
Definition: Vector.h:74
int doLCPO
Definition: PatchTypes.h:30
Lattice lattice
Definition: PatchTypes.h:45
BigReal pairlistTolerance
Definition: PatchTypes.h:41
int doGBIS
Definition: PatchTypes.h:29
int maxForceMerged
Definition: PatchTypes.h:33
NAMD_HOST_DEVICE Vector a() const
Definition: Lattice.h:268
BigReal maxGroupRadius
Definition: PatchTypes.h:43
NAMD_HOST_DEVICE Vector origin() const
Definition: Lattice.h:278
int doMolly
Definition: PatchTypes.h:24
int doMinimize
Definition: PatchTypes.h:25
double BigReal
Definition: common.h:123
int step
Definition: PatchTypes.h:16