Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Classes | |
class | tinker::TestFile |
Writes a file to disk in its constructor and removes the file in its destructor, unless the file is set to be kept. More... | |
class | tinker::TestRemoveFileOnExit |
Removes the file in its destructor as necessary. More... | |
class | tinker::TestReference |
Reads reference values from a text file. More... | |
Macros | |
#define | COMPARE_INTS(i1, refi) REQUIRE(i1 == refi) |
Compares two integers. More... | |
#define | COMPARE_INTS_EPS(i1, refi, epsi) |
Approximately compares two integers. More... | |
#define | COMPARE_REALS(v1, refv, eps) REQUIRE(v1 == Approx(refv).margin(eps)) |
Compares two floating-point numbers with a margin of error. More... | |
#define | COMPARE_ENERGY(gpuptr, ref_eng, eps) |
Reduces the energy from the energy buffer and compares to the reference value with a margin of error. More... | |
#define | COMPARE_COUNT(gpuptr, ref_count) |
Reduces the number of interactions from the count buffer and compares to the reference value. More... | |
#define | COMPARE_VIR9(vir1, ref_v, eps) |
Compares a virial tensor to the reference values with a margin of error. More... | |
#define | COMPARE_VIR(gpuptr, ref_v, eps) |
Reduces a virial tensor from a virial buffer and compares to the reference values with a margin of error. More... | |
#define | COMPARE_VIR2(gpuptr, gpuptr2, ref_v, eps) |
Reduces two virial tensors from two virial buffers and compares the sum to the reference with a margin of error. More... | |
#define | COMPARE_GRADIENT(ref_grad, eps) COMPARE_GRADIENT2(ref_grad, eps, [](int, int) { return true; }) |
Copies out gradients from device to host and compares to the reference values with a margin of error. More... | |
#define | COMPARE_GRADIENT2(ref_grad, eps, check_ij) |
Compares the flitered gradients[i][j] components. More... | |
Functions | |
double | tinker::testGetEps (double epsSingle, double epsDouble) |
Returns tolerance eps depending on the predefined floating-point precision. More... | |
void | tinker::testBeginWithArgs (int argc, const char **argv) |
Initializes the test. More... | |
void | tinker::testEnd () |
Ends the test. More... | |
void | tinker::testMdInit (double t=0, double atm=0) |
Initializes MD in the test. More... | |
class tinker::TestFile |
Writes a file to disk in its constructor and removes the file in its destructor, unless the file is set to be kept.
Public Member Functions | |
TestFile (std::string src, std::string dst="", std::string extra="") | |
Copies file from source to destination with optional extra content appended to the new copy. More... | |
~TestFile () | |
Removes the file on disk on exit. More... | |
void | __keep () |
Prevents the file from being deleted. More... | |
tinker::TestFile::TestFile | ( | std::string | src, |
std::string | dst = "" , |
||
std::string | extra = "" |
||
) |
Copies file from source to destination with optional extra content appended to the new copy.
src | Path to the source file. If empty, extra will be written to dst which must be a valid path for the new file. |
dst | Path to the new file. If empty, the source file is copied to the current working directory. |
extra | Optional extra content. |
tinker::TestFile::~TestFile | ( | ) |
Removes the file on disk on exit.
void tinker::TestFile::__keep | ( | ) |
Prevents the file from being deleted.
class tinker::TestRemoveFileOnExit |
Removes the file in its destructor as necessary.
Public Member Functions | |
TestRemoveFileOnExit (std::string fileToDelete) | |
Filename. More... | |
~TestRemoveFileOnExit () | |
Removes the file in the destructor. More... | |
tinker::TestRemoveFileOnExit::TestRemoveFileOnExit | ( | std::string | fileToDelete | ) |
Filename.
tinker::TestRemoveFileOnExit::~TestRemoveFileOnExit | ( | ) |
Removes the file in the destructor.
class tinker::TestReference |
Reads reference values from a text file.
Public Member Functions | |
~TestReference () | |
TestReference (std::string pathToRefFile) | |
int | getCount () const |
double | getEnergy () const |
const double(* | getVirial () const)[3] |
const double(* | getGradient () const)[3] |
void | getEnergyCountByName (std::string name, double &energy, int &count) |
tinker::TestReference::~TestReference | ( | ) |
tinker::TestReference::TestReference | ( | std::string | pathToRefFile | ) |
int tinker::TestReference::getCount | ( | ) | const |
double tinker::TestReference::getEnergy | ( | ) | const |
void tinker::TestReference::getEnergyCountByName | ( | std::string | name, |
double & | energy, | ||
int & | count | ||
) |
const double(* tinker::TestReference::getGradient | ( | ) | )[3] const |
const double(* tinker::TestReference::getVirial | ( | ) | )[3] const |
#define COMPARE_COUNT | ( | gpuptr, | |
ref_count | |||
) |
Reduces the number of interactions from the count buffer and compares to the reference value.
#define COMPARE_ENERGY | ( | gpuptr, | |
ref_eng, | |||
eps | |||
) |
Reduces the energy from the energy buffer and compares to the reference value with a margin of error.
#define COMPARE_GRADIENT | ( | ref_grad, | |
eps | |||
) | COMPARE_GRADIENT2(ref_grad, eps, [](int, int) { return true; }) |
Copies out gradients from device to host and compares to the reference values with a margin of error.
#define COMPARE_GRADIENT2 | ( | ref_grad, | |
eps, | |||
check_ij | |||
) |
Compares the flitered gradients[i][j] components.
#define COMPARE_INTS | ( | i1, | |
refi | |||
) | REQUIRE(i1 == refi) |
Compares two integers.
#define COMPARE_INTS_EPS | ( | i1, | |
refi, | |||
epsi | |||
) |
Approximately compares two integers.
#define COMPARE_REALS | ( | v1, | |
refv, | |||
eps | |||
) | REQUIRE(v1 == Approx(refv).margin(eps)) |
Compares two floating-point numbers with a margin of error.
#define COMPARE_VIR | ( | gpuptr, | |
ref_v, | |||
eps | |||
) |
Reduces a virial tensor from a virial buffer and compares to the reference values with a margin of error.
#define COMPARE_VIR2 | ( | gpuptr, | |
gpuptr2, | |||
ref_v, | |||
eps | |||
) |
Reduces two virial tensors from two virial buffers and compares the sum to the reference with a margin of error.
#define COMPARE_VIR9 | ( | vir1, | |
ref_v, | |||
eps | |||
) |
Compares a virial tensor to the reference values with a margin of error.
void tinker::testBeginWithArgs | ( | int | argc, |
const char ** | argv | ||
) |
Initializes the test.
void tinker::testEnd | ( | ) |
Ends the test.
double tinker::testGetEps | ( | double | epsSingle, |
double | epsDouble | ||
) |
Returns tolerance eps depending on the predefined floating-point precision.
epsSingle | Larger eps value for lower floating-point precision. |
epsDouble | Smaller eps value for higher floating-point precision. |
void tinker::testMdInit | ( | double | t = 0 , |
double | atm = 0 |
||
) |
Initializes MD in the test.
t | Temperature in Kelvin. |
atm | Atmosphere in atm. |