Gromacs
2020.4
|
Testing utilities namespace.
This namespace contains utilities for writing unit tests, mostly from the Testing Utilities (testutils) module.
Classes | |
class | AnalysisDataTestInputPointSet |
Represents a single set of points in AnalysisDataTestInputFrame structure. More... | |
class | AnalysisDataTestInputFrame |
Represents a single frame in AnalysisDataTestInput structure. More... | |
class | AnalysisDataTestInput |
Represents static input data for AbstractAnalysisData tests. More... | |
class | AnalysisDataTestFixture |
Test fixture for AbstractAnalysisData testing. More... | |
struct | AwhTestParameters |
Struct that gathers all input for setting up and using a Bias. More... | |
class | BiasTest |
Test fixture for testing Bias updates. More... | |
class | BiasStateTest |
Test fixture for testing Bias updates. More... | |
class | MockModule |
Mock implementation of gmx::ICommandLineModule. More... | |
class | MockOptionsModule |
Mock implementation of gmx::ICommandLineOptionsModule. More... | |
class | CommandLineModuleManagerTestBase |
Test fixture for tests using gmx::CommandLineModuleManager. More... | |
class | TrajectoryFrameWriterTest |
Test fixture to test different file types are supported by the CoordinateFile. More... | |
class | ModuleSelection |
Helper class for tests that need an initialized selection. More... | |
class | ModuleTest |
Test fixture to test matching file types for modules. More... | |
class | SetAtomsSupportedFiles |
Helper to test supported file names. More... | |
class | SetAtomsUnSupportedFiles |
Helper to test supported file names. More... | |
class | AnyOutputSupportedFiles |
Helper to test supported file names. More... | |
class | NoOptionalOutput |
Helper to test support for disabling all output options. More... | |
class | OutputSelectorDeathTest |
Helper to test that invalid selection is rejected. More... | |
class | SetVelocitySupportedFiles |
Helper to test supported file names. More... | |
class | SetVelocityUnSupportedFiles |
Helper to test supported file names. More... | |
class | SetForceSupportedFiles |
Helper to test supported file names. More... | |
class | SetForceUnSupportedFiles |
Helper to test supported file names. More... | |
class | SetPrecisionSupportedFiles |
Helper to test supported file names. More... | |
class | SetPrecisionUnSupportedFiles |
Helper to test supported file names. More... | |
class | FlagTest |
Test fixture to test user inputs. More... | |
class | SetAtomsTest |
Test fixture to prepare a setatoms object to pass data through. More... | |
class | SetBothTimeTest |
Test fixture to prepare a setatoms object to pass data through. More... | |
class | SetStartTimeTest |
Test fixture to prepare a setatoms object to pass data through. More... | |
class | SetTimeStepTest |
Test fixture to prepare a setatoms object to pass data through. More... | |
struct | TestHardwareContext |
A structure to describe a hardware context that persists over the lifetime of the test binary - an abstraction over PmeGpuProgram with a human-readable string. More... | |
class | PmeTestEnvironment |
This class performs one-time test initialization (enumerating the hardware) More... | |
class | HostMemoryTest |
Typed test fixture for infrastructure for host-side memory used for GPU transfers. More... | |
struct | HostAllocatorTest |
Typed test fixture. More... | |
struct | HostAllocatorTestNoMem |
Typed test fixture (no mem/gpu initializtion - much faster) More... | |
struct | HostAllocatorTestNoMemCopyable |
Typed test fixture for tests requiring a copyable type. More... | |
class | PaddedVectorTest |
Typed test fixture. More... | |
class | SignalTest |
Test fixture for mdrun signalling. More... | |
class | TopologyManager |
Helps create and manage the lifetime of topology and related data structures. More... | |
class | SimdBaseTest |
Base class for SIMD test fixtures. More... | |
class | SimdTest |
Test fixture for SIMD tests. More... | |
class | Simd4Test |
Test fixture for SIMD4 tests - contains test settings. More... | |
class | AbstractTrajectoryAnalysisModuleTestFixture |
Test fixture for trajectory analysis modules. More... | |
class | TrajectoryAnalysisModuleTestFixture |
Test fixture for a trajectory analysis module. More... | |
class | AllocatorTest |
Templated test fixture. More... | |
class | DensityFittingTest |
End to end test for the density fitting functionality in mdrun. More... | |
class | EnergyComparison |
Function object to compare all energy terms of reference with all matching terms from test within the given tolerances. More... | |
class | EnergyFrameReader |
Manages returning an EnergyFrame containing required energy term values read from successive frames of an .edr file. More... | |
class | FramePairManager |
Manages returning a pair of frames from two equivalent simulations that are meaningful to compare. More... | |
class | MimicTest |
Test fixture for bonded interactions. More... | |
class | SimulationRunner |
Helper object for running grompp and mdrun in integration tests of mdrun functionality. More... | |
class | MdrunTestFixtureBase |
Declares test fixture base class for integration tests of mdrun functionality. More... | |
class | MdrunTestFixture |
Declares test fixture class for integration tests of mdrun functionality that use a single call of mdrun. More... | |
class | ParameterizedMdrunTestFixture |
Parameterized test fixture for mdrun integration tests. More... | |
class | MultiSimTest |
Test fixture for multi-sim functionality. More... | |
class | BondedInteractionsTest |
Test fixture for bonded interactions. More... | |
class | TerminationHelper |
Help test mdrun termination behaviour. More... | |
struct | TrajectoryTolerances |
Helper struct for testing different trajectory components with different tolerances. More... | |
struct | TrajectoryFrameMatchSettings |
Helper struct to specify the expected behaviour of compareFrames(). More... | |
class | TrajectoryComparison |
Function object to compare the fields of the two frames for equality given the matchSettings_ and tolerances_ . More... | |
class | TrajectoryFrameReader |
Manages returning a t_trxframe whose contents were read from successive frames of an trajectory file. More... | |
class | CommandLine |
Helper class for tests that need to construct command lines. More... | |
class | CommandLineTestHelper |
Helper class for tests that construct command lines that need to reference existing files. More... | |
class | CommandLineTestBase |
Test fixture for tests that call a single command-line program with input/output files. More... | |
class | ConfMatch |
Match the contents as an gro file. More... | |
class | IFileMatcher |
Represents a file matcher, matching file contents against reference (or other) data. More... | |
class | IFileMatcherSettings |
Represents a factory for creating a file matcher. More... | |
class | TextFileMatch |
Use a ITextBlockMatcher for matching the contents. More... | |
class | NoContentsMatch |
Do not check the contents of the file. More... | |
class | InteractiveTestHelper |
Helper class for testing interactive sessions. More... | |
class | LoggerTestHelper |
Helper class for tests to check output written to a logger. More... | |
class | TestReferenceChecker |
Handles comparison to test reference data. More... | |
class | TestReferenceData |
Handles creation of and comparison to test reference data. More... | |
class | StdioTestHelper |
Helper class for tests where code reads directly from stdin . More... | |
class | StringTestBase |
Test fixture for tests that check string formatting. More... | |
class | FloatingPointDifference |
Computes and represents a floating-point difference value. More... | |
class | FloatingPointTolerance |
Specifies a floating-point comparison tolerance and checks whether a difference is within the tolerance. More... | |
class | TestException |
Exception class for reporting errors in tests. More... | |
class | TestFileManager |
Helper for tests that need input and output files. More... | |
class | TestFileInputRedirector |
In-memory implementation for IFileInputRedirector for tests. More... | |
class | TestFileOutputRedirector |
In-memory implementation of IFileOutputRedirector for tests. More... | |
class | FloatTypeMatcher |
Implementation class for RealEq matcher. More... | |
class | RVecMatcher |
Implementation class for RvecEq matcher. More... | |
class | TestOptionsProvider |
Provides additional options for the test executable. More... | |
class | ITextBlockMatcher |
Represents a text matcher, matching text stream contents against reference data. More... | |
class | ITextBlockMatcherSettings |
Represents a factory for creating a text matcher. More... | |
class | ExactTextMatch |
Use an exact text match (the contents should be exactly equal). More... | |
class | NoTextMatch |
Do not match the text (the contents are ignored). More... | |
class | FilteringExactTextMatch |
Use an exact text match after scrubbing lines of the text that match the supplied regular expressions. More... | |
class | TprAndFileManager |
Helper to bundle generated TPR and the file manager to clean it up. More... | |
class | XvgMatch |
Match the contents as an xvg file. More... | |
Typedefs | |
typedef std::shared_ptr < MockAnalysisDataModule > | MockAnalysisDataModulePointer |
Smart pointer to manage an MockAnalysisDataModule object. | |
typedef std::tuple< int, int, BiasParams::DisableUpdateSkips > | BiasTestParameters |
Convenience typedef: growth type enum, potential type enum, disable update skips. | |
typedef gmx::unique_cptr < gmx_pme_t, gmx_pme_destroy > | PmeSafePointer |
A safe pointer type for PME. | |
typedef ArrayRef< const real > | ChargesVector |
Charges. | |
typedef std::vector< RVec > | CoordinatesVector |
Coordinates. | |
typedef ArrayRef< RVec > | ForcesVector |
Forces. | |
typedef ArrayRef< const IVec > | GridLineIndicesVector |
Gridline indices. | |
typedef ArrayRef< const real > | 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 > | SplineParamsVector |
Spline parameters (theta or dtheta) in all 3 dimensions. | |
template<typename ValueType > | |
using | SparseGridValuesInput = std::map< IVec, ValueType > |
Non-zero grid values for test input; keys are 3d indices (IVec) | |
typedef SparseGridValuesInput < real > | SparseRealGridValuesInput |
Non-zero real grid values. | |
typedef SparseGridValuesInput < t_complex > | SparseComplexGridValuesInput |
Non-zero complex grid values. | |
template<typename ValueType > | |
using | 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 > | SparseRealGridValuesOutput |
Non-zero real grid values. | |
typedef SparseGridValuesOutput < t_complex > | SparseComplexGridValuesOutput |
Non-zero complex grid values. | |
typedef std::array< real, 3 *3 > | Matrix3x3 |
TODO: make proper C++ matrix for the whole Gromacs, get rid of this. | |
typedef std::vector < std::unique_ptr < TestHardwareContext > > | TestHardwareContexts |
A container of handles to hardware contexts. | |
typedef ::testing::Types < int32_t, real, RVec, test::MoveOnly > | TestTypes |
The types used in testing of all operations. | |
using | TestTypesCopyable = ::testing::Types< int32_t, real, RVec > |
The types used in testing minus move only types. | |
template<typename T > | |
using | HostAllocatorTestCopyable = HostAllocatorTest< T > |
Typed test fixture for tests requiring a copyable type. | |
using | AllocatorTypesToTest = ::testing::Types< HostAllocator< real >, HostAllocator< int32_t >, HostAllocator< RVec >, HostAllocator< MoveOnly >> |
Declare allocator types to test. | |
using | Implementations = ::testing::Types< std::allocator< int32_t >, std::allocator< float >, std::allocator< double >, std::allocator< BasicVector< float >>, std::allocator< BasicVector< double >>, AlignedAllocator< int32_t >, AlignedAllocator< float >, AlignedAllocator< double >, AlignedAllocator< BasicVector< float >>, AlignedAllocator< BasicVector< double >>> |
The types used in testing. | |
typedef gmx::test::DispersionCorrectionTestFixture | DispersionCorrectionTest |
Test fixture for mdrun with dispersion correction. | |
using | EnergyTermsToCompare = std::unordered_map< std::string, FloatingPointTolerance > |
Convenience type. | |
typedef std::unique_ptr < EnergyFrameReader > | EnergyFrameReaderPtr |
Convenience smart pointer typedef. | |
typedef unique_cptr< ener_file, done_ener_file > | ener_file_ptr |
Convenience smart pointer typedef. | |
typedef unique_cptr < t_enxframe, done_enxframe > | enxframe_ptr |
Convenience smart pointer typedef. | |
typedef gmx::test::ImdTestFixture | ImdTest |
Test fixture for mdrun with IMD settings. | |
typedef MultiSimTest | MultiSimTerminationTest |
Convenience typedef. | |
typedef std::unique_ptr < CommandLine > | CommandLinePointer |
Convenience typedef. | |
typedef gmx::test::OriresTestFixture | OriresTest |
Test fixture for mdrun with orires. | |
typedef MultiSimTest | ReplicaExchangeEnsembleTest |
Convenience typedef. | |
typedef MultiSimTest | ReplicaExchangeTerminationTest |
Convenience typedef. | |
typedef gmx::test::SwapTestFixture | CompelTest |
Test fixture for mdrun with "Computational Electrophysiology" settings,. | |
typedef MdrunTestFixture | MdrunTerminationTest |
Convenience typedef. | |
typedef unique_cptr < gmx_output_env_t, output_env_done > | oenv_ptr |
Convenience smart pointer typedef. | |
typedef unique_cptr < t_trxstatus, close_trx > | trxstatus_file_ptr |
Convenience smart pointer typedef. | |
typedef unique_cptr < t_trxframe, done_trxframe > | trxframe_ptr |
Convenience smart pointer typedef. | |
typedef std::unique_ptr < IFileMatcher > | FileMatcherPointer |
Smart pointer for managing a IFileMatcher. | |
using | MdpFieldValues = std::map< std::string, std::string > |
Helper typedef. | |
typedef std::unique_ptr < ITextBlockMatcher > | TextBlockMatcherPointer |
Smart pointer for managing a ITextBlockMatcher. | |
Enumerations | |
enum | TestEnums { efTestString, efTestInt, efTestFloat } |
Test enums to decide on how to use options framework. | |
enum | PmeSolveAlgorithm { Coulomb, LennardJones } |
PME solver type. | |
enum | CodePath { CPU, GPU } |
Hardware code path being tested. | |
enum | ComparisonConditions : int { CompareIfBothFound, NoComparison, MustCompare, CompareIfReferenceFound, CompareIfTestFound, Count } |
Enumeration controlling how data within trajectory frames are compared. | |
enum | ReferenceDataMode { erefdataCompare, erefdataCreateMissing, erefdataUpdateChanged, erefdataUpdateAll } |
Mode of operation for reference data handling. More... | |
Functions | |
static AwhTestParameters | getAwhTestParameters (int eawhgrowth, int eawhpotential) |
Helper function to set up the C-style AWH parameters for the test. | |
static AwhTestParameters | getAwhTestParameters () |
Helper function to set up the C-style AWH parameters for the test. | |
TrajectoryFrameWriterPointer | createMinimalTrajectoryFrameWriter (const std::string &filename, const TopologyInformation &topology, const Selection &selection, OutputRequirements requirements) |
Create minimal TrajectoryFrameWriter using the provided builder. More... | |
static void | splitAndAddValues (OptionsAssigner *assigner, const std::string &optionValues, TestEnums type) |
Helper function to split string with multiple values into option settings. More... | |
bool | 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 | 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 | 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 | 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 > | makeStatePropagatorDataGpu (const gmx_pme_t &pme) |
Make a GPU state-propagator manager. | |
void | pmeInitAtoms (gmx_pme_t *pme, StatePropagatorDataGpu *stateGpu, const CodePath mode, const CoordinatesVector &coordinates, const ChargesVector &charges) |
PME initialization with atom data. More... | |
static real * | pmeGetRealGridInternal (const gmx_pme_t *pme) |
Getting local PME real grid pointer for test I/O. | |
static void | pmeGetRealGridSizesInternal (const gmx_pme_t *pme, CodePath mode, IVec &gridSize, IVec &paddedGridSize) |
Getting local PME real grid dimensions. | |
static t_complex * | pmeGetComplexGridInternal (const gmx_pme_t *pme) |
Getting local PME complex grid pointer for test I/O. | |
static void | pmeGetComplexGridSizesInternal (const gmx_pme_t *pme, IVec &gridSize, IVec &paddedGridSize) |
Getting local PME complex grid dimensions. | |
template<typename ValueType > | |
static void | pmeGetGridAndSizesInternal (const gmx_pme_t *, CodePath, ValueType *&, IVec &, IVec &) |
Getting the PME grid memory buffer and its sizes - template definition. | |
template<> | |
void | 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 | 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 | pmePerformSplineAndSpread (gmx_pme_t *pme, CodePath mode, bool computeSplines, bool spreadCharges) |
PME spline calculation and charge spreading. More... | |
static real * | pmeGetSplineDataInternal (const gmx_pme_t *pme, PmeSplineDataType type, int dimIndex) |
Getting the internal spline data buffer pointer. | |
void | pmePerformSolve (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method, real cellVolume, GridOrdering gridOrdering, bool computeEnergyAndVirial) |
PME solving. | |
void | pmePerformGather (gmx_pme_t *pme, CodePath mode, PmeForceOutputHandling inputTreatment, ForcesVector &forces) |
PME force gathering. | |
void | pmeFinalizeTest (const gmx_pme_t *pme, CodePath mode) |
PME test finalization before fetching the outputs. | |
void | 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 | pmeSetGridLineIndices (gmx_pme_t *pme, CodePath mode, const GridLineIndicesVector &gridLineIndices) |
Setting gridline indices to be used in spread/gather. More... | |
size_t | pmeGetGridPlainIndexInternal (const IVec &index, const IVec &paddedGridSize, GridOrdering gridOrdering) |
Getting plain index into the complex 3d grid. | |
template<typename ValueType > | |
static void | pmeSetGridInternal (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering, const SparseGridValuesInput< ValueType > &gridValues) |
Setting real or complex grid. | |
void | pmeSetRealGrid (const gmx_pme_t *pme, CodePath mode, const SparseRealGridValuesInput &gridValues) |
Setting real grid to be used in gather. | |
void | pmeSetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering, const SparseComplexGridValuesInput &gridValues) |
Setting complex grid to be used in solve. | |
SplineParamsDimVector | pmeGetSplineData (const gmx_pme_t *pme, CodePath mode, PmeSplineDataType type, int dimIndex) |
Getting the single dimension's spline values or derivatives. | |
GridLineIndicesVector | pmeGetGridlineIndices (const gmx_pme_t *pme, CodePath mode) |
Getting the gridline indices. | |
template<typename ValueType > | |
static SparseGridValuesOutput < ValueType > | pmeGetGridInternal (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering) |
Getting real or complex grid - only non zero values. | |
SparseRealGridValuesOutput | pmeGetRealGrid (const gmx_pme_t *pme, CodePath mode) |
Getting the real grid (spreading output of pmePerformSplineAndSpread()) | |
SparseComplexGridValuesOutput | pmeGetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering) |
Getting the complex grid output of pmePerformSolve() | |
PmeOutput | pmeGetReciprocalEnergyAndVirial (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method) |
Getting the reciprocal energy and virial. | |
const char * | codePathToString (CodePath codePath) |
Return a string useful for human-readable messages describing a codePath . | |
const PmeTestEnvironment * | getPmeTestEnv () |
Get the test environment. | |
void | callAddGlobalTestEnvironment () |
This constructs the test environment during setup of the unit test so that they can use the hardware context. More... | |
static gmx_hw_info_t * | hardwareInit () |
Simple hardware initialization. | |
template<typename T > | |
ArrayRef< char > | charArrayRefFromArray (T *data, size_t size) |
Convenience function to transform a view into one with base type of (non-const) char. More... | |
template<typename T > | |
void | runTest (const gmx_gpu_info_t &gpuInfo, ArrayRef< T > input, ArrayRef< T > output) |
Does a device transfer of input to the device in gpuInfo , and back to output . | |
template<typename VectorType > | |
bool | isPinned (const VectorType &v) |
Helper function for wrapping a call to isHostMemoryPinned. | |
template<typename T > | |
void | fillInputContents (ArrayRef< T > inputRef, int scaleFactor) |
Initialization overload for non-BasicVector. | |
template<typename T > | |
void | fillInputContents (ArrayRef< BasicVector< T >> inputRef, int scaleFactor) |
Initialization overload for BasicVector. | |
template<typename PaddedVectorOfT > | |
void | fillInput (PaddedVectorOfT *input, int scaleFactor) |
Dispatcher function for filling. | |
template<typename T > | |
void | compareViews (ArrayRef< T > input, ArrayRef< T > output) |
Comparison overload for non-BasicVector. | |
template<typename T > | |
void | compareViews (ArrayRef< BasicVector< T >> input, ArrayRef< BasicVector< T >> output) |
Comparison overload for BasicVector<T> | |
void | applyShake (ConstraintsTestData *testData, t_pbc pbc) |
Initialize and apply SHAKE constraints. More... | |
void | applyLincs (ConstraintsTestData *testData, t_pbc pbc) |
Initialize and apply LINCS constraints. More... | |
void | applyLincsCuda (ConstraintsTestData *testData, t_pbc pbc) |
Apply CUDA version of LINCS constraints to the test data. More... | |
void | integrateLeapFrogSimple (LeapFrogTestData *testData, int numSteps) |
Integrate using CPU version of Leap-Frog. More... | |
void | integrateLeapFrogGpu (LeapFrogTestData *testData, int numSteps) |
Integrate using CUDA version of Leap-Frog. More... | |
void | applySettle (SettleTestData *testData, t_pbc pbc, bool updateVelocities, bool calcVirial, const std::string &testDescription) |
Apply SETTLE using CPU version of the algorithm. More... | |
void | applySettleGpu (SettleTestData *testData, t_pbc pbc, bool updateVelocities, bool calcVirial, const std::string &testDescription) |
Apply SETTLE using GPU version of the algorithm. More... | |
static const std::array < gmx::RVec, 51 > | c_waterPositions ({{{.130,-.041,-.291},{.120,-.056,-.192},{.044,-.005,-.327},{-.854,-.406,.477},{-.900,-.334,.425},{-.858,-.386,.575},{.351,-.061,.853},{.401,-.147,.859},{.416,.016,.850},{-.067,-.796,.873},{-.129,-.811,.797},{-.119,-.785,.958},{-.635,-.312,-.356},{-.629,-.389,-.292},{-.687,-.338,-.436},{.321,-.919,.242},{.403,-.880,.200},{.294,-1.001,.193},{-.404,.735,.728},{-.409,.670,.803},{-.324,.794,.741},{.461,-.596,-.135},{.411,-.595,-.221},{.398,-.614,-.059},{-.751,-.086,.237},{-.811,-.148,.287},{-.720,-.130,.152},{.202,.285,-.364},{.122,.345,-.377},{.192,.236,-.278},{-.230,-.485,.081},{-.262,-.391,.071},{-.306,-.548,.069},{.464,-.119,.323},{.497,-.080,.409},{.540,-.126,.258},{-.462,.107,.426},{-.486,.070,.336},{-.363,.123,.430},{.249,-.077,-.621},{.306,-.142,-.571},{.233,-.110,-.714},{-.922,-.164,.904},{-.842,-.221,.925},{-.971,-.204,.827},{.382,.700,.480},{.427,.610,.477},{.288,.689,.513},{.781,.264,-.113},{.848,.203,-.070},{.708,.283,-.048}}}) |
Database of 51 water atom input positions (taken from spc216.gro) for use as test inputs. | |
::std::vector< real > | simdReal2Vector (SimdReal simd) |
Convert SIMD real to std::vector<real>. More... | |
SimdReal | vector2SimdReal (const std::vector< real > &v) |
Return floating-point SIMD value from std::vector<real>. More... | |
SimdReal | setSimdRealFrom3R (real r0, real r1, real r2) |
Set SIMD register contents from three real values. More... | |
SimdReal | setSimdRealFrom1R (real value) |
Set SIMD register contents from single real value. More... | |
std::vector< std::int32_t > | simdInt2Vector (SimdInt32 simd) |
Convert SIMD integer to std::vector<int>. More... | |
SimdInt32 | vector2SimdInt (const std::vector< std::int32_t > &v) |
Return 32-bit integer SIMD value from std::vector<int>. More... | |
SimdInt32 | setSimdIntFrom3I (int i0, int i1, int i2) |
Set SIMD register contents from three int values. More... | |
SimdInt32 | setSimdIntFrom1I (int value) |
Set SIMD register contents from single integer value. More... | |
::std::vector< real > | simd4Real2Vector (Simd4Real simd4) |
Convert SIMD4 real to std::vector<real>. More... | |
Simd4Real | vector2Simd4Real (const std::vector< real > &v) |
Return floating-point SIMD4 value from std::vector<real>. More... | |
Simd4Real | setSimd4RealFrom3R (real r0, real r1, real r2) |
Set SIMD4 register contents from three real values. More... | |
Simd4Real | setSimd4RealFrom1R (real value) |
Set SIMD4 register contents from single real value. More... | |
static void | readTprInput (const TprAndFileManager *tprHandle, gmx_mtop_t *mtop, t_inputrec *ir) |
Reads a tpr for the test. More... | |
void | checkEnergiesAgainstReferenceData (const std::string &energyFilename, const EnergyTermsToCompare &energyTermsToCompare, TestReferenceChecker *checker) |
Check a subset of the energies found in an energy file against reference data. More... | |
EnergyFrameReaderPtr | openEnergyFileToReadTerms (const std::string &filename, const std::vector< std::string > &requiredEnergyTermNames) |
Open the file and return an object that can read the required terms from frames of an .edr file. More... | |
static t_enxframe * | make_enxframe () |
Helper function to obtain resources. | |
void | done_enxframe (t_enxframe *fr) |
Helper function to clean up resources. More... | |
template<typename... Args> | |
void | executeSimulatorComparisonTest (const std::string &environmentVariable, Args &&...args) |
Run and compare a simulator run with and without an environment variable. More... | |
template<typename... Args> | |
void | executeRerunTest (Args &&...args) |
Run and compare a simulator run to its rerun. More... | |
static void | organizeMdpFile (SimulationRunner *runner, int nsteps=2) |
Build a simple .mdp file. | |
static void | compareBox (const TrajectoryFrame &reference, const TrajectoryFrame &test, const TrajectoryFrameMatchSettings &matchSettings, const FloatingPointTolerance tolerance) |
Compares the box from reference and test according to the matchSettings and tolerance . More... | |
static std::vector< RVec > | putAtomsInBox (const TrajectoryFrame &frame) |
Help put all atom coordinates in frame into its box. More... | |
static bool | shouldDoComparison (const ComparisonConditions comparisonConditions, const bool referenceIsEmpty, const bool testIsEmpty) |
Return whether the comparisonConditions and emptiness of reference and test frames means that a comparison should be attempted. More... | |
static void | compareCoordinates (const TrajectoryFrame &reference, const TrajectoryFrame &test, const TrajectoryFrameMatchSettings &matchSettings, const FloatingPointTolerance tolerance) |
Compares the position coordinates from reference and test according to the matchSettings and tolerance . | |
static void | compareVelocities (const TrajectoryFrame &reference, const TrajectoryFrame &test, const TrajectoryFrameMatchSettings &matchSettings, const FloatingPointTolerance tolerance) |
Compares the velocities from reference and test according to the matchSettings and tolerance . | |
static void | compareForces (const TrajectoryFrame &reference, const TrajectoryFrame &test, const TrajectoryFrameMatchSettings &matchSettings, const FloatingPointTolerance tolerance) |
Compares the forces from reference and test according to the matchSettings and tolerance . | |
static t_trxframe * | make_trxframe () |
Helper function to obtain resources. | |
void | done_trxframe (t_trxframe *fr) |
Helper function to clean up resources. More... | |
void | checkConfFile (TextInputStream *input, TestReferenceChecker *checker, const ConfMatchSettings &settings) |
Adds content of a gro file to TestReferenceChecker object. More... | |
void | initMPIOutput () |
Customizes test output and test failure handling for MPI runs. More... | |
int | getNumberOfTestMpiRanks () |
Returns the number of MPI ranks to use for an MPI test. More... | |
bool | threadMpiTestRunner (std::function< void()> testBody) |
Helper function for GMX_MPI_TEST(). | |
void | initReferenceData (IOptionsContainer *options) |
Initializes reference data handling. More... | |
static void | throwIfNonEmptyAndOnlyWhitespace (const std::string &s, const char *id) |
Throw a TestException if the caller tries to write particular refdata that can't work. More... | |
static double | convertDoubleReferenceValue (const std::string &value) |
Helper function to parse a floating-point reference data value. | |
ReferenceDataEntry::EntryPointer | readReferenceDataFile (const std::string &path) |
Loads reference data from an XML file. More... | |
void | writeReferenceDataFile (const std::string &path, const ReferenceDataEntry &root) |
Saves reference data to an XML file. More... | |
int | gmxSetenv (const char *name, const char *value, int overwrite) |
Workaround to make setenv work on Windows. | |
int | gmxUnsetenv (const char *name) |
Workaround to make unsetenv work on Windows. | |
bool | isNumberOfPpRanksSupported (const std::string &simulationName, int possibleNumberOfPpRanks) |
Return whether the number of ranks is supported by the simulation simulationName in the database. More... | |
std::string | reportNumbersOfPpRanksSupported (const std::string &simulationName) |
Return a string describing the numbers of ranks supported for the simulation simulationName in the database. | |
MdpFieldValues | prepareMdpFieldValues (const std::string &simulationName, const std::string &integrator, const std::string &tcoupl, const std::string &pcoupl) |
Set up values for an .mdp file that permits a highly reproducible simulation. More... | |
MdpFieldValues | prepareMdpFieldValues (const char *simulationName, const char *integrator, const char *tcoupl, const char *pcoupl) |
Set up values for an .mdp file that permits a highly reproducible simulation. More... | |
std::string | prepareMdpFileContents (const MdpFieldValues &mdpFieldValues) |
Make a string containing an .mdp file from the mdpFieldValues . More... | |
static inline::testing::AssertionResult | plainAssertHelper (const char *, const ::testing::AssertionResult &expr) |
Helper method for (EXPECT|ASSERT)_PLAIN . More... | |
void | initTestUtils (const char *dataPath, const char *tempPath, bool usesMpi, bool usesHardwareDetection, int *argc, char ***argv) |
Initializes the test utilities library. More... | |
void | finalizeTestUtils () |
Finalizes the test utilities library. More... | |
testing::Matcher< std::tuple < float, float > > | FloatEq (const FloatingPointTolerance &tolerance) |
Make matcher for floats for use with GoogleMock that compare equal when tolerance is satisifed. More... | |
testing::Matcher< std::tuple < double, double > > | DoubleEq (const FloatingPointTolerance &tolerance) |
Make matcher for doubles for use with GoogleMock that compare equal when tolerance is satisifed. More... | |
testing::Matcher< std::tuple < real, real > > | RealEq (const FloatingPointTolerance &tolerance) |
Make matcher for reals for use with GoogleMock that compare equal when tolerance is satisifed. More... | |
testing::Matcher< std::tuple < RVec, RVec > > | RVecEq (const FloatingPointTolerance &tolerance) |
Make matcher for RVecs for use with GoogleMock that compare equal when tolerance is satisifed. More... | |
void | registerTestOptions (const char *name, TestOptionsProvider *provider) |
Registers a test option provider with the test framework. More... | |
void | initTestOptions (IOptionsContainer *options) |
Initializes the options from all registered test providers. More... | |
void | checkXvgFile (TextInputStream *input, TestReferenceChecker *checker, const XvgMatchSettings &settings) |
Adds content of xvg file to TestReferenceChecker object. More... | |
Assertions for floating-point comparison | |
These routines extend See gmx::test::FloatingPointTolerance for the possible ways to specify the tolerance, and gmx::test::FloatingPointDifference for some additional details of the difference calculation. | |
template<typename FloatType > | |
static inline::testing::AssertionResult | assertEqualWithinTolerance (const char *expr1, const char *expr2, const char *, FloatType value1, FloatType value2, const FloatingPointTolerance &tolerance) |
Assertion predicate formatter for comparing two floating-point values. More... | |
Variables | |
const double | g_coords [] |
Database of 21 test coordinates that represent a trajectory */. More... | |
const char *const | trajectoryFileNames [] |
Character array of different file names to test. More... | |
const char *const | setAtomsSupported [] |
Names here work for setAtoms module. More... | |
const char *const | setAtomsUnSupported [] = { "spc2-traj.trr", "spc2-traj.xtc", "spc2-traj.g96" } |
Names here don't work for setAtoms module. | |
const char *const | anySupported [] |
Names here work for stuff that has no specific requirements. More... | |
const char *const | setVelocitySupported [] |
Names here work for setVelocity module. More... | |
const char *const | setVelocityUnSupported [] = { "spc2-traj.xtc", "spc2-traj.pdb", "spc2-traj.g96" } |
Names here don't work for setVelocity module. | |
const char *const | setForceSupported [] |
Names here work for setForce module. More... | |
const char *const | setForceUnSupported [] |
Names here don't work for setForce module. More... | |
const char *const | setPrecisionSupported [] |
Names here work for setPrecision module. More... | |
const char *const | setPrecisionUnSupported [] |
Names here don't work for setPrecision module. More... | |
constexpr int64_t | c_splineModuliSinglePrecisionUlps = 1 |
Spline moduli are computed in double precision, so they're very good in single precision. | |
constexpr real | czero = 0.0 |
zero | |
constexpr real | c0 = 0.3333333333333333 |
test constant 0.0 + 1.0/3.0 | |
constexpr real | c1 = 1.7142857142857144 |
test constant 1.0 + 5.0/7.0 | |
constexpr real | c2 = 2.6923076923076925 |
test constant 2.0 + 9.0/13.0 | |
constexpr real | c3 = 3.8947368421052633 |
test constant 3.0 + 17.0/19.0 | |
constexpr real | c4 = 4.793103448275862 |
test constant 4.0 + 23.0/29.0 | |
constexpr real | c5 = 5.837837837837838 |
test constant 5.0 + 31.0/37.0 | |
constexpr real | c6 = 6.953488372093023 |
test constant 6.0 + 41.0/43.0 | |
constexpr real | c7 = 7.886792452830189 |
test constant 7.0 + 47.0/53.0 | |
constexpr real | c8 = 8.967213114754099 |
test constant 8.0 + 59.0/61.0 | |
const SimdReal | rSimd_c0c1c2 = setSimdRealFrom3R(c0, c1, c2) |
c0,c1,c2 repeated | |
const SimdReal | rSimd_c3c4c5 = setSimdRealFrom3R(c3, c4, c5) |
c3,c4,c5 repeated | |
const SimdReal | rSimd_c6c7c8 = setSimdRealFrom3R(c6, c7, c8) |
c6,c7,c8 repeated | |
const SimdReal | rSimd_c3c0c4 = setSimdRealFrom3R(c3, c0, c4) |
c3,c0,c4 repeated | |
const SimdReal | rSimd_c4c6c8 = setSimdRealFrom3R(c4, c6, c8) |
c4,c6,c8 repeated | |
const SimdReal | rSimd_c7c2c3 = setSimdRealFrom3R(c7, c2, c3) |
c7,c2,c3 repeated | |
const SimdReal | rSimd_m0m1m2 = setSimdRealFrom3R(-c0, -c1, -c2) |
-c0,-c1,-c2 repeated | |
const SimdReal | rSimd_m3m0m4 = setSimdRealFrom3R(-c3, -c0, -c4) |
-c3,-c0,-c4 repeated | |
const SimdReal | rSimd_2p25 = setSimdRealFrom1R(2.25) |
Value that rounds down. | |
const SimdReal | rSimd_3p25 = setSimdRealFrom1R(3.25) |
Value that rounds down. | |
const SimdReal | rSimd_3p75 = setSimdRealFrom1R(3.75) |
Value that rounds up. | |
const SimdReal | rSimd_m2p25 = setSimdRealFrom1R(-2.25) |
Negative value that rounds up. | |
const SimdReal | rSimd_m3p25 = setSimdRealFrom1R(-3.25) |
Negative value that rounds up. | |
const SimdReal | rSimd_m3p75 = setSimdRealFrom1R(-3.75) |
Negative value that rounds down. More... | |
const SimdReal | rSimd_Exp |
Three large floating-point values whose exponents are >32. More... | |
const SimdReal | rSimd_logicalA = setSimdRealFrom1R(1.3333282470703125) |
Bit pattern to test logical ops. | |
const SimdReal | rSimd_logicalB = setSimdRealFrom1R(1.79998779296875) |
Bit pattern to test logical ops. | |
const SimdReal | rSimd_logicalResultAnd = setSimdRealFrom1R(1.26666259765625) |
Result or bitwise 'and' of A and B. | |
const SimdReal | rSimd_logicalResultOr = setSimdRealFrom1R(1.8666534423828125) |
Result or bitwise 'or' of A and B. | |
const SimdInt32 | iSimd_1_2_3 = setSimdIntFrom3I(1, 2, 3) |
Three generic ints. | |
const SimdInt32 | iSimd_4_5_6 = setSimdIntFrom3I(4, 5, 6) |
Three generic ints. | |
const SimdInt32 | iSimd_7_8_9 = setSimdIntFrom3I(7, 8, 9) |
Three generic ints. | |
const SimdInt32 | iSimd_5_7_9 = setSimdIntFrom3I(5, 7, 9) |
iSimd_1_2_3 + iSimd_4_5_6. | |
const SimdInt32 | iSimd_1M_2M_3M = setSimdIntFrom3I(1000000, 2000000, 3000000) |
Term1 for 32bit add/sub. | |
const SimdInt32 | iSimd_4M_5M_6M = setSimdIntFrom3I(4000000, 5000000, 6000000) |
Term2 for 32bit add/sub. | |
const SimdInt32 | iSimd_5M_7M_9M = setSimdIntFrom3I(5000000, 7000000, 9000000) |
iSimd_1M_2M_3M + iSimd_4M_5M_6M. | |
const SimdInt32 | iSimd_0xF0F0F0F0 = setSimdIntFrom1I(0xF0F0F0F0) |
Bitpattern to test integer logical operations. | |
const SimdInt32 | iSimd_0xCCCCCCCC = setSimdIntFrom1I(0xCCCCCCCC) |
Bitpattern to test integer logical operations. | |
const SimdReal | rSimd_Bits1 |
Pattern F0 repeated to fill single/double. | |
const SimdReal | rSimd_Bits2 |
Pattern CC repeated to fill single/double. | |
const SimdReal | rSimd_Bits3 |
Pattern C0 repeated to fill single/double. | |
const SimdReal | rSimd_Bits4 |
Pattern 0C repeated to fill single/double. | |
const SimdReal | rSimd_Bits5 |
Pattern FC repeated to fill single/double. | |
const SimdReal | rSimd_Bits6 |
Pattern 3C repeated to fill single/double. | |
const Simd4Real | rSimd4_c0c1c2 = setSimd4RealFrom3R(c0, c1, c2) |
c0,c1,c2 repeated | |
const Simd4Real | rSimd4_c3c4c5 = setSimd4RealFrom3R(c3, c4, c5) |
c3,c4,c5 repeated | |
const Simd4Real | rSimd4_c6c7c8 = setSimd4RealFrom3R(c6, c7, c8) |
c6,c7,c8 repeated | |
const Simd4Real | rSimd4_c3c0c4 = setSimd4RealFrom3R(c3, c0, c4) |
c3,c0,c4 repeated | |
const Simd4Real | rSimd4_c4c6c8 = setSimd4RealFrom3R(c4, c6, c8) |
c4,c6,c8 repeated | |
const Simd4Real | rSimd4_c7c2c3 = setSimd4RealFrom3R(c7, c2, c3) |
c7,c2,c3 repeated | |
const Simd4Real | rSimd4_m0m1m2 = setSimd4RealFrom3R(-c0, -c1, -c2) |
-c0,-c1,-c2 repeated | |
const Simd4Real | rSimd4_m3m0m4 = setSimd4RealFrom3R(-c3, -c0, -c4) |
-c3,-c0,-c4 repeated | |
const Simd4Real | rSimd4_2p25 = setSimd4RealFrom1R(2.25) |
Value that rounds down. | |
const Simd4Real | rSimd4_3p75 = setSimd4RealFrom1R(3.75) |
Value that rounds up. | |
const Simd4Real | rSimd4_m2p25 = setSimd4RealFrom1R(-2.25) |
Negative value that rounds up. | |
const Simd4Real | rSimd4_m3p75 = setSimd4RealFrom1R(-3.75) |
Negative value that rounds down. More... | |
const Simd4Real | rSimd4_logicalA = setSimd4RealFrom1R(1.3333282470703125) |
Bit pattern to test logical ops. | |
const Simd4Real | rSimd4_logicalB = setSimd4RealFrom1R(1.79998779296875) |
Bit pattern to test logical ops. | |
const Simd4Real | rSimd4_logicalResultAnd = setSimd4RealFrom1R(1.26666259765625) |
Result or bitwise 'and' of A and B. | |
const Simd4Real | rSimd4_logicalResultOr = setSimd4RealFrom1R(1.8666534423828125) |
Result or bitwise 'or' of A and B. | |
const Simd4Real | rSimd4_Exp |
Three large floating-point values whose exponents are >32. | |
const Simd4Real | rSimd4_Bits1 |
Pattern F0 repeated to fill single/double. | |
const Simd4Real | rSimd4_Bits2 |
Pattern CC repeated to fill single/double. | |
const Simd4Real | rSimd4_Bits3 |
Pattern C0 repeated to fill single/double. | |
const Simd4Real | rSimd4_Bits4 |
Pattern 0C repeated to fill single/double. | |
const Simd4Real | rSimd4_Bits5 |
Pattern FC repeated to fill single/double. | |
const Simd4Real | rSimd4_Bits6 |
Pattern 3C repeated to fill single/double. | |
static const char * | g_butaneTopFileFormatString |
Format string for building a configurable .top file. | |
static bool | g_bDeleteFilesAfterTest = true |
Controls whether TestFileManager should delete temporary files after the test finishes. More... | |
void gmx::test::applyLincs | ( | ConstraintsTestData * | testData, |
t_pbc | pbc | ||
) |
Initialize and apply LINCS constraints.
Apply LINCS constraints to the test data.
[in] | testData | Test data structure. |
[in] | pbc | Periodic boundary data. |
void gmx::test::applyLincsCuda | ( | ConstraintsTestData * | testData, |
t_pbc | pbc | ||
) |
Apply CUDA version of LINCS constraints to the test data.
All the data is copied to the GPU device, then LINCS is applied and the resulting coordinates are copied back.
void gmx::test::applySettle | ( | SettleTestData * | testData, |
t_pbc | pbc, | ||
bool | updateVelocities, | ||
bool | calcVirial, | ||
const std::string & | testDescription | ||
) |
Apply SETTLE using CPU version of the algorithm.
Initializes SETTLE object, applies algorithm, destroys the object. The coordinates, velocities and virial are updated in the testData object.
[in,out] | testData | An object, containing all the data structures needed by SETTLE. |
[in] | pbc | Periodic boundary setup. |
[in] | updateVelocities | If the velocities should be updated. |
[in] | calcVirial | If the virial should be computed. |
[in] | testDescription | Brief description that will be printed in case of test failure. |
void gmx::test::applySettleGpu | ( | SettleTestData * | testData, |
t_pbc | pbc, | ||
bool | updateVelocities, | ||
bool | calcVirial, | ||
const std::string & | testDescription | ||
) |
Apply SETTLE using GPU version of the algorithm.
Initializes SETTLE object, copied data to the GPU, applies algorithm, copies the data back, destroys the object. The coordinates, velocities and virial are updated in the testData object.
[in,out] | testData | An object, containing all the data structures needed by SETTLE. |
[in] | pbc | Periodic boundary setup. |
[in] | updateVelocities | If the velocities should be updated. |
[in] | calcVirial | If the virial should be computed. |
[in] | testDescription | Brief description that will be printed in case of test failure. |
void gmx::test::applyShake | ( | ConstraintsTestData * | testData, |
t_pbc | pbc | ||
) |
Initialize and apply SHAKE constraints.
Apply SHAKE constraints to the test data.
[in] | testData | Test data structure. |
[in] | pbc | Periodic boundary data. |
void gmx::test::callAddGlobalTestEnvironment | ( | ) |
This constructs the test environment during setup of the unit test so that they can use the hardware context.
Implement a stub definition for tests that don't ask for a real one.
Declare a function that all unit test implementations can use to set up any environment that they need.
When registering the unit test in CMake, the HARDWARE_DETECTION flag requires that the code for that unit test implements this function. Otherwise, a default stub implementation is provided.
This approach conforms to the recommendation by GoogleTest to arrange for the code that sets up the global test environment to be called from main, rather than potentially rely on brittle static initialization order.
ArrayRef<char> gmx::test::charArrayRefFromArray | ( | T * | data, |
size_t | size | ||
) |
Convenience function to transform a view into one with base type of (non-const) char.
This transformation is useful for using containers with C APIs where the function signature is not declared const even where the semantics of the usage actually are const.
[in] | data | The data pointer. |
[in] | size | The size of the data pointer (in T). |
T | The base type of the container |
void gmx::test::checkConfFile | ( | TextInputStream * | input, |
TestReferenceChecker * | checker, | ||
const ConfMatchSettings & | settings | ||
) |
Adds content of a gro file to TestReferenceChecker object.
[in] | input | Stream that provides the gro content. |
[in,out] | checker | Checker to use. |
[in] | settings | Settings to use for matching. |
Parses a gro file from the input stream, and checks the contents against reference data (only first two lines for now).
void gmx::test::checkEnergiesAgainstReferenceData | ( | const std::string & | energyFilename, |
const EnergyTermsToCompare & | energyTermsToCompare, | ||
TestReferenceChecker * | checker | ||
) |
Check a subset of the energies found in an energy file against reference data.
Opens the energy file, loops over all frames, matching the indicated energies against refdata at the given tolerance.
[in] | energyFilename | The name of an energy file. |
[in] | energyTermsToCompare | Set of energies to match at given tolerances. |
[in] | checker | Root checker for reference data. |
void gmx::test::checkXvgFile | ( | TextInputStream * | input, |
TestReferenceChecker * | checker, | ||
const XvgMatchSettings & | settings | ||
) |
Adds content of xvg file to TestReferenceChecker object.
[in] | input | Stream that provides the xvg content. |
[in,out] | checker | Checker to use. |
[in] | settings | Settings to use for matching. |
Parses an xvg file from the input stream, and checks the contents against reference data. settings
can be used to customize the matching. Only a single data set is supported (but multiple columns work). A subset of xmgrace formatting is also checked; static content that is nearly always the same is skipped.
|
static |
Compares the box from reference
and test
according to the matchSettings
and tolerance
.
|
inline |
Create minimal TrajectoryFrameWriter using the provided builder.
[in] | filename | Name of file to create object for. |
[in] | topology | Reference to input top. |
[in] | selection | Reference to input selection. |
[in] | requirements | Requirements for constructing OutputManagar. |
InconsistentInputError | When builder can not create the CoordinateFile. |
void gmx::test::done_enxframe | ( | t_enxframe * | fr | ) |
Helper function to clean up resources.
Helper function to free resources (NB free_enxframe only frees the contents, not the pointer itself)
void gmx::test::done_trxframe | ( | t_trxframe * | fr | ) |
Helper function to clean up resources.
Helper function to free all resources.
testing::Matcher< std::tuple< double, double > > gmx::test::DoubleEq | ( | const FloatingPointTolerance & | tolerance | ) |
Make matcher for doubles for use with GoogleMock that compare equal when tolerance
is satisifed.
Used like
EXPECT_THAT(testDoubles, Pointwise(DoubleEq(tolerance), referenceDoubles));
void gmx::test::executeRerunTest | ( | Args &&... | args | ) |
Run and compare a simulator run to its rerun.
Run grompp, run mdrun and rerun the resulting trajectory. Compare energies (via EnergyComparator) and trajectories.
void gmx::test::executeSimulatorComparisonTest | ( | const std::string & | environmentVariable, |
Args &&... | args | ||
) |
Run and compare a simulator run with and without an environment variable.
Run grompp, and repeat mdrun with and without the environment variable set. Compare energies (via EnergyComparator) and trajectories.
testing::Matcher< std::tuple< float, float > > gmx::test::FloatEq | ( | const FloatingPointTolerance & | tolerance | ) |
Make matcher for floats for use with GoogleMock that compare equal when tolerance
is satisifed.
Used like
EXPECT_THAT(testFloats, Pointwise(FloatEq(tolerance), referenceFloats));
void gmx::test::integrateLeapFrogGpu | ( | LeapFrogTestData * | testData, |
int | numSteps | ||
) |
Integrate using CUDA version of Leap-Frog.
Copies data from CPU to GPU, integrates the equation of motion for requested number of steps using Leap-Frog algorithm, copies the result back.
[in] | testData | Data needed for the integrator |
[in] | numSteps | Total number of steps to run integration for. |
void gmx::test::integrateLeapFrogSimple | ( | LeapFrogTestData * | testData, |
int | numSteps | ||
) |
Integrate using CPU version of Leap-Frog.
[in] | testData | Data needed for the integrator |
[in] | numSteps | Total number of steps to run integration for. |
bool gmx::test::isNumberOfPpRanksSupported | ( | const std::string & | simulationName, |
int | possibleNumberOfPpRanks | ||
) |
Return whether the number of ranks is supported by the simulation simulationName
in the database.
This method lets test runners understand when end-to-end tests should be expected to work.
EnergyFrameReaderPtr gmx::test::openEnergyFileToReadTerms | ( | const std::string & | filename, |
const std::vector< std::string > & | requiredEnergyTermNames | ||
) |
Open the file and return an object that can read the required terms from frames of an .edr file.
[in] | filename | Name of the energy file to use |
[in] | requiredEnergyTermNames | Names of the energy terms that the caller requires to be present for an .edr file frame to be considered valid |
FileIOError | If the .edr file cannot be opened |
APIError | If any required energy term is not present in the file |
std::bad_alloc | When out of memory |
This function is intended to have the main responsibility for making EnergyFrameReader objects.
void gmx::test::pmeInitAtoms | ( | gmx_pme_t * | pme, |
StatePropagatorDataGpu * | stateGpu, | ||
const CodePath | mode, | ||
const CoordinatesVector & | coordinates, | ||
const ChargesVector & | charges | ||
) |
PME initialization with atom data.
PME initialization with atom data and system box.
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.
Simple PME initialization (no atom data)
void gmx::test::pmePerformSplineAndSpread | ( | gmx_pme_t * | pme, |
CodePath | mode, | ||
bool | computeSplines, | ||
bool | spreadCharges | ||
) |
PME spline calculation and charge spreading.
PME spline computation and charge spreading.
void gmx::test::pmeSetGridLineIndices | ( | gmx_pme_t * | pme, |
CodePath | mode, | ||
const GridLineIndicesVector & | gridLineIndices | ||
) |
Setting gridline indices to be used in spread/gather.
Setting gridline indices be used in spread/gather.
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.
Setting atom spline values or derivatives to be used in spread/gather.
MdpFieldValues gmx::test::prepareMdpFieldValues | ( | const std::string & | simulationName, |
const std::string & | integrator, | ||
const std::string & | tcoupl, | ||
const std::string & | pcoupl | ||
) |
Set up values for an .mdp file that permits a highly reproducible simulation.
An internal database of several kinds of simulation useful for such comparisons is available, whose simulationName
keys are
Some of these systems are pretty minimal, because having few atoms means few interactions, highly reproducible forces, and allows tests to focus on the correctness of the implementation of high-level mdrun features. The boxes are of a reasonable size so that domain decomposition is possible. The pressure-coupling parameters are isotropic, and set up so that there will not be dramatic collapse of volume over the handful of MD steps that will be run. A single temperature-coupling group is used.
[in] | simulationName | The name of the simulation, which indexes the database |
[in] | integrator | The integrator to use |
[in] | tcoupl | The temperature-coupling algorithm to use |
[in] | pcoupl | The pressure-coupling algorithm to use |
std::bad_alloc | if out of memory std::out_of_range if simulationName is not in the database |
MdpFieldValues gmx::test::prepareMdpFieldValues | ( | const char * | simulationName, |
const char * | integrator, | ||
const char * | tcoupl, | ||
const char * | pcoupl | ||
) |
Set up values for an .mdp file that permits a highly reproducible simulation.
An internal database of several kinds of simulation useful for such comparisons is available, whose simulationName
keys are
Some of these systems are pretty minimal, because having few atoms means few interactions, highly reproducible forces, and allows tests to focus on the correctness of the implementation of high-level mdrun features. The boxes are of a reasonable size so that domain decomposition is possible. The pressure-coupling parameters are isotropic, and set up so that there will not be dramatic collapse of volume over the handful of MD steps that will be run. A single temperature-coupling group is used.
[in] | simulationName | The name of the simulation, which indexes the database |
[in] | integrator | The integrator to use |
[in] | tcoupl | The temperature-coupling algorithm to use |
[in] | pcoupl | The pressure-coupling algorithm to use |
std::bad_alloc | if out of memory std::out_of_range if simulationName is not in the database |
std::string gmx::test::prepareMdpFileContents | ( | const MdpFieldValues & | mdpFieldValues | ) |
Make a string containing an .mdp file from the mdpFieldValues
.
std::bad_alloc | if out of memory |
|
static |
Help put all atom coordinates in frame
into its box.
This can perhaps go away when frame->x is a container.
|
static |
Reads a tpr for the test.
Reads a tpr to have access to the system information for print out.
[in] | tprHandle | Handle to the tpr to red in. |
[in] | mtop | Pointer to topology datastructure to populate. |
[in] | ir | Pointer to inputrec to populate. |
testing::Matcher< std::tuple< real, real > > gmx::test::RealEq | ( | const FloatingPointTolerance & | tolerance | ) |
Make matcher for reals for use with GoogleMock that compare equal when tolerance
is satisifed.
Used like
EXPECT_THAT(testReals, Pointwise(RealEq(tolerance), referenceReals));
testing::Matcher< std::tuple< RVec, RVec > > gmx::test::RVecEq | ( | const FloatingPointTolerance & | tolerance | ) |
Make matcher for RVecs for use with GoogleMock that compare equal when tolerance
is satisifed.
Used like
EXPECT_THAT(testRVecs, Pointwise(RVecEq(tolerance), referenceRVecs));
|
static |
Return whether the comparisonConditions
and emptiness of reference and test frames means that a comparison should be attempted.
This allows the framework to determine whether it is an error if a comparison cannot be made.
|
static |
Helper function to split string with multiple values into option settings.
[in] | assigner | Options assigner to use. |
[in] | optionValues | String to split that contains option values. |
[in] | type | Determine which input time we are using. |
|
static |
Throw a TestException if the caller tries to write particular refdata that can't work.
If the string to write is non-empty and has only whitespace, TinyXML2 can't read it correctly, so throw an exception for this case, so that we can't accidentally use it and run into mysterious problems.
const char* const gmx::test::anySupported[] |
Names here work for stuff that has no specific requirements.
PDB and GRO format are not tested here because they also require atoms information that is incompatible with the other output formats.
|
static |
Controls whether TestFileManager should delete temporary files after the test finishes.
const double gmx::test::g_coords[] |
Database of 21 test coordinates that represent a trajectory */.
const char* const gmx::test::setAtomsSupported[] |
Names here work for setAtoms module.
const char* const gmx::test::setForceSupported[] |
Names here work for setForce module.
const char* const gmx::test::setForceUnSupported[] |
Names here don't work for setForce module.
const char* const gmx::test::setPrecisionSupported[] |
Names here work for setPrecision module.
const char* const gmx::test::setPrecisionUnSupported[] |
Names here don't work for setPrecision module.
const char* const gmx::test::setVelocitySupported[] |
Names here work for setVelocity module.
const char* const gmx::test::trajectoryFileNames[] |
Character array of different file names to test.