2#ifndef STORMM_TEST_SYSTEM_MANAGER_H
3#define STORMM_TEST_SYSTEM_MANAGER_H
8#include "Accelerator/gpu_details.h"
9#include "Constants/behavior.h"
10#include "Constants/fixed_precision.h"
11#include "Constants/scaling.h"
12#include "FileManagement/file_listing.h"
13#include "Math/rounding.h"
14#include "Namelists/nml_dynamics.h"
15#include "Numerics/split_fixed_precision.h"
16#include "Random/random.h"
17#include "Synthesis/atomgraph_synthesis.h"
18#include "Synthesis/condensate.h"
19#include "Synthesis/phasespace_synthesis.h"
20#include "Synthesis/systemcache.h"
21#include "Topology/atomgraph.h"
22#include "Topology/atomgraph_enumerators.h"
23#include "Trajectory/coordinateframe.h"
24#include "Trajectory/coordinate_series.h"
25#include "Trajectory/phasespace.h"
26#include "test_environment.h"
31using card::GpuDetails;
32using constants::ExceptionResponse;
34using namelist::DynamicsControls;
35using numerics::hostDoubleToInt95;
36using numerics::hostSplitFPSum;
37using numerics::default_velocity_scale_bits;
38using numerics::default_force_scale_bits;
39using random::Xoshiro256ppGenerator;
40using synthesis::Condensate;
41using synthesis::AtomGraphSynthesis;
42using synthesis::PhaseSpaceSynthesis;
43using synthesis::PsSynthesisWriter;
44using synthesis::SystemCache;
45using topology::AtomGraph;
46using topology::UnitCellType;
47using trajectory::CoordinateFileKind;
48using trajectory::CoordinateFrame;
49using trajectory::CoordinateSeries;
50using trajectory::CoordinateSeriesWriter;
51using trajectory::PhaseSpace;
72 TestSystemManager(
const std::string &topology_base_in,
const std::string &topology_extn_in,
73 const std::vector<std::string> &topology_names_in,
74 const std::string &coordinate_base_in,
const std::string &coordinate_extn_in,
75 const std::vector<std::string> &coordinate_names_in,
76 ExceptionResponse policy = ExceptionResponse::WARN,
77 TestPriority fault_response_in = TestPriority::ABORT,
78 TestPriority all_go_response_in = TestPriority::CRITICAL,
81 TestSystemManager(
const std::string &topology_base_in,
const std::string &topology_extn_in,
82 const std::vector<std::string> &topology_names_in,
83 const std::string &coordinate_base_in,
const std::string &coordinate_extn_in,
84 const std::vector<std::string> &coordinate_names_in,
86 ExceptionResponse policy = ExceptionResponse::WARN);
89 const std::vector<std::string> &topology_names_in,
90 const std::string &coordinate_base_in,
91 const std::vector<std::string> &coordinate_names_in,
92 ExceptionResponse policy = ExceptionResponse::WARN,
93 TestPriority fault_response_in = TestPriority::ABORT,
94 TestPriority all_go_response_in = TestPriority::CRITICAL,
98 const std::vector<std::string> &topology_names_in,
99 const std::string &coordinate_base_in,
100 const std::vector<std::string> &coordinate_names_in,
102 ExceptionResponse policy = ExceptionResponse::WARN);
105 const std::vector<std::string> &coordinate_names_in,
106 ExceptionResponse policy = ExceptionResponse::WARN,
107 TestPriority fault_response_in = TestPriority::ABORT,
108 TestPriority all_go_response_in = TestPriority::CRITICAL,
112 const std::vector<std::string> &coordinate_names_in,
114 ExceptionResponse policy = ExceptionResponse::WARN);
127 int getSystemCount(
const std::vector<UnitCellType> &query_bc)
const;
240 template <
typename T>
242 double perturbation_sigma = 0.0,
243 int xrs_seed = 915083,
int scale_bits = 0)
const;
263 double perturbation_sigma = 0.0,
264 int xrs_seed = 7108262,
int scale_bits = 40,
265 int vel_bits = default_velocity_scale_bits,
266 int frc_bits = default_force_scale_bits)
const;
289 ExceptionResponse policy = ExceptionResponse::SILENT,
294 ExceptionResponse policy = ExceptionResponse::SILENT,
299 ExceptionResponse policy = ExceptionResponse::SILENT,
320 const std::vector<std::string> &x_name_list = {},
321 const std::vector<CoordinateFileKind> &x_type_list = {},
322 const std::vector<std::string> &r_name_list = {},
323 const std::vector<CoordinateFileKind> &r_type_list = {},
324 const std::vector<std::string> &label_list = {});
331 std::string topology_base;
334 std::string topology_extn;
336 std::string coordinate_base;
337 std::string coordinate_extn;
338 TestPriority fault_response;
339 TestPriority all_go_response;
344 std::vector<std::string> topology_names;
345 std::vector<std::string> coordinate_names;
346 std::vector<bool> topology_exist;
347 std::vector<bool> topology_success;
348 std::vector<bool> coordinate_exist;
349 std::vector<bool> coordinate_success;
350 std::vector<bool> compatibility;
355 std::vector<AtomGraph> all_topologies;
359 std::vector<PhaseSpace> all_coordinates;
365 void checkIndexing(
int index,
const char* caller)
const;
371#include "test_system_manager.tpp"
Pertinent aspects of one particular GPU. Condensing the data for each GPU in this manner helps to ens...
Definition gpu_details.h:27
Object to encapsulate molecular dynamics control information. Like other namelist encapsualtors,...
Definition nml_dynamics.h:123
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
Simple but central struct to store the primitive form of the collection of systems that most STORMM a...
Definition systemcache.h:63
Object for parsing as well as storing environment and command-line input relevant to unit testing (Te...
Definition test_environment.h:21
std::string getCoordinateExtension() const
Return the extension for coordinates.
Definition test_system_manager.cpp:407
AtomGraphSynthesis exportAtomGraphSynthesis(const std::vector< int > &index_key, ExceptionResponse policy=ExceptionResponse::SILENT, const GpuDetails &gpu=null_gpu) const
Get a synthesis of topologies based on a series of system indices from the manager.
Definition test_system_manager.cpp:573
std::string getTopologyExtension() const
Return the extension for topologies.
Definition test_system_manager.cpp:402
AtomGraph exportAtomGraph(int index) const
Export the topology for one system.
Definition test_system_manager.cpp:458
TestSystemManager()
The constructor takes lists of topologies, then lists of coordinates, with a one-to-one correspondenc...
Definition test_system_manager.cpp:47
std::string getTopologyBasePath() const
Return the base path for topologies.
Definition test_system_manager.cpp:392
std::string getCoordinateFile(int index) const
Return the full name of a coordinate file according to some index in the list.
Definition test_system_manager.cpp:418
CoordinateSeries< T > exportCoordinateSeries(const int base_system, int frame_count, double perturbation_sigma=0.0, int xrs_seed=915083, int scale_bits=0) const
Get a coordinate series out of the object, based on one system from its repository.
CoordinateFrame exportCoordinateFrame(int index) const
Get a copy of the coordinates for one system as a CoordinateFrame object.
Definition test_system_manager.cpp:446
PhaseSpaceSynthesis exportPhaseSpaceSynthesis(const std::vector< int > &index_key, double perturbation_sigma=0.0, int xrs_seed=7108262, int scale_bits=40, int vel_bits=default_velocity_scale_bits, int frc_bits=default_force_scale_bits) const
Get a synthesis of coordinates with fixed-precision storage ready for positions, velocities,...
Definition test_system_manager.cpp:516
int getSystemCount() const
Get the number of systems in the object.
Definition test_system_manager.cpp:277
TestPriority getTestingStatus() const
Get the planned course of action for subsequent tests in the event that a file is non-existent,...
Definition test_system_manager.cpp:424
const AtomGraph & getTopologyReference(int index) const
Get a const reference to the topology for one or more systems.
Definition test_system_manager.cpp:475
std::string getTopologyFile(int index) const
Return the full name of a topology file according to some index in the list.
Definition test_system_manager.cpp:412
AtomGraph * getTopologyPointer(int index)
Get a pointer to one or more topologies.
Definition test_system_manager.cpp:486
SystemCache exportSystemCache(const std::vector< int > &index_key, const TestEnvironment &oe, const std::vector< std::string > &x_name_list={}, const std::vector< CoordinateFileKind > &x_type_list={}, const std::vector< std::string > &r_name_list={}, const std::vector< CoordinateFileKind > &r_type_list={}, const std::vector< std::string > &label_list={})
Produce a SystemCache based on a compilation of the systems read into the manager.
Definition test_system_manager.cpp:607
PhaseSpace exportPhaseSpace(int index) const
Get a copy of the coordinates for one system as a PhaseSpace object.
Definition test_system_manager.cpp:452
std::vector< int > getQualifyingSystems(UnitCellType uc_choice) const
Get a list of all topologies meeting a specific unit cell type.
Definition test_system_manager.cpp:310
const PhaseSpace & viewCoordinates(int index)
Get a const reference to the coordinates for one or more systems.
Definition test_system_manager.cpp:464
std::string getCoordinateBasePath() const
Return the base path for coordinates.
Definition test_system_manager.cpp:397
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
Store the coordinates and box information for a frame, only. This abridged struct can serve when the ...
Definition coordinateframe.h:111
Store the coordinates and box information for a series of frames, in one of several levels of precisi...
Definition coordinate_series.h:137
An object to complement a topology and hold positions, velocities, and forces of all particles in a s...
Definition phasespace.h:141