Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Enumerations | Functions | Variables
pmetestcommon.h File Reference
#include <array>
#include <map>
#include <vector>
#include <gtest/gtest.h>
#include "gromacs/ewald/pme.h"
#include "gromacs/ewald/pme_gpu_internal.h"
#include "gromacs/math/gmxcomplex.h"
#include "gromacs/mdtypes/state_propagator_data_gpu.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/unique_cptr.h"
#include "testhardwarecontexts.h"
+ Include dependency graph for pmetestcommon.h:
+ This graph shows which files directly or indirectly include this file:

Description

Describes common routines and types for PME tests.

Author
Aleksei Iupinov a.yup.nosp@m.inov.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Typedefs

typedef gmx::unique_cptr
< gmx_pme_t, gmx_pme_destroy
gmx::test::PmeSafePointer
 A safe pointer type for PME.
 
typedef ArrayRef< const realgmx::test::ChargesVector
 Charges.
 
typedef std::vector< RVec > gmx::test::CoordinatesVector
 Coordinates.
 
typedef ArrayRef< RVec > gmx::test::ForcesVector
 Forces.
 
typedef ArrayRef< const IVec > gmx::test::GridLineIndicesVector
 Gridline indices.
 
typedef ArrayRef< const realgmx::test::SplineParamsDimVector
 Spline parameters (theta or dtheta). A reference to a single dimension's spline data; this means (atomCount * pmeOrder) values or derivatives.
 
typedef std::array
< SplineParamsDimVector, 3 > 
gmx::test::SplineParamsVector
 Spline parameters (theta or dtheta) in all 3 dimensions.
 
template<typename ValueType >
using gmx::test::SparseGridValuesInput = std::map< IVec, ValueType >
 Non-zero grid values for test input; keys are 3d indices (IVec)
 
typedef SparseGridValuesInput
< real
gmx::test::SparseRealGridValuesInput
 Non-zero real grid values.
 
typedef SparseGridValuesInput
< t_complex > 
gmx::test::SparseComplexGridValuesInput
 Non-zero complex grid values.
 
template<typename ValueType >
using gmx::test::SparseGridValuesOutput = std::map< std::string, ValueType >
 Non-zero grid values for test output; keys are string representations of the cells' 3d indices (IVec); this allows for better sorting.
 
typedef SparseGridValuesOutput
< real
gmx::test::SparseRealGridValuesOutput
 Non-zero real grid values.
 
typedef SparseGridValuesOutput
< t_complex > 
gmx::test::SparseComplexGridValuesOutput
 Non-zero complex grid values.
 
typedef std::array< real, 3 *3 > gmx::test::Matrix3x3
 TODO: make proper C++ matrix for the whole Gromacs, get rid of this.
 

Enumerations

enum  gmx::test::PmeSolveAlgorithm { Coulomb, LennardJones }
 PME solver type.
 

Functions

bool gmx::test::pmeSupportsInputForMode (const gmx_hw_info_t &hwinfo, const t_inputrec *inputRec, CodePath mode)
 Tells if this generally valid PME input is supported for this mode.
 
uint64_t gmx::test::getSplineModuliDoublePrecisionUlps (int splineOrder)
 For double precision checks, the recursive interpolation and use of trig functions in make_dft_mod require a lot more flops, and thus opportunity for deviation between implementations.
 
PmeSafePointer gmx::test::pmeInitWrapper (const t_inputrec *inputRec, const CodePath mode, const gmx_device_info_t *gpuInfo, PmeGpuProgramHandle pmeGpuProgram, const Matrix3x3 &box, const real ewaldCoeff_q, const real ewaldCoeff_lj)
 PME initialization.
 
PmeSafePointer gmx::test::pmeInitEmpty (const t_inputrec *inputRec, const CodePath mode, const gmx_device_info_t *gpuInfo, PmeGpuProgramHandle pmeGpuProgram, const Matrix3x3 &box, real ewaldCoeff_q, real ewaldCoeff_lj)
 Simple PME initialization based on input, no atom data. More...
 
std::unique_ptr
< StatePropagatorDataGpu > 
gmx::test::makeStatePropagatorDataGpu (const gmx_pme_t &pme)
 Make a GPU state-propagator manager.
 
void gmx::test::pmeInitAtoms (gmx_pme_t *pme, StatePropagatorDataGpu *stateGpu, const CodePath mode, const CoordinatesVector &coordinates, const ChargesVector &charges)
 PME initialization with atom data. More...
 
void gmx::test::pmePerformSplineAndSpread (gmx_pme_t *pme, CodePath mode, bool computeSplines, bool spreadCharges)
 PME spline calculation and charge spreading. More...
 
void gmx::test::pmePerformSolve (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method, real cellVolume, GridOrdering gridOrdering, bool computeEnergyAndVirial)
 PME solving.
 
void gmx::test::pmePerformGather (gmx_pme_t *pme, CodePath mode, PmeForceOutputHandling inputTreatment, ForcesVector &forces)
 PME force gathering.
 
void gmx::test::pmeFinalizeTest (const gmx_pme_t *pme, CodePath mode)
 PME test finalization before fetching the outputs.
 
void gmx::test::pmeSetSplineData (const gmx_pme_t *pme, CodePath mode, const SplineParamsDimVector &splineValues, PmeSplineDataType type, int dimIndex)
 Setting atom spline values/derivatives to be used in spread/gather. More...
 
void gmx::test::pmeSetGridLineIndices (gmx_pme_t *pme, CodePath mode, const GridLineIndicesVector &gridLineIndices)
 Setting gridline indices to be used in spread/gather. More...
 
void gmx::test::pmeSetRealGrid (const gmx_pme_t *pme, CodePath mode, const SparseRealGridValuesInput &gridValues)
 Setting real grid to be used in gather.
 
void gmx::test::pmeSetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering, const SparseComplexGridValuesInput &gridValues)
 Setting complex grid to be used in solve.
 
SplineParamsDimVector gmx::test::pmeGetSplineData (const gmx_pme_t *pme, CodePath mode, PmeSplineDataType type, int dimIndex)
 Getting the single dimension's spline values or derivatives.
 
GridLineIndicesVector gmx::test::pmeGetGridlineIndices (const gmx_pme_t *pme, CodePath mode)
 Getting the gridline indices.
 
SparseRealGridValuesOutput gmx::test::pmeGetRealGrid (const gmx_pme_t *pme, CodePath mode)
 Getting the real grid (spreading output of pmePerformSplineAndSpread())
 
SparseComplexGridValuesOutput gmx::test::pmeGetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering)
 Getting the complex grid output of pmePerformSolve()
 
PmeOutput gmx::test::pmeGetReciprocalEnergyAndVirial (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method)
 Getting the reciprocal energy and virial.
 

Variables

constexpr int64_t gmx::test::c_splineModuliSinglePrecisionUlps = 1
 Spline moduli are computed in double precision, so they're very good in single precision.