Go to the documentation of this file.
7 #ifndef SEQUENCER_H
8 #define SEQUENCER_H
10 #include "converse.h"
11 #include "Priorities.h"
12 #include "PatchTypes.h"
14 class HomePatch;
15 class SimParameters;
16 class SubmitReduction;
17 class CollectionMgr;
19 class LdbCoordinator;
20 class Random;
22 class Sequencer
23 {
24  friend class HomePatch;
25 public:
27  virtual ~Sequencer(void);
28  void run(void); // spawn thread, etc.
29  void awaken(void) {
30  CthAwakenPrio(thread, CK_QUEUEING_IFIFO, PRIORITY_SIZE, &priority);
31  }
32  void suspend(void);
34 protected:
35  virtual void algorithm(void); // subclasses redefine this method
37  void integrate(int); // Verlet integrator
38  void minimize(); // CG minimizer
41  void runComputeObjects(int migration = 1, int pairlists = 0, int pressureStep = 0);
45  void calcFixVirial(Tensor& fixVirialNormal, Tensor& fixVirialNbond, Tensor& fixVirialSlow,
46  Vector& fixForceNormal, Vector& fixForceNbond, Vector& fixForceSlow);
48  void submitReductions(int);
49  void submitHalfstep(int);
50  void submitMinimizeReductions(int, BigReal fmax2);
51  void submitCollections(int step, int zeroVel = 0);
53  void submitMomentum(int step);
54  void correctMomentum(int step, BigReal drifttime);
56  void saveForce(const int ftag = Results::normal);
57  void addForceToMomentum(BigReal, const int ftag = Results::normal, const int useSaved = 0);
58  void addForceToMomentum3(const BigReal timestep1, const int ftag1, const int useSaved1,
59  const BigReal timestep2, const int ftag2, const int useSaved2,
60  const BigReal timestep3, const int ftag3, const int useSaved3);
66  void minimizeMoveDownhill(BigReal fmax2);
69  void quenchVelocities();
71  void hardWallDrude(BigReal,int);
73  void rattle1(BigReal,int);
74  // void rattle2(BigReal,int);
76  void maximumMove(BigReal);
77  void minimizationQuenchVelocity(void);
79  void reloadCharges();
82  BigReal adaptTempT; // adaptive tempering temperature
83  void adaptTempUpdate(int); // adaptive tempering temperature update
85  void rescaleVelocities(int);
86  void rescaleaccelMD(int, int, int); // for accelMD
88  void reassignVelocities(BigReal,int);
89  void reinitVelocities(void);
91  void tcoupleVelocities(BigReal,int);
103  void berendsenPressure(int);
106  void langevinPiston(int);
107  int slowFreq;
108  void newtonianVelocities(BigReal, const BigReal, const BigReal,
109  const BigReal, const int, const int, const int);
113  // Multigrator
114  void scalePositionsVelocities(const Tensor& posScale, const Tensor& velScale);
115  void multigratorPressure(int step, int callNumber);
116  void scaleVelocities(const BigReal velScale);
118  void multigratorTemperature(int step, int callNumber);
122  // End of Multigrator
124  void cycleBarrier(int,int);
125  void traceBarrier(int);
127  void papiMeasureBarrier(int);
128 #endif
129  void terminate(void);
132  SimParameters *const simParams; // for convenience
133  HomePatch *const patch; // access methods in patch
140  int ldbSteps;
141  void rebalanceLoad(int timestep);
144 private:
145  CthThread thread;
146  unsigned int priority;
147  static void threadRun(Sequencer*);
149  LdbCoordinator *ldbCoordinator;
150 };
152 #endif
HomePatch *const patch
Definition: Sequencer.h:133
SubmitReduction * multigratorReduction
Definition: Sequencer.h:119
void rescaleVelocities(int)
Definition: Sequencer.C:1678
int doKineticEnergy
Definition: Sequencer.h:120
void minimizationQuenchVelocity(void)
Definition: Sequencer.C:2072
void tcoupleVelocities(BigReal, int)
Definition: Sequencer.C:1848
void addMovDragToPosition(BigReal)
Definition: Sequencer.C:718
void terminate(void)
Definition: Sequencer.C:2909
virtual void algorithm(void)
Definition: Sequencer.C:146
SubmitReduction * pressureProfileReduction
Definition: Sequencer.h:135
void integrate(int)
Definition: Sequencer.C:218
void scaleVelocities(const BigReal velScale)
Definition: Sequencer.C:1219
void addVelocityToPosition(BigReal)
Definition: Sequencer.C:1943
SubmitReduction * reduction
Definition: Sequencer.h:134
SubmitReduction * min_reduction
Definition: Sequencer.h:39
void maximumMove(BigReal)
Definition: Sequencer.C:2027
void cycleBarrier(int, int)
Definition: Sequencer.C:2889
void addRotDragToPosition(BigReal)
Definition: Sequencer.C:737
void saveForce(const int ftag=Results::normal)
Definition: Sequencer.C:1893
Definition: Vector.h:64
void langevinVelocitiesBBK2(BigReal)
Definition: Sequencer.C:1427
int slowFreq
Definition: Sequencer.h:107
void newMinimizeDirection(BigReal)
Definition: Sequencer.C:897
void newMinimizePosition(BigReal)
Definition: Sequencer.C:956
void langevinVelocitiesBBK1(BigReal)
Definition: Sequencer.C:1354
void rattle1(BigReal, int)
Definition: Sequencer.C:1970
void rebalanceLoad(int timestep)
Definition: Sequencer.C:2878
void submitHalfstep(int)
Definition: Sequencer.C:2083
void minimizeMoveDownhill(BigReal fmax2)
Definition: Sequencer.C:875
void addForceToMomentum(BigReal, const int ftag=Results::normal, const int useSaved=0)
Definition: Sequencer.C:1904
void langevinPiston(int)
Definition: Sequencer.C:1598
void addForceToMomentum3(const BigReal timestep1, const int ftag1, const int useSaved1, const BigReal timestep2, const int ftag2, const int useSaved2, const BigReal timestep3, const int ftag3, const int useSaved3)
Definition: Sequencer.C:1919
void submitCollections(int step, int zeroVel=0)
Definition: Sequencer.C:2643
BigReal calcKineticEnergy()
Definition: Sequencer.C:1227
void adaptTempUpdate(int)
Definition: Sequencer.C:1740
Definition: Priorities.h:13
void calcFixVirial(Tensor &fixVirialNormal, Tensor &fixVirialNbond, Tensor &fixVirialSlow, Vector &fixForceNormal, Vector &fixForceNbond, Vector &fixForceSlow)
Definition: Sequencer.C:2242
Definition: Random.h:37
void awaken(void)
Definition: Sequencer.h:29
int pairlistsAge
Definition: Sequencer.h:43
void multigratorPressure(int step, int callNumber)
Definition: Sequencer.C:1084
void berendsenPressure(int)
Definition: Sequencer.C:1534
void submitMomentum(int step)
Definition: Sequencer.C:993
int rescaleVelocities_numTemps
Definition: Sequencer.h:87
void runComputeObjects(int migration=1, int pairlists=0, int pressureStep=0)
Definition: Sequencer.C:2668
void rescaleaccelMD(int, int, int)
Definition: Sequencer.C:1697
CompAtomList p
Definition: Patch.h:146
Sequencer(HomePatch *p)
Definition: Sequencer.C:66
int ldbSteps
Definition: Sequencer.h:140
void run(void)
Definition: Sequencer.C:126
void scalePositionsVelocities(const Tensor &posScale, const Tensor &velScale)
Definition: Sequencer.C:1047
BigReal adaptTempT
Definition: Sequencer.h:82
void traceBarrier(int)
Definition: Sequencer.C:2897
int berendsenPressure_count
Definition: Sequencer.h:104
void reassignVelocities(BigReal, int)
Definition: Sequencer.C:1756
Random * random
Definition: Sequencer.h:131
void langevinVelocities(BigReal)
Definition: Sequencer.C:1317
void hardWallDrude(BigReal, int)
Definition: Sequencer.C:1955
void suspend(void)
Definition: Sequencer.C:136
void multigratorTemperature(int step, int callNumber)
Definition: Sequencer.C:1247
void reinitVelocities(void)
Definition: Sequencer.C:1788
int checkpoint_berendsenPressure_count
Definition: Sequencer.h:105
ControllerBroadcasts * broadcast
Definition: Sequencer.h:138
CollectionMgr *const collection
Definition: Sequencer.h:137
void stochRescaleVelocities(BigReal, int)
Definition: Sequencer.C:1872
Definition: Tensor.h:15
virtual ~Sequencer(void)
Definition: Sequencer.C:108
void newtonianVelocities(BigReal, const BigReal, const BigReal, const BigReal, const int, const int, const int)
Definition: Sequencer.C:1293
void rescaleSoluteCharges(BigReal)
Definition: Sequencer.C:1833
void submitMinimizeReductions(int, BigReal fmax2)
Definition: Sequencer.C:2505
int doMomenta
Definition: Sequencer.h:121
void correctMomentum(int step, BigReal drifttime)
Definition: Sequencer.C:1016
int pairlistsAreValid
Definition: Sequencer.h:42
int stochRescale_count
Definition: Sequencer.h:100
void quenchVelocities()
Definition: Sequencer.C:984
void submitReductions(int)
Definition: Sequencer.C:2262
SimParameters *const simParams
Definition: Sequencer.h:132
void rescaleVelocitiesByFactor(BigReal)
Definition: Sequencer.C:1811
void reloadCharges()
Definition: Sequencer.C:1821
double BigReal
Definition: common.h:114
void minimize()
Definition: Sequencer.C:760