Gromacs  2021.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
nonbonded_verlet_t Struct Reference

#include <gromacs/nbnxm/nbnxm.h>

+ Collaboration diagram for nonbonded_verlet_t:

Description

Top-level non-bonded data structure for the Verlet-type cut-off scheme.

Public Member Functions

 nonbonded_verlet_t (std::unique_ptr< PairlistSets > pairlistSets, std::unique_ptr< PairSearch > pairSearch, std::unique_ptr< nbnxn_atomdata_t > nbat, const Nbnxm::KernelSetup &kernelSetup, NbnxmGpu *gpu_nbv, gmx_wallcycle *wcycle)
 Constructs an object from its components.
 
bool useGpu () const
 Returns whether a GPU is use for the non-bonded calculations.
 
bool emulateGpu () const
 Returns whether a GPU is emulated for the non-bonded calculations.
 
bool pairlistIsSimple () const
 Return whether the pairlist is of simple, CPU type.
 
void initPairlistSets (bool haveMultipleDomains)
 Initialize the pair list sets, TODO this should be private.
 
gmx::ArrayRef< const int > getLocalAtomOrder () const
 Returns the order of the local atoms on the grid.
 
void setLocalAtomOrder ()
 Sets the order of the local atoms to the order grid atom ordering.
 
gmx::ArrayRef< const int > getGridIndices () const
 Returns the index position of the atoms on the search grid.
 
void constructPairlist (gmx::InteractionLocality iLocality, const gmx::ListOfLists< int > &exclusions, int64_t step, t_nrnb *nrnb)
 Constructs the pairlist for the given locality. More...
 
void setAtomProperties (gmx::ArrayRef< const int > atomTypes, gmx::ArrayRef< const real > atomCharges, gmx::ArrayRef< const int > atomInfo)
 Updates all the atom properties in Nbnxm.
 
void convertCoordinates (gmx::AtomLocality locality, bool fillLocal, gmx::ArrayRef< const gmx::RVec > coordinates)
 Convert the coordinates to NBNXM format for the given locality. More...
 
void convertCoordinatesGpu (gmx::AtomLocality locality, bool fillLocal, DeviceBuffer< gmx::RVec > d_x, GpuEventSynchronizer *xReadyOnDevice)
 Convert the coordinates to NBNXM format on the GPU for the given locality. More...
 
void atomdata_init_copy_x_to_nbat_x_gpu ()
 Init for GPU version of setup coordinates in Nbnxm.
 
void insertNonlocalGpuDependency (gmx::InteractionLocality interactionLocality)
 Sync the nonlocal GPU stream with dependent tasks in the local queue.
 
const PairlistSetspairlistSets () const
 Returns a reference to the pairlist sets.
 
bool isDynamicPruningStepCpu (int64_t step) const
 Returns whether step is a dynamic list pruning step, for CPU lists.
 
bool isDynamicPruningStepGpu (int64_t step) const
 Returns whether step is a dynamic list pruning step, for GPU lists.
 
void dispatchPruneKernelCpu (gmx::InteractionLocality iLocality, const rvec *shift_vec)
 Dispatches the dynamic pruning kernel for the given locality, for CPU lists.
 
void dispatchPruneKernelGpu (int64_t step)
 Dispatches the dynamic pruning kernel for GPU lists.
 
void dispatchNonbondedKernel (gmx::InteractionLocality iLocality, const interaction_const_t &ic, const gmx::StepWorkload &stepWork, int clearF, const t_forcerec &fr, gmx_enerdata_t *enerd, t_nrnb *nrnb)
 Executes the non-bonded kernel of the GPU or launches it on the GPU.
 
void dispatchFreeEnergyKernel (gmx::InteractionLocality iLocality, const t_forcerec *fr, rvec x[], gmx::ForceWithShiftForces *forceWithShiftForces, const t_mdatoms &mdatoms, t_lambda *fepvals, gmx::ArrayRef< const real > lambda, gmx_enerdata_t *enerd, const gmx::StepWorkload &stepWork, t_nrnb *nrnb)
 Executes the non-bonded free-energy kernel, always runs on the CPU.
 
void atomdata_add_nbat_f_to_f (gmx::AtomLocality locality, gmx::ArrayRef< gmx::RVec > force)
 Add the forces stored in nbat to f, zeros the forces in nbat. More...
 
void atomdata_add_nbat_f_to_f_gpu (gmx::AtomLocality locality, DeviceBuffer< gmx::RVec > totalForcesDevice, void *forcesPmeDevice, gmx::ArrayRef< GpuEventSynchronizer *const > dependencyList, bool useGpuFPmeReduction, bool accumulateForce)
 Add the forces stored in nbat to total force using GPU buffer opse. More...
 
