Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
system_test::SystemTestRunner Class Reference
Collaboration diagram for system_test::SystemTestRunner:
Collaboration graph
[legend]

Public Member Functions

void runTest (bool const &compute_L2_norm_only=false, double const &maxAllowedL1Error=0.0, double const &maxAllowedError=0.0)
 Run the system test that has been set up.
 
void runL1ErrorTest (double const &maxAllowedL1Error, double const &maxAllowedError=1E-7)
 Compute the L1 error for each field compared to the initial conditions. Doesn't work with particle data.
 
void launchCholla ()
 Launch Cholla as it is set up.
 
void openHydroTestData ()
 
std::string getChollaPath ()
 Get the Cholla Path object.
 
std::string getChollaSettingsFilePath ()
 Get the Cholla Settings File Path object.
 
double getL2Norm ()
 Get the L2Norm.
 
std::string getOutputDirectory ()
 Get the Output Directory object.
 
std::string getConsoleOutputPath ()
 Get the Console Output Path object.
 
H5::H5File getFiducialFile ()
 Get the Fiducial File object.
 
H5::H5File getTestFile (size_t const &i=0)
 Get the Test File object.
 
std::vector< std::string > getDataSetsToTest ()
 Get the vector of datasets that will be tested.
 
void setFixedEpsilon (double const &newVal)
 Set the Fixed Epsilon value.
 
void setDataSetsToTest (std::vector< std::string > const &dataSetNames)
 Choose which datasets to test. By default it tests all the datasets in the fiducial data. A warning will be thrown if not all the datasets are being tested. Note that any call to this function will overwrite the default values.
 
void setCompareNumTimeSteps (bool const &compare)
 Set the Compare Num Time Steps object.
 
void setFiducialData (std::string const &fieldName, std::vector< double > const &dataVec)
 Set or add a fiducial dataset.
 
void setFiducialNumTimeSteps (int const &numTimeSteps)
 Set the Fiducial Num Time Steps object.
 
std::vector< double > generateConstantData (double const &value, size_t const &nx=1, size_t const &ny=1, size_t const &nz=1)
 Generate an vector of the specified size populated by the specified value.
 
std::vector< double > loadTestFieldData (std::string dataSetName, std::vector< size_t > &testDims, std::vector< H5::H5File > file={})
 Load the test data for physical fields from the HDF5 file(s). If there is more than one HDF5 file then it concatenates the contents into a single vector. Particle data is handeled with _loadTestParticleData.
 
std::vector< double > generateSineData (double const &offset, double const &amplitude, double const &kx, double const &ky, double const &kz, double const &phase, size_t const &nx=1, size_t const &ny=1, size_t const &nz=1)
 Generate a std::vector of the specified size populated by a sine wave. The equation used to generate the wave is:
 
 SystemTestRunner (bool const &particleData=false, bool const &hydroData=true, bool const &useFiducialFile=true, bool const &useSettingsFile=true, bool const &gravityData=false)
 Construct a new System Test Runner object.
 

Public Attributes

size_t numMpiRanks = 1
 The number of MPI ranks, defaults to 1.
 
system_test::ParamArgListBuilder chollaLaunchParams
 Set the parameters that Cholla launches with, potentially entirely replacing the need for a settings file. A string of the launch parameters that will override the values in the settings file (if given). Any of Cholla's standard launch paramters work except outdir as that is reserved for usage in the system_test::SystemTestRunner.runTest() method.
 

Constructor & Destructor Documentation

◆ SystemTestRunner()

system_test::SystemTestRunner::SystemTestRunner ( bool const &  particleData = false,
bool const &  hydroData = true,
bool const &  useFiducialFile = true,
bool const &  useSettingsFile = true,
bool const &  gravityData = false 
)

Construct a new System Test Runner object.

Parameters
[in]particleDataIs there particle data?
[in]hydroDataIs there hydro data?
[in]useFiducialFileIndicate if you're using a HDF5 file or will generate your own. Defaults to true, i.e. using an HDF5 file. Set to false to generate your own
[in]useSettingsFileIndicate if you're using a settings file. If true then the settings file is automatically found based on the naming convention. If false then the user MUST provide all the required settings with the SystemTestRunner::chollaLaunchParams member variable
[in]gravityDataIs there gravity data?

Member Function Documentation

◆ generateConstantData()

std::vector< double > system_test::SystemTestRunner::generateConstantData ( double const &  value,
size_t const &  nx = 1,
size_t const &  ny = 1,
size_t const &  nz = 1 
)

Generate an vector of the specified size populated by the specified value.

Parameters
[in]valueThe value to populate the vector with
[in]nx(optional) The size of the field in the x-direction. Defaults to 1
[in]ny(optional) The size of the field in the y-direction. Defaults to 1
[in]nz(optional) The size of the field in the z-direction. Defaults to 1
Returns
std::vector<double> A 1-dimensional std::vector of the required size containing the data.

◆ generateSineData()

std::vector< double > system_test::SystemTestRunner::generateSineData ( double const &  offset,
double const &  amplitude,
double const &  kx,
double const &  ky,
double const &  kz,
double const &  phase,
size_t const &  nx = 1,
size_t const &  ny = 1,
size_t const &  nz = 1 
)

Generate a std::vector of the specified size populated by a sine wave. The equation used to generate the wave is:

wave = offset + amplitude * sin(kx*xIndex + ky*yIndex + kz*zIndex + phase)

