Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pmetestcommon.cpp File Reference
#include "gmxpre.h"
#include "pmetestcommon.h"
#include <cstring>
#include <algorithm>
#include "gromacs/domdec/domdec.h"
#include "gromacs/ewald/pme_gather.h"
#include "gromacs/ewald/pme_gpu_internal.h"
#include "gromacs/ewald/pme_grid.h"
#include "gromacs/ewald/pme_internal.h"
#include "gromacs/ewald/pme_redistribute.h"
#include "gromacs/ewald/pme_solve.h"
#include "gromacs/ewald/pme_spread.h"
#include "gromacs/fft/parallel_3dfft.h"
#include "gromacs/gpu_utils/gpu_utils.h"
#include "gromacs/math/invertmatrix.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/logger.h"
#include "gromacs/utility/stringutil.h"
#include "testutils/testasserts.h"
+ Include dependency graph for pmetestcommon.cpp:

Description

Implements common routines for PME tests.

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

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...
 
static realgmx::test::pmeGetRealGridInternal (const gmx_pme_t *pme)
 Getting local PME real grid pointer for test I/O.
 
static void gmx::test::pmeGetRealGridSizesInternal (const gmx_pme_t *pme, CodePath mode, IVec &gridSize, IVec &paddedGridSize)
 Getting local PME real grid dimensions.
 
static t_complex * gmx::test::pmeGetComplexGridInternal (const gmx_pme_t *pme)
 Getting local PME complex grid pointer for test I/O.
 
static void gmx::test::pmeGetComplexGridSizesInternal (const gmx_pme_t *pme, IVec &gridSize, IVec &paddedGridSize)
 Getting local PME complex grid dimensions.
 
template<typename ValueType >
static void gmx::test::pmeGetGridAndSizesInternal (const gmx_pme_t *, CodePath, ValueType *&, IVec &, IVec &)
 Getting the PME grid memory buffer and its sizes - template definition.
 
template<>
void gmx::test::pmeGetGridAndSizesInternal< real > (const gmx_pme_t *pme, CodePath mode, real *&grid, IVec &gridSize, IVec &paddedGridSize)
 Getting the PME real grid memory buffer and its sizes.
 
template<>
void gmx::test::pmeGetGridAndSizesInternal< t_complex > (const gmx_pme_t *pme, CodePath, t_complex *&grid, IVec &gridSize, IVec &paddedGridSize)
 Getting the PME complex grid memory buffer and its sizes.
 
void gmx::test::pmePerformSplineAndSpread (gmx_pme_t *pme, CodePath mode, bool computeSplines, bool spreadCharges)
 PME spline calculation and charge spreading. More...
 
static realgmx::test::pmeGetSplineDataInternal (const gmx_pme_t *pme, PmeSplineDataType type, int dimIndex)
 Getting the internal spline data buffer pointer.
 
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...
 
size_t gmx::test::pmeGetGridPlainIndexInternal (const IVec &index, const IVec &paddedGridSize, GridOrdering gridOrdering)
 Getting plain index into the complex 3d grid.
 
template<typename ValueType >
static void gmx::test::pmeSetGridInternal (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering, const SparseGridValuesInput< ValueType > &gridValues)
 Setting real or complex grid.
 
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.
 
template<typename ValueType >
static SparseGridValuesOutput
< ValueType > 
gmx::test::pmeGetGridInternal (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering)
 Getting real or complex grid - only non zero values.
 
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.