2#ifndef STORMM_MM_CONTROLS_H
3#define STORMM_MM_CONTROLS_H
6#include "Accelerator/core_kernel_manager.h"
7#include "Accelerator/gpu_details.h"
8#include "Accelerator/hybrid.h"
9#include "Constants/behavior.h"
10#include "Potential/energy_enumerators.h"
11#include "Potential/cellgrid.h"
12#include "Math/reduction_enumerators.h"
13#include "Namelists/nml_dynamics.h"
14#include "Namelists/nml_minimize.h"
15#include "Potential/energy_enumerators.h"
16#include "Synthesis/atomgraph_synthesis.h"
17#include "Topology/atomgraph_enumerators.h"
22using card::GpuDetails;
23using card::CoreKlManager;
25using card::HybridTargetLevel;
26using constants::PrecisionModel;
27using energy::CellGrid;
28using energy::ClashResponse;
29using energy::EvaluateEnergy;
30using energy::EvaluateForce;
31using energy::NeighborListKind;
32using energy::QMapMethod;
33using energy::TinyBoxPresence;
34using stmath::ReductionStage;
35using namelist::default_dynamics_time_step;
36using namelist::default_electrostatic_cutoff;
37using namelist::default_minimize_dx0;
38using namelist::default_minimize_maxcyc;
39using namelist::default_minimize_ncyc;
40using namelist::default_rattle_tolerance;
41using namelist::default_nt_warp_multiplicity;
42using namelist::default_van_der_waals_cutoff;
43using namelist::DynamicsControls;
44using namelist::MinimizeControls;
45using synthesis::AtomGraphSynthesis;
46using synthesis::VwuGoal;
47using topology::ImplicitSolventModel;
56 MMControlKit(
int step_in,
int sd_cycles_in,
int max_cycles_in, T initial_step_in,
57 int nt_warp_mult_in,
const T elec_cut_in,
const T vdw_cut_in,
int* vwu_progress_in,
58 int* vupt_progress_in,
int* vcns_progress_in,
int* pupt_progress_in,
59 int* gcns_progress_in,
int* nbwu_progress_in,
int* pmewu_progress_in,
60 int* gbrwu_progress_in,
int* gbdwu_progress_in,
int* gtwu_progress_in,
61 int* scwu_progress_in,
int* rdwu_progress_in);
113 int sd_cycles_in = default_minimize_ncyc,
114 int max_cycles_in = default_minimize_maxcyc,
115 int nt_warp_multiplicity_in = default_nt_warp_multiplicity,
116 double electrostatic_cutoff_in = default_electrostatic_cutoff,
117 double van_der_waals_cutoff_in = default_van_der_waals_cutoff);
167 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
175 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
183 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
191 HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
234 EvaluateEnergy eval_nrg, ClashResponse softcore, VwuGoal purpose,
235 PrecisionModel valence_prec, PrecisionModel nonbond_prec,
236 QMapMethod qspread_approach, PrecisionModel acc_prec,
237 size_t image_coord_type,
int qspread_order,
238 NeighborListKind nbgr_config, TinyBoxPresence has_tiny_box,
242 EvaluateEnergy eval_nrg,
const ClashResponse softcore,
243 VwuGoal purpose, PrecisionModel valence_prec,
247 EvaluateEnergy eval_nrg, VwuGoal purpose, PrecisionModel valence_prec,
251 EvaluateEnergy eval_nrg, VwuGoal purpose, PrecisionModel general_prec,
267 template <
typename T,
typename Tacc,
typename Tcalc,
typename T4>
271 template <
typename T,
typename Tacc,
typename Tcalc,
typename T4>
296 int nt_warp_multiplicity;
298 double electrostatic_cutoff;
300 double van_der_waals_cutoff;
362 void rebasePointers();
368#include "mm_controls.tpp"
A class to guide the implementation of GPU kernels, with selected thread counts per block and block c...
Definition core_kernel_manager.h:56
Pertinent aspects of one particular GPU. Condensing the data for each GPU in this manner helps to ens...
Definition gpu_details.h:27
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
An object to manage the spatial decomposition of a system of particles. The general strategy is to ar...
Definition cellgrid.h:562
MolecularMechanicsControls(double initial_step_in=default_minimize_dx0, int sd_cycles_in=default_minimize_ncyc, int max_cycles_in=default_minimize_maxcyc, int nt_warp_multiplicity_in=default_nt_warp_multiplicity, double electrostatic_cutoff_in=default_electrostatic_cutoff, double van_der_waals_cutoff_in=default_van_der_waals_cutoff)
The constructor can create an empty object with default parameters for the time step and rattle toler...
Definition mm_controls.cpp:19
void incrementStep()
Increment the step counter, moving the controls to a different progress counter.
Definition mm_controls.cpp:473
int getValenceWorkUnitProgress(int counter_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the value of one of the valence work unit progress counters on the host or the HPC device.
Definition mm_controls.cpp:218
MolecularMechanicsControls & operator=(const MolecularMechanicsControls &other)
The copy assignment operator likewise handles assignment of internal POINTER-kind Hybrid objects.
Definition mm_controls.cpp:100
int getStepNumber() const
Get the current step number.
Definition mm_controls.cpp:188
MMControlKit< double > dpData(HybridTargetLevel tier=HybridTargetLevel::HOST)
Obtain a double-precision abstract for this object.
Definition mm_controls.cpp:299
int getTotalCycles() const
Get the total number of minimization steps, or total MD cycles.
Definition mm_controls.cpp:198
int getSteepestDescentCycles() const
Get the number of steepest descent minimization cycles.
Definition mm_controls.cpp:193
double getElectrostaticCutoff() const
Get the cutoff for non-bonded electrostatic interactions in periodic simulations.
Definition mm_controls.cpp:208
MMControlKit< float > spData(HybridTargetLevel tier=HybridTargetLevel::HOST)
Obtain a single-precision abstract for this object.
Definition mm_controls.cpp:312
int getPmeWorkUnitProgress(int counter_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the value of one of the Particle-Mesh Ewald work unit progress counters on the host or the HPC de...
Definition mm_controls.cpp:250
int getNTWarpMultiplicity() const
Get the neutral-territory warp multiplicity.
int getReductionWorkUnitProgress(int counter_index, ReductionStage process, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the value of one of the reduction work unit progress counters on the host or the HPC device.
Definition mm_controls.cpp:266
double getInitialMinimizationStep() const
Get the initial step for energy minimization.
Definition mm_controls.cpp:203
MolecularMechanicsControls(double initial_step_in=default_minimize_dx0, int sd_cycles_in=default_minimize_ncyc, int max_cycles_in=default_minimize_maxcyc, int nt_warp_multiplicity_in=default_nt_warp_multiplicity, double electrostatic_cutoff_in=default_electrostatic_cutoff, double van_der_waals_cutoff_in=default_van_der_waals_cutoff)
The constructor can create an empty object with default parameters for the time step and rattle toler...
Definition mm_controls.cpp:19
double getVanDerWaalsCutoff() const
Get the cutoff for non-bonded van-der Waals interactions in periodic simulations.
Definition mm_controls.cpp:213
int getNonbondedWorkUnitProgress(int counter_index, HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the value of one of the non-bonded work unit progress counters on the host or the HPC device.
Definition mm_controls.cpp:234
void setNTWarpMultiplicity(const CellGrid< T, Tacc, Tcalc, T4 > *cg_a, const CellGrid< T, Tacc, Tcalc, T4 > *cg_b, const GpuDetails &gpu)
Set the neutral-territory warp multiplicity based on one or two gell grids, for a given GPU.
void primeWorkUnitCounters(const CoreKlManager &launcher, EvaluateForce eval_frc, EvaluateEnergy eval_nrg, ClashResponse softcore, VwuGoal purpose, PrecisionModel valence_prec, PrecisionModel nonbond_prec, QMapMethod qspread_approach, PrecisionModel acc_prec, size_t image_coord_type, int qspread_order, NeighborListKind nbgr_config, TinyBoxPresence has_tiny_box, const AtomGraphSynthesis &poly_ag)
Prime the work unit counters based on a particular GPU configuration.
Definition mm_controls.cpp:325
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
MMControlKit(int step_in, int sd_cycles_in, int max_cycles_in, T initial_step_in, int nt_warp_mult_in, const T elec_cut_in, const T vdw_cut_in, int *vwu_progress_in, int *vupt_progress_in, int *vcns_progress_in, int *pupt_progress_in, int *gcns_progress_in, int *nbwu_progress_in, int *pmewu_progress_in, int *gbrwu_progress_in, int *gbdwu_progress_in, int *gtwu_progress_in, int *scwu_progress_in, int *rdwu_progress_in)
The constructor takes a straight list of values and pointers. The step number is left modifiable so t...
The C-style, always writeable abstract for the MolecularMechanicsControls object. To not be able to m...
Definition mm_controls.h:52
const T vdw_cut_sq
Squared cutoff for van-der Waals interactions.
Definition mm_controls.h:80
int * gcns_progress
Progress counters for standalone positional constraint work units.
Definition mm_controls.h:85
int * scwu_progress
Progress counters for scattering work units.
Definition mm_controls.h:91
const T elec_cut_sq
Squared cutoff for electrostatic interactions.
Definition mm_controls.h:79
MMControlKit(int step_in, int sd_cycles_in, int max_cycles_in, T initial_step_in, int nt_warp_mult_in, const T elec_cut_in, const T vdw_cut_in, int *vwu_progress_in, int *vupt_progress_in, int *vcns_progress_in, int *pupt_progress_in, int *gcns_progress_in, int *nbwu_progress_in, int *pmewu_progress_in, int *gbrwu_progress_in, int *gbdwu_progress_in, int *gtwu_progress_in, int *scwu_progress_in, int *rdwu_progress_in)
The constructor takes a straight list of values and pointers. The step number is left modifiable so t...
int * gbdwu_progress
Progress counters for Generalized Born derivative computations.
Definition mm_controls.h:89
int step
The current simulation step.
Definition mm_controls.h:69
int * rdwu_progress
Progress counters for reduction work units.
Definition mm_controls.h:92
int * vwu_progress
Progress counters for valence work units.
Definition mm_controls.h:81
int * vcns_progress
Progress counters for standalone velocity constraint work units.
Definition mm_controls.h:83
const T initial_step
Initial step size to be taken in energy minimization.
Definition mm_controls.h:72
const T vdw_cut
Definition mm_controls.h:77
int * pupt_progress
Progress counters for standalone coordinate update work units.
Definition mm_controls.h:84
int * gtwu_progress
Progress counters for gathering work units.
Definition mm_controls.h:90
int * vupt_progress
Progress counters for standalone velocity update work units.
Definition mm_controls.h:82
int * pmewu_progress
Progress counters for PME long-ranged work units.
Definition mm_controls.h:87
MMControlKit(const MMControlKit &original)=default
The usual copy and move constructors for an abstract apply here.
int * nbwu_progress
Progress counters for non-bonded work units.
Definition mm_controls.h:86
const T elec_cut
Definition mm_controls.h:75
const int max_cycles
The total number of energy minimization cycles or dynamics steps.
Definition mm_controls.h:71
int * gbrwu_progress
Progress counters for Generalized Born radii computations.
Definition mm_controls.h:88
const int sd_cycles
The number of steepest-descent energy minimization cycles.
Definition mm_controls.h:70
const int nt_warp_mult
Definition mm_controls.h:73