Parameters
[in]offsetFlat offset from zero
[in]amplitudeAmplitude of the wave
[in]kxThe x component of the wave vector in pixel units
[in]kyThe y component of the wave vector in pixel units
[in]kzThe z component of the wave vector in pixel units
[in]phasePhase of the sine wave
[in]nx(optional) The size of the field in the x-direction. Defaults to 1
[in]ny(optional) The size of the field in the y-direction. Defaults to 1
[in]nz(optional) The size of the field in the z-direction. Defaults to 1
Returns
std::vector<double> A 1-dimensional std::vector of the required size containing the data.

◆ getChollaPath()

std::string system_test::SystemTestRunner::getChollaPath ( )
inline

Get the Cholla Path object.

Returns
std::string The path to the Cholla executable

◆ getChollaSettingsFilePath()

std::string system_test::SystemTestRunner::getChollaSettingsFilePath ( )
inline

Get the Cholla Settings File Path object.

Returns
std::string The full filename/path to the settings file used to initialize Cholla

◆ getConsoleOutputPath()

std::string system_test::SystemTestRunner::getConsoleOutputPath ( )
inline

Get the Console Output Path object.

Returns
std::string The full filename/path to the file where all the console output is stored

◆ getDataSetsToTest()

std::vector< std::string > system_test::SystemTestRunner::getDataSetsToTest ( )
inline

Get the vector of datasets that will be tested.

Returns
std::vector<std::string>

◆ getFiducialFile()

H5::H5File system_test::SystemTestRunner::getFiducialFile ( )
inline

Get the Fiducial File object.

Returns
H5::H5File

◆ getL2Norm()

double system_test::SystemTestRunner::getL2Norm ( )
inline

Get the L2Norm.

Returns
double The L2Norm of the last run test

◆ getOutputDirectory()

std::string system_test::SystemTestRunner::getOutputDirectory ( )
inline

Get the Output Directory object.

Returns
std::string The path to the directory where all the output is stored

◆ getTestFile()

H5::H5File system_test::SystemTestRunner::getTestFile ( size_t const &  i = 0)
inline

Get the Test File object.

Parameters
indexThe MPI rank of the file you want to return. Defaults to 0
Returns
H5::H5File

◆ loadTestFieldData()

std::vector< double > system_test::SystemTestRunner::loadTestFieldData ( std::string  dataSetName,
std::vector< size_t > &  testDims,
std::vector< H5::H5File >  file = {} 
)

Load the test data for physical fields from the HDF5 file(s). If there is more than one HDF5 file then it concatenates the contents into a single vector. Particle data is handeled with _loadTestParticleData.

Parameters
[in]dataSetNameThe name of the dataset to get
[out]testDimsAn vector with the length of each dimension in it
[in]file(optional) The vector of HDF5 files to load
Returns
std::vector<double> A vector containing the data

◆ runL1ErrorTest()

void system_test::SystemTestRunner::runL1ErrorTest ( double const &  maxAllowedL1Error,
double const &  maxAllowedError = 1E-7 
)

Compute the L1 error for each field compared to the initial conditions. Doesn't work with particle data.

Parameters
[in]maxAllowedL1ErrorThe maximum allowed L1 error for this test
[in]maxAllowedErrorThe maximum allowed for any value in the test

Only run if this variable is set to true. Generally this and globalCompareSystemTestResults should only be used for large MPI / tests where the user wishes to separate the execution of cholla and the / comparison of results onto different machines/jobs

If set to false then no comparison will be performed. Generally this and globalRunCholla should only be used for large MPI tests where the user wishes to separate the execution of cholla and the comparison of results onto different machines/jobs

◆ runTest()

void system_test::SystemTestRunner::runTest ( bool const &  compute_L2_norm_only = false,
double const &  maxAllowedL1Error = 0.0,
double const &  maxAllowedError = 0.0 
)

Run the system test that has been set up.

Only run if this variable is set to true. Generally this and globalCompareSystemTestResults should only be used for large MPI / tests where the user wishes to separate the execution of cholla and the / comparison of results onto different machines/jobs

If set to false then no comparison will be performed. Generally this and globalRunCholla should only be used for large MPI tests where the user wishes to separate the execution of cholla and the comparison of results onto different machines/jobs

◆ setCompareNumTimeSteps()

void system_test::SystemTestRunner::setCompareNumTimeSteps ( bool const &  compare)
inline

Set the Compare Num Time Steps object.

Parameters
[in]compareDefaults to true. If false then the number of timesteps is not compared.

◆ setDataSetsToTest()

void system_test::SystemTestRunner::setDataSetsToTest ( std::vector< std::string > const &  dataSetNames)
inline

Choose which datasets to test. By default it tests all the datasets in the fiducial data. A warning will be thrown if not all the datasets are being tested. Note that any call to this function will overwrite the default values.

Parameters
[in]dataSetNamesA std::vector of std::strings where each entry is a dataset name. Note that it is case sensitive

◆ setFiducialData()

void system_test::SystemTestRunner::setFiducialData ( std::string const &  fieldName,
std::vector< double > const &  dataVec 
)

Set or add a fiducial dataset.

Parameters
[in]fieldNameThe name of the field to be added
[in]dataArrThe std::vector for the data vector to be added as a data set

◆ setFiducialNumTimeSteps()

void system_test::SystemTestRunner::setFiducialNumTimeSteps ( int const &  numTimeSteps)
inline

Set the Fiducial Num Time Steps object.

Parameters
numTimeStepsThe number of time steps in the fiducial data

◆ setFixedEpsilon()

void system_test::SystemTestRunner::setFixedEpsilon ( double const &  newVal)
inline

Set the Fixed Epsilon value.

Parameters
[in]newValThe new value of fixed epsilon

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