int getNumAtoms (gmx::AtomLocality locality)
 Get the number of atoms for a given locality. More...
 
void * getGpuForces ()
 Get the pointer to the GPU nonbonded force buffer. More...
 
const Nbnxm::KernelSetup & kernelSetup () const
 Return the kernel setup.
 
real pairlistInnerRadius () const
 Returns the outer radius for the pair list.
 
real pairlistOuterRadius () const
 Returns the outer radius for the pair list.
 
void changePairlistRadii (real rlistOuter, real rlistInner)
 Changes the pair-list outer and inner radius.
 
void setupGpuShortRangeWork (const gmx::GpuBonded *gpuBonded, gmx::InteractionLocality iLocality)
 Set up internal flags that indicate what type of short-range work there is.
 

Public Attributes

std::unique_ptr< PairlistSetspairlistSets_
 All data related to the pair lists.
 
std::unique_ptr< PairSearchpairSearch_
 Working data for constructing the pairlists.
 
std::unique_ptr< nbnxn_atomdata_tnbat
 Atom data.
 
NbnxmGpugpu_nbv
 GPU Nbnxm data, only used with a physical GPU (TODO: use unique_ptr)
 

Member Function Documentation

void nonbonded_verlet_t::atomdata_add_nbat_f_to_f ( gmx::AtomLocality  locality,
gmx::ArrayRef< gmx::RVec force 
)

Add the forces stored in nbat to f, zeros the forces in nbat.

Parameters
[in]localityLocal or non-local
[in,out]forceForce to be added to
void nonbonded_verlet_t::atomdata_add_nbat_f_to_f_gpu ( gmx::AtomLocality  locality,
DeviceBuffer< gmx::RVec totalForcesDevice,
void *  forcesPmeDevice,
gmx::ArrayRef< GpuEventSynchronizer *const >  dependencyList,
bool  useGpuFPmeReduction,
bool  accumulateForce 
)

Add the forces stored in nbat to total force using GPU buffer opse.

Parameters
[in]localityLocal or non-local
[in,out]totalForcesDeviceForce to be added to
[in]forcesPmeDeviceDevice buffer with PME forces
[in]dependencyListList of synchronizers that represent the dependencies the reduction task needs to sync on.
[in]useGpuFPmeReductionWhether PME forces should be added
[in]accumulateForceIf the total force buffer already contains data
void nonbonded_verlet_t::constructPairlist ( gmx::InteractionLocality  iLocality,
const gmx::ListOfLists< int > &  exclusions,
int64_t  step,
t_nrnb *  nrnb 
)

Constructs the pairlist for the given locality.

When there are no non-self exclusions, exclusions can be empty. Otherwise the number of lists in exclusions should match the number of atoms when not using DD, or the total number of atoms in the i-zones when using DD.

Parameters
[in]iLocalityThe interaction locality: local or non-local
[in]exclusionsLists of exclusions for every atom.
[in]stepUsed to set the list creation step
[in,out]nrnbFlop accounting struct, can be nullptr
void nonbonded_verlet_t::convertCoordinates ( gmx::AtomLocality  locality,
bool  fillLocal,
gmx::ArrayRef< const gmx::RVec coordinates 
)

Convert the coordinates to NBNXM format for the given locality.

The API function for the transformation of the coordinates from one layout to another.

Parameters
[in]localityWhether coordinates for local or non-local atoms should be transformed.
[in]fillLocalIf the coordinates for filler particles should be zeroed.
[in]coordinatesCoordinates in plain rvec format to be transformed.
void nonbonded_verlet_t::convertCoordinatesGpu ( gmx::AtomLocality  locality,
bool  fillLocal,
DeviceBuffer< gmx::RVec d_x,
GpuEventSynchronizer *  xReadyOnDevice 
)

Convert the coordinates to NBNXM format on the GPU for the given locality.

The API function for the transformation of the coordinates from one layout to another in the GPU memory.

Parameters
[in]localityWhether coordinates for local or non-local atoms should be transformed.
[in]fillLocalIf the coordinates for filler particles should be zeroed.
[in]d_xGPU coordinates buffer in plain rvec format to be transformed.
[in]xReadyOnDeviceEvent synchronizer indicating that the coordinates are ready in the device memory.
void* nonbonded_verlet_t::getGpuForces ( )

Get the pointer to the GPU nonbonded force buffer.

Returns
A pointer to the force buffer in GPU memory
int nonbonded_verlet_t::getNumAtoms ( gmx::AtomLocality  locality)

Get the number of atoms for a given locality.

Parameters
[in]localityLocal or non-local
Returns
The number of atoms for given locality

The documentation for this struct was generated from the following files: