Gromacs  2020.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions
gmx::UpdateConstrainCuda::Impl Class Reference

#include <gromacs/mdlib/update_constrain_cuda_impl.h>

Description

Class with interfaces and data for CUDA version of Update-Constraint.

Public Member Functions

 Impl (const t_inputrec &ir, const gmx_mtop_t &mtop, const void *commandStream, GpuEventSynchronizer *xUpdatedOnDevice)
 Create Update-Constrain object. More...
 
void integrate (GpuEventSynchronizer *fReadyOnDevice, real dt, bool updateVelocities, bool computeVirial, tensor virial, bool doTemperatureScaling, gmx::ArrayRef< const t_grp_tcstat > tcstat, bool doParrinelloRahman, float dtPressureCouple, const matrix prVelocityScalingMatrix)
 Integrate. More...
 
void scaleCoordinates (const matrix scalingMatrix)
 Scale coordinates on the GPU for the pressure coupling. More...
 
void set (DeviceBuffer< float > d_x, DeviceBuffer< float > d_v, const DeviceBuffer< float > d_f, const t_idef &idef, const t_mdatoms &md, const int numTempScaleValues)
 Set the pointers and update data-structures (e.g. after NB search step). More...
 
void setPbc (const t_pbc *pbc)
 Update PBC data. More...
 
GpuEventSynchronizergetCoordinatesReadySync ()
 Return the synchronizer associated with the event indicated that the coordinates are ready on the device.
 

Static Public Member Functions

static bool isNumCoupledConstraintsSupported (const gmx_mtop_t &mtop)
 Returns whether the maximum number of coupled constraints is supported by the CUDA LINCS code. More...
 

Constructor & Destructor Documentation

gmx::UpdateConstrainCuda::Impl::Impl ( const t_inputrec &  ir,
const gmx_mtop_t &  mtop,
const void *  commandStream,
GpuEventSynchronizer xUpdatedOnDevice 
)

Create Update-Constrain object.

The constructor is given a non-nullptr commandStream, in which all the update and constrain routines are executed. xUpdatedOnDevice should mark the completion of all kernels that modify coordinates. The event is maintained outside this class and also passed to all (if any) consumers of the updated coordinates. The xUpdatedOnDevice also can not be a nullptr because the markEvent(...) method is called unconditionally.

Parameters
[in]irInput record data: LINCS takes number of iterations and order of projection from it.
[in]mtopTopology of the system: SETTLE gets the masses for O and H atoms and target O-H and H-H distances from this object.
[in]commandStreamGPU stream to use. Can be nullptr.
[in]xUpdatedOnDeviceThe event synchronizer to use to mark that update is done on the GPU.

Member Function Documentation

void gmx::UpdateConstrainCuda::Impl::integrate ( GpuEventSynchronizer fReadyOnDevice,
real  dt,
bool  updateVelocities,
bool  computeVirial,
tensor  virial,
bool  doTemperatureScaling,
gmx::ArrayRef< const t_grp_tcstat >  tcstat,
bool  doParrinelloRahman,
float  dtPressureCouple,
const matrix  prVelocityScalingMatrix 
)

Integrate.

Integrates the equation of motion using Leap-Frog algorithm and applies LINCS and SETTLE constraints. If computeVirial is true, constraints virial is written at the provided pointer. doTempCouple should be true if:

  1. The temperature coupling is enabled.
  2. This is the temperature coupling step. Parameters virial/lambdas can be nullptr if computeVirial/doTempCouple are false.
Parameters
[in]fReadyOnDeviceEvent synchronizer indicating that the forces are ready in the device memory.
[in]dtTimestep.
[in]updateVelocitiesIf the velocities should be constrained.
[in]computeVirialIf virial should be updated.
[out]virialPlace to save virial tensor.
[in]doTemperatureScalingIf velocities should be scaled for temperature coupling.
[in]tcstatTemperature coupling data.
[in]doParrinelloRahmanIf current step is a Parrinello-Rahman pressure coupling step.
[in]dtPressureCouplePeriod between pressure coupling steps.
[in]prVelocityScalingMatrixParrinello-Rahman velocity scaling matrix.
static bool gmx::UpdateConstrainCuda::Impl::isNumCoupledConstraintsSupported ( const gmx_mtop_t &  mtop)
static

Returns whether the maximum number of coupled constraints is supported by the CUDA LINCS code.

Parameters
[in]mtopThe molecular topology
void gmx::UpdateConstrainCuda::Impl::scaleCoordinates ( const matrix  scalingMatrix)

Scale coordinates on the GPU for the pressure coupling.

After pressure coupling step, the box size may change. Hence, the coordinates should be scaled so that all the particles fit in the new box.

Parameters
[in]scalingMatrixCoordinates scaling matrix.
void gmx::UpdateConstrainCuda::Impl::set ( DeviceBuffer< float >  d_x,
DeviceBuffer< float >  d_v,
const DeviceBuffer< float >  d_f,
const t_idef &  idef,
const t_mdatoms md,
const int  numTempScaleValues 
)

Set the pointers and update data-structures (e.g. after NB search step).

Parameters
[in,out]d_xDevice buffer with coordinates.
[in,out]d_vDevice buffer with velocities.
[in]d_fDevice buffer with forces.
[in]idefSystem topology
[in]mdAtoms data.
[in]numTempScaleValuesNumber of temperature scaling groups. Set zero for no temperature coupling.
void gmx::UpdateConstrainCuda::Impl::setPbc ( const t_pbc pbc)

Update PBC data.

Converts PBC data from t_pbc into the PbcAiuc format and stores the latter.

Parameters
[in]pbcThe PBC data in t_pbc format.

The documentation for this class was generated from the following file: