Gromacs
2020-beta1
|
The modular simulator improves extensibility, adds Monte Carlo capabilities, promotes data locality and communication via interfaces, supports multi-stepping integrators, and paves the way for some task parallelism.
For more information, see page_modularsimulator
docs/doxygen/lib/modularsimulator.md
?Typedefs | |
typedef std::function< void()> | gmx::CheckBondedInteractionsCallback |
The function type allowing to request a check of the number of bonded interactions. | |
typedef std::unique_ptr < CheckBondedInteractionsCallback > | gmx::CheckBondedInteractionsCallbackPtr |
Pointer to the function type allowing to request a check of the number of bonded interactions. | |
using | gmx::Step = int64_t |
Step number. | |
using | gmx::Time = double |
Simulation time. | |
typedef std::function< void()> | gmx::SimulatorRunFunction |
The function type that can be scheduled to be run during the simulator run. | |
typedef std::unique_ptr < SimulatorRunFunction > | gmx::SimulatorRunFunctionPtr |
Pointer to the function type that can be scheduled to be run during the simulator run. | |
typedef std::function< void(SimulatorRunFunctionPtr)> | gmx::RegisterRunFunction |
The function type that allows to register run functions. | |
typedef std::unique_ptr < RegisterRunFunction > | gmx::RegisterRunFunctionPtr |
Pointer to the function type that allows to register run functions. | |
typedef std::function< void(Step, Time)> | gmx::SignallerCallback |
The function type that can be registered to signallers for callback. | |
typedef std::unique_ptr < SignallerCallback > | gmx::SignallerCallbackPtr |
Pointer to the function type that can be registered to signallers for callback. | |
typedef std::function< void(gmx_mdoutf *, Step, Time)> | gmx::ITrajectoryWriterCallback |
Function type for trajectory writing clients. More... | |
typedef std::unique_ptr < ITrajectoryWriterCallback > | gmx::ITrajectoryWriterCallbackPtr |
Pointer to the function type for trajectory writing clients. | |
typedef std::function< void(Step)> | gmx::PropagatorCallback |
Generic callback to the propagator. | |
typedef std::unique_ptr < PropagatorCallback > | gmx::PropagatorCallbackPtr |
Pointer to generic callback to the propagator. | |
typedef INeighborSearchSignallerClient | gmx::NeighborSearchSignaller::Client |
Define client type. | |
typedef ILastStepSignallerClient | gmx::LastStepSignaller::Client |
Define client type. | |
typedef ILoggingSignallerClient | gmx::LoggingSignaller::Client |
Define client type. | |
typedef IEnergySignallerClient | gmx::EnergySignaller::Client |
Define client type. | |
Enumerations | |
enum | gmx::ComputeGlobalsAlgorithm { LeapFrog, VelocityVerletAtFullTimeStep, VelocityVerletAfterCoordinateUpdate } |
The different global reduction schemes we know about. | |
enum | gmx::EnergySignallerEvent { energyCalculationStep, virialCalculationStep, freeEnergyCalculationStep } |
The energy events signalled by the EnergySignaller. | |
enum | gmx::TrajectoryEvent { stateWritingStep, energyWritingStep } |
The trajectory writing events. | |
enum | gmx::IntegrationStep { PositionsOnly, VelocitiesOnly, LeapFrog, VelocityVerletPositionsAndVelocities, Count } |
The different integration types we know about. More... | |
enum | gmx::NumVelocityScalingValues { gmx::NumVelocityScalingValues::None, gmx::NumVelocityScalingValues::Single, gmx::NumVelocityScalingValues::Multiple, Count } |
Sets the number of different velocity scaling values. More... | |
enum | gmx::ParrinelloRahmanVelocityScaling { gmx::ParrinelloRahmanVelocityScaling::No, gmx::ParrinelloRahmanVelocityScaling::Diagonal, gmx::ParrinelloRahmanVelocityScaling::Full, Count } |
Sets the type of Parrinello-Rahman pressure scaling. More... | |
Functions | |
gmx::EnergyElement::EnergyElement (StatePropagatorData *statePropagatorData, FreeEnergyPerturbationElement *freeEnergyPerturbationElement, const gmx_mtop_t *globalTopology, const t_inputrec *inputrec, const MDAtoms *mdAtoms, gmx_enerdata_t *enerd, gmx_ekindata_t *ekind, const Constraints *constr, FILE *fplog, t_fcdata *fcd, const MdModulesNotifier &mdModulesNotifier, bool isMaster, ObservablesHistory *observablesHistory, StartingBehavior startingBehavior) | |
Constructor. | |
void | gmx::EnergyElement::scheduleTask (Step step, Time time, const RegisterRunFunctionPtr ®isterRunFunction) override |
Register run function for step / time. More... | |
void | gmx::EnergyElement::elementSetup () override |
No element setup needed. | |
void | gmx::EnergyElement::elementTeardown () override |
Final output. More... | |
void | gmx::EnergyElement::addToForceVirial (const tensor virial, Step step) |
Add contribution to force virial. More... | |
void | gmx::EnergyElement::addToConstraintVirial (const tensor virial, Step step) |
Add contribution to constraint virial. More... | |
rvec * | gmx::EnergyElement::forceVirial (Step step) |
Get pointer to force virial tensor. More... | |
rvec * | gmx::EnergyElement::constraintVirial (Step step) |
Get pointer to constraint virial tensor. More... | |
rvec * | gmx::EnergyElement::totalVirial (Step step) |
Get pointer to total virial tensor. More... | |
rvec * | gmx::EnergyElement::pressure (Step step) |
Get pointer to pressure tensor. More... | |
real * | gmx::EnergyElement::muTot () |
Get pointer to mu_tot. More... | |
gmx_enerdata_t * | gmx::EnergyElement::enerdata () |
Get pointer to energy structure. More... | |
gmx_ekindata_t * | gmx::EnergyElement::ekindata () |
Get pointer to kinetic energy structure. More... | |
bool * | gmx::EnergyElement::needToSumEkinhOld () |
Get pointer to needToSumEkinhOld. More... | |
void | gmx::EnergyElement::setVRescaleThermostat (const VRescaleThermostat *vRescaleThermostat) |
set vrescale thermostat More... | |
void | gmx::EnergyElement::setParrinelloRahamnBarostat (const ParrinelloRahmanBarostat *parrinelloRahmanBarostat) |
set Parrinello-Rahman barostat More... | |
static void | gmx::EnergyElement::initializeEnergyHistory (StartingBehavior startingBehavior, ObservablesHistory *observablesHistory, EnergyOutput *energyOutput) |
Initialize energy history. More... | |
virtual void | gmx::ISimulatorElement::scheduleTask (Step, Time, const RegisterRunFunctionPtr &)=0 |
Query whether element wants to run at step / time. More... | |
virtual void | gmx::ISimulatorElement::elementSetup ()=0 |
Method guaranteed to be called after construction, before simulator run. | |
virtual void | gmx::ISimulatorElement::elementTeardown ()=0 |
Method guaranteed to be called after simulator run, before deconstruction. | |
virtual | gmx::ISimulatorElement::~ISimulatorElement ()=default |
Standard virtual destructor. | |
virtual void | gmx::ISignaller::signal (Step, Time)=0 |
Function run before every step of scheduling. | |
virtual void | gmx::ISignaller::signallerSetup ()=0 |
Method guaranteed to be called after construction, before simulator run. | |
virtual | gmx::ISignaller::~ISignaller ()=default |
Standard virtual destructor. | |
virtual | gmx::INeighborSearchSignallerClient::~INeighborSearchSignallerClient ()=default |
Standard virtual destructor. | |
virtual SignallerCallbackPtr | gmx::INeighborSearchSignallerClient::registerNSCallback ()=0 |
Return callback to NeighborSearchSignaller. | |
virtual | gmx::ILastStepSignallerClient::~ILastStepSignallerClient ()=default |
Standard virtual destructor. | |
virtual SignallerCallbackPtr | gmx::ILastStepSignallerClient::registerLastStepCallback ()=0 |
Return callback to LastStepSignaller. | |
virtual | gmx::ILoggingSignallerClient::~ILoggingSignallerClient ()=default |
Standard virtual destructor. | |
virtual SignallerCallbackPtr | gmx::ILoggingSignallerClient::registerLoggingCallback ()=0 |
Return callback to LoggingSignaller. | |
virtual | gmx::IEnergySignallerClient::~IEnergySignallerClient ()=default |
Standard virtual destructor. | |
virtual SignallerCallbackPtr | gmx::IEnergySignallerClient::registerEnergyCallback (EnergySignallerEvent)=0 |
Return callback to EnergySignaller. | |
virtual | gmx::ITrajectorySignallerClient::~ITrajectorySignallerClient ()=default |
Standard virtual destructor. | |
virtual SignallerCallbackPtr | gmx::ITrajectorySignallerClient::registerTrajectorySignallerCallback (TrajectoryEvent)=0 |
Return callback to TrajectoryElement. | |
virtual | gmx::ITrajectoryWriterClient::~ITrajectoryWriterClient ()=default |
Standard virtual destructor. | |
virtual void | gmx::ITrajectoryWriterClient::trajectoryWriterSetup (gmx_mdoutf *outf)=0 |
Setup method with valid output pointer. | |
virtual void | gmx::ITrajectoryWriterClient::trajectoryWriterTeardown (gmx_mdoutf *outf)=0 |
Teardown method with valid output pointer. | |
virtual ITrajectoryWriterCallbackPtr | gmx::ITrajectoryWriterClient::registerTrajectoryWriterCallback (TrajectoryEvent)=0 |
Return callback to TrajectoryElement. | |
virtual | gmx::ITopologyHolderClient::~ITopologyHolderClient ()=default |
Standard virtual destructor. | |
virtual void | gmx::ITopologyHolderClient::setTopology (const gmx_localtop_t *)=0 |
Pass pointer to new local topology. | |
virtual | gmx::ICheckpointHelperClient::~ICheckpointHelperClient ()=default |
Standard virtual destructor. | |
virtual void | gmx::ICheckpointHelperClient::writeCheckpoint (t_state *localState, t_state *globalState)=0 |
Write checkpoint. | |
void | gmx::SignallerBuilder< Signaller >::registerSignallerClient (compat::not_null< typename Signaller::Client * > client) |
Allows clients to register to the signaller. More... | |
template<typename... Args> | |
std::unique_ptr< Signaller > | gmx::SignallerBuilder< Signaller >::build (Args &&...args) |
Build the signaller. More... | |
void | gmx::NeighborSearchSignaller::signal (Step step, Time time) override |
Run the signaller at a specific step / time. More... | |
void | gmx::NeighborSearchSignaller::signallerSetup () override |
Do nothing at setup time. | |
void | gmx::LastStepSignaller::signal (Step step, Time time) override |
Run the signaller at a specific step / time. More... | |
void | gmx::LastStepSignaller::signallerSetup () override |
Check that necessary registration was done. | |
void | gmx::LoggingSignaller::signal (Step step, Time time) override |
Run the signaller at a specific step / time. More... | |
void | gmx::LoggingSignaller::signallerSetup () override |
Check that necessary registration was done. | |
void | gmx::EnergySignaller::signal (Step step, Time time) override |
Run the signaller at a specific step / time. More... | |
void | gmx::EnergySignaller::signallerSetup () override |
Check that necessary registration was done. | |
gmx::StatePropagatorData::StatePropagatorData (int numAtoms, FILE *fplog, const t_commrec *cr, t_state *globalState, int nstxout, int nstvout, int nstfout, int nstxout_compressed, bool useGPU, FreeEnergyPerturbationElement *freeEnergyPerturbationElement, const t_inputrec *inputrec, const t_mdatoms *mdatoms) | |
Constructor. | |
ArrayRefWithPadding< RVec > | gmx::StatePropagatorData::positionsView () |
Get write access to position vector. | |
ArrayRefWithPadding< const RVec > | gmx::StatePropagatorData::constPositionsView () const |
Get read access to position vector. | |
ArrayRefWithPadding< RVec > | gmx::StatePropagatorData::previousPositionsView () |
Get write access to previous position vector. | |
ArrayRefWithPadding< const RVec > | gmx::StatePropagatorData::constPreviousPositionsView () const |
Get read access to previous position vector. | |
ArrayRefWithPadding< RVec > | gmx::StatePropagatorData::velocitiesView () |
Get write access to velocity vector. | |
ArrayRefWithPadding< const RVec > | gmx::StatePropagatorData::constVelocitiesView () const |
Get read access to velocity vector. | |
ArrayRefWithPadding< RVec > | gmx::StatePropagatorData::forcesView () |
Get write access to force vector. | |
ArrayRefWithPadding< const RVec > | gmx::StatePropagatorData::constForcesView () const |
Get read access to force vector. | |
rvec * | gmx::StatePropagatorData::box () |
Get pointer to box. | |
const rvec * | gmx::StatePropagatorData::constBox () |
Get const pointer to box. | |
rvec * | gmx::StatePropagatorData::previousBox () |
Get pointer to previous box. | |
const rvec * | gmx::StatePropagatorData::constPreviousBox () |
Get const pointer to previous box. | |
int | gmx::StatePropagatorData::localNumAtoms () |
Get the local number of atoms. | |
void | gmx::StatePropagatorData::scheduleTask (Step step, Time time, const RegisterRunFunctionPtr ®isterRunFunction) override |
Register run function for step / time. More... | |
void | gmx::StatePropagatorData::elementSetup () override |
Backup starting velocities. More... | |
void | gmx::StatePropagatorData::elementTeardown () override |
No element teardown needed. | |
gmx::TopologyHolder::TopologyHolder (const gmx_mtop_t &globalTopology, const t_commrec *cr, const t_inputrec *inputrec, t_forcerec *fr, MDAtoms *mdAtoms, Constraints *constr, gmx_vsite_t *vsite) | |
Constructor. | |
const gmx_mtop_t & | gmx::TopologyHolder::globalTopology () const |
Get global topology. | |
void | gmx::TopologyHolder::registerClient (ITopologyHolderClient *client) |
Register topology client. | |
void | gmx::TrajectoryElement::signallerSetup () override |
Prepare signaller. More... | |
void | gmx::TrajectoryElement::signal (Step step, Time time) override |
Run the signaller at a specific step / time. More... | |
void | gmx::TrajectoryElement::elementSetup () override |
Prepare trajectory writer. More... | |
void | gmx::TrajectoryElement::scheduleTask (Step step, Time time, const RegisterRunFunctionPtr ®isterRunFunction) override |
Register run function for step / time. More... | |
void | gmx::TrajectoryElement::elementTeardown () override |
Teardown trajectory writer. More... | |
void | gmx::TrajectoryElementBuilder::registerSignallerClient (compat::not_null< ITrajectorySignallerClient * > client) |
Allows clients to register to the signaller. | |
void | gmx::TrajectoryElementBuilder::registerWriterClient (compat::not_null< ITrajectoryWriterClient * > client) |
Allows clients to register as trajectory writers. | |
template<typename... Args> | |
std::unique_ptr < TrajectoryElement > | gmx::TrajectoryElementBuilder::build (Args &&...args) |
Build the TrajectoryElement. More... | |
Function type for trajectory writing clients.
Trajectory writing clients are given a pointer to the output file handler, allowing them to write their own trajectory contribution
|
strong |
The different integration types we know about.
PositionsOnly: Moves the position vector by the given time step VelocitiesOnly: Moves the velocity vector by the given time step LeapFrog: Is a manual fusion of the previous two propagators VelocityVerletPositionsAndVelocities: Is a manual fusion of VelocitiesOnly and PositionsOnly, where VelocitiesOnly is only propagated by half the time step of the positions.
|
strong |
|
strong |
void gmx::EnergyElement::addToConstraintVirial | ( | const tensor | virial, |
Step | step | ||
) |
Add contribution to constraint virial.
This automatically resets the tensor if the step is higher than the current step, starting the tensor calculation for a new step at zero. Otherwise, it adds the new contribution to the existing virial.
void gmx::EnergyElement::addToForceVirial | ( | const tensor | virial, |
Step | step | ||
) |
Add contribution to force virial.
This automatically resets the tensor if the step is higher than the current step, starting the tensor calculation for a new step at zero. Otherwise, it adds the new contribution to the existing virial.
std::unique_ptr< Signaller > gmx::SignallerBuilder< Signaller >::build | ( | Args &&... | args | ) |
Build the signaller.
General version - for NeighborSearchSignaller, LastStepSignaller, LoggingSignaller
std::unique_ptr< TrajectoryElement > gmx::TrajectoryElementBuilder::build | ( | Args &&... | args | ) |
Build the TrajectoryElement.
/}
rvec * gmx::EnergyElement::constraintVirial | ( | Step | step | ) |
Get pointer to constraint virial tensor.
Allows access to the raw pointer to the tensor.
gmx_ekindata_t * gmx::EnergyElement::ekindata | ( | ) |
Get pointer to kinetic energy structure.
|
override |
Prepare trajectory writer.
During setup, the trajectory writer will query the writer clients for their callbacks. It will also call the setup methods of the different clients. To be run before the main simulator run, but after all clients were registered.
|
override |
Backup starting velocities.
This is only needed for vv, where the first (velocity) half step is only used to compute the constraint virial, but the velocities need to be reset after. TODO: There must be a more elegant solution to this!
|
override |
Teardown trajectory writer.
During teardown, the trajectory writer will call the teardown methods of the clients and perform some additional clean-up. To be run after the main simulator run.
|
override |
Final output.
Prints the averages to log.
gmx_enerdata_t * gmx::EnergyElement::enerdata | ( | ) |
Get pointer to energy structure.
rvec * gmx::EnergyElement::forceVirial | ( | Step | step | ) |
Get pointer to force virial tensor.
Allows access to the raw pointer to the tensor.
|
static |
Initialize energy history.
Kept as a static function to allow usage from legacy code
real * gmx::EnergyElement::muTot | ( | ) |
Get pointer to mu_tot.
Allows access to the raw pointer to the dipole vector.
bool * gmx::EnergyElement::needToSumEkinhOld | ( | ) |
Get pointer to needToSumEkinhOld.
rvec * gmx::EnergyElement::pressure | ( | Step | step | ) |
Get pointer to pressure tensor.
Allows access to the raw pointer to the tensor.
void gmx::SignallerBuilder< Signaller >::registerSignallerClient | ( | compat::not_null< typename Signaller::Client * > | client | ) |
Allows clients to register to the signaller.
/}
Allows clients to register to the signaller
|
pure virtual |
Query whether element wants to run at step / time.
Element can register one or more functions to be run at that step through the registration pointer.
|
override |
Register run function for step / time.
This needs to be called when the energies are at a full time step. Positioning this element is the responsibility of the programmer.
This is also the place at which the current state becomes the previous state.
step | The step number |
time | The time |
registerRunFunction | Function allowing to register a run function |
|
override |
Register run function for step / time.
Registers a trajectory writing function if the current step / time is either a state or energy writing step, as defined by the signaller
step | The step number |
time | The time |
registerRunFunction | Function allowing to register a run function |
|
override |
Register run function for step / time.
This needs to be called during the integration part of the simulator, at the moment at which the state is at a full time step. Positioning this element is the responsibility of the programmer writing the integration algorithm! If the current step is a trajectory writing step, StatePropagatorData will save a backup for later writeout.
This is also the place at which the current state becomes the previous state.
step | The step number |
time | The time |
registerRunFunction | Function allowing to register a run function |
void gmx::EnergyElement::setParrinelloRahamnBarostat | ( | const ParrinelloRahmanBarostat * | parrinelloRahmanBarostat | ) |
set Parrinello-Rahman barostat
This allows to set a pointer to the Parrinello-Rahman barostat used to print the box velocities. TODO: This should be made obsolete my a more modular energy element
void gmx::EnergyElement::setVRescaleThermostat | ( | const VRescaleThermostat * | vRescaleThermostat | ) |
set vrescale thermostat
This allows to set a pointer to the vrescale thermostat used to print the thermostat integral. TODO: This should be made obsolete my a more modular energy element
Run the signaller at a specific step / time.
Informs clients when energy or state will be written.
step | The current time step |
time | The current time |
Run the signaller at a specific step / time.
Informs callbacks if step % nstlist_ == 0
step | The current time step |
time | The current time |
Run the signaller at a specific step / time.
Informs callbacks if this is the last step
step | The current time step |
time | The current time |
Run the signaller at a specific step / time.
Informs callbacks if step % nstlog_ == 0
step | The current time step |
time | The current time |
Run the signaller at a specific step / time.
Informs callbacks of energy / virial / free energy special steps
step | The current time step |
time | The current time |
|
override |
Prepare signaller.
Check that necessary registration was done
rvec * gmx::EnergyElement::totalVirial | ( | Step | step | ) |
Get pointer to total virial tensor.
Allows access to the raw pointer to the tensor.