Sequencer.h

Go to the documentation of this file.
00001 
00007 #ifndef SEQUENCER_H
00008 #define SEQUENCER_H
00009 
00010 #include "converse.h"
00011 #include "Priorities.h"
00012 #include "PatchTypes.h"
00013 
00014 class HomePatch;
00015 class SimParameters;
00016 class SubmitReduction;
00017 class CollectionMgr;
00018 class ControllerBroadcasts;
00019 class LdbCoordinator;
00020 class Random;
00021 
00022 class Sequencer
00023 {
00024     friend class HomePatch;
00025 public:
00026     Sequencer(HomePatch *p);
00027     virtual ~Sequencer(void);
00028     void run(void);             // spawn thread, etc.
00029     void awaken(void) {
00030       CthAwakenPrio(thread, CK_QUEUEING_IFIFO, PRIORITY_SIZE, &priority);
00031     }
00032     void suspend(void);
00033 
00034 protected:
00035     virtual void algorithm(void);       // subclasses redefine this method
00036 
00037     void integrate(int); // Verlet integrator
00038     void minimize(); // CG minimizer
00039       SubmitReduction *min_reduction;
00040 
00041     void runComputeObjects(int migration = 1, int pairlists = 0, int pressureStep = 0);
00042     int pairlistsAreValid;
00043     int pairlistsAge;
00044 
00045     void calcFixVirial(Tensor& fixVirialNormal, Tensor& fixVirialNbond, Tensor& fixVirialSlow,
00046       Vector& fixForceNormal, Vector& fixForceNbond, Vector& fixForceSlow);
00047 
00048     void submitReductions(int);
00049     void submitHalfstep(int);
00050     void submitMinimizeReductions(int, BigReal fmax2);
00051     void submitCollections(int step, int zeroVel = 0);
00052 
00053     void submitMomentum(int step);
00054     void correctMomentum(int step, BigReal drifttime);
00055 
00056     void saveForce(const int ftag = Results::normal);
00057     void addForceToMomentum(BigReal, const int ftag = Results::normal, const int useSaved = 0);
00058     void addForceToMomentum3(const BigReal timestep1, const int ftag1, const int useSaved1,
00059         const BigReal timestep2, const int ftag2, const int useSaved2,
00060         const BigReal timestep3, const int ftag3, const int useSaved3);
00061     void addVelocityToPosition(BigReal);
00062     
00063     void addRotDragToPosition(BigReal);
00064     void addMovDragToPosition(BigReal);
00065 
00066     void minimizeMoveDownhill(BigReal fmax2);
00067     void newMinimizeDirection(BigReal);
00068     void newMinimizePosition(BigReal);
00069     void quenchVelocities();
00070 
00071     void hardWallDrude(BigReal,int);
00072 
00073     void rattle1(BigReal,int);
00074     // void rattle2(BigReal,int);
00075 
00076     void maximumMove(BigReal);
00077     void minimizationQuenchVelocity(void);
00078 
00079     void reloadCharges();
00080     void rescaleSoluteCharges(BigReal);
00081 
00082     BigReal adaptTempT;         // adaptive tempering temperature
00083     void adaptTempUpdate(int); // adaptive tempering temperature update
00084 
00085     void rescaleVelocities(int);
00086     void rescaleaccelMD(int, int, int); // for accelMD
00087     int rescaleVelocities_numTemps;
00088     void reassignVelocities(BigReal,int);
00089     void reinitVelocities(void);
00090     void rescaleVelocitiesByFactor(BigReal);
00091     void tcoupleVelocities(BigReal,int);
00092 
00098     void stochRescaleVelocities(BigReal,int);
00099 
00100     int stochRescale_count;
00103     void berendsenPressure(int);
00104       int berendsenPressure_count;
00105       int checkpoint_berendsenPressure_count;
00106     void langevinPiston(int);
00107       int slowFreq;
00108     void newtonianVelocities(BigReal, const BigReal, const BigReal, 
00109                              const BigReal, const int, const int, const int);
00110     void langevinVelocities(BigReal);
00111     void langevinVelocitiesBBK1(BigReal);
00112     void langevinVelocitiesBBK2(BigReal);
00113     // Multigrator
00114     void scalePositionsVelocities(const Tensor& posScale, const Tensor& velScale);
00115     void multigratorPressure(int step, int callNumber);
00116     void scaleVelocities(const BigReal velScale);
00117     BigReal calcKineticEnergy();
00118     void multigratorTemperature(int step, int callNumber);
00119     SubmitReduction *multigratorReduction;
00120     int doKineticEnergy;
00121     int doMomenta;
00122     // End of Multigrator
00123     
00124     void cycleBarrier(int,int);
00125         void traceBarrier(int);
00126 #ifdef MEASURE_NAMD_WITH_PAPI
00127         void papiMeasureBarrier(int);
00128 #endif
00129     void terminate(void);
00130 
00131     Random *random;
00132     SimParameters *const simParams;     // for convenience
00133     HomePatch *const patch;             // access methods in patch
00134     SubmitReduction *reduction;
00135     SubmitReduction *pressureProfileReduction;
00136 
00137     CollectionMgr *const collection;
00138     ControllerBroadcasts * broadcast;
00139 
00140     int ldbSteps;
00141     void rebalanceLoad(int timestep);
00142 
00143 
00144 private:
00145     CthThread thread;
00146     unsigned int priority;
00147     static void threadRun(Sequencer*);
00148 
00149     LdbCoordinator *ldbCoordinator;
00150 };
00151 
00152 #endif

Generated on Fri May 25 01:17:14 2018 for NAMD by  doxygen 1.4.7