Gromacs
2024.4
|
#include <gromacs/mdlib/settle_gpu.h>
Class with interfaces and data for GPU version of SETTLE.
Public Member Functions | |
SettleGpu (const gmx_mtop_t &mtop, const DeviceContext &deviceContext, const DeviceStream &deviceStream) | |
Create SETTLE object. More... | |
void | apply (const DeviceBuffer< Float3 > &d_x, DeviceBuffer< Float3 > d_xp, bool updateVelocities, DeviceBuffer< Float3 > d_v, real invdt, bool computeVirial, tensor virialScaled, const PbcAiuc &pbcAiuc) |
Apply SETTLE. More... | |
void | set (const InteractionDefinitions &idef) |
Update data-structures (e.g. after NB search step). More... | |
gmx::SettleGpu::SettleGpu | ( | const gmx_mtop_t & | mtop, |
const DeviceContext & | deviceContext, | ||
const DeviceStream & | deviceStream | ||
) |
Create SETTLE object.
Extracts masses for oxygen and hydrogen as well as the O-H and H-H target distances from the topology data (mtop), check their values for consistency and calls the following constructor.
[in] | mtop | Topology of the system to gen the masses for O and H atoms and target O-H and H-H distances. These values are also checked for consistency. |
[in] | deviceContext | Device context (dummy in CUDA). |
[in] | deviceStream | Device stream to use. |
void gmx::SettleGpu::apply | ( | const DeviceBuffer< Float3 > & | d_x, |
DeviceBuffer< Float3 > | d_xp, | ||
bool | updateVelocities, | ||
DeviceBuffer< Float3 > | d_v, | ||
real | invdt, | ||
bool | computeVirial, | ||
tensor | virialScaled, | ||
const PbcAiuc & | pbcAiuc | ||
) |
Apply SETTLE.
Applies SETTLE to coordinates and velocities, stored on GPU. Data at pointers d_xp and d_v change in the GPU memory. The results are not automatically copied back to the CPU memory. Method uses this class data structures which should be updated when needed using update method.
[in] | d_x | Coordinates before timestep (in GPU memory) |
[in,out] | d_xp | Coordinates after timestep (in GPU memory). The resulting constrained coordinates will be saved here. |
[in] | updateVelocities | If the velocities should be updated. |
[in,out] | d_v | Velocities to update (in GPU memory, can be nullptr if not updated) |
[in] | invdt | Reciprocal timestep (to scale Lagrange multipliers when velocities are updated) |
[in] | computeVirial | If virial should be updated. |
[in,out] | virialScaled | Scaled virial tensor to be updated. |
[in] | pbcAiuc | PBC data. |
void gmx::SettleGpu::set | ( | const InteractionDefinitions & | idef | ) |
Update data-structures (e.g. after NB search step).
Updates the constraints data and copies it to the GPU. Should be called if the particles were sorted, redistributed between domains, etc. Does not recycle the data preparation routines from the CPU version. All three atoms from single water molecule should be handled by the same GPU.
SETTLEs atom ID's is taken from idef.il[F_SETTLE].iatoms.
[in] | idef | System topology |