Gromacs
2016.6
|
#include <programs/mdrun/tests/moduletest.h>
Helper object for running grompp and mdrun in integration tests of mdrun functionality.
Objects of this class are intended to be owned by IntegrationTestFixture objects, and an IntegrationTestFixture object might own more than one SimulationRunner.
The setup phase creates various temporary files for input and output that are common for mdrun tests, using the file manager object of the fixture that owns this object. Individual tests should create any extra filenames similarly, so that the test users's current working directory does not get littered with files left over from tests.
Any method in this class may throw std::bad_alloc if out of memory.
By default, the convenience methods callGrompp() and callMdrun() just prepare and run a default call to mdrun. If there is a need to customize the command-line for grompp or mdrun (e.g. to invoke -maxwarn n, or -reprod), then make a CommandLine object with the appropriate flags and pass that into the routines that accept such.
Public Member Functions | |
SimulationRunner (IntegrationTestFixture *fixture_) | |
Constructor, which establishes the fixture that will own each object. | |
void | useEmptyMdpFile () |
Use an empty .mdp file as input to grompp. | |
void | useStringAsMdpFile (const char *mdpString) |
Use a given string as input to grompp. | |
void | useStringAsMdpFile (const std::string &mdpString) |
Use a given string as input to grompp. | |
void | useStringAsNdxFile (const char *ndxString) |
Use a string as -n input to grompp. | |
void | useTopGroAndNdxFromDatabase (const char *name) |
Use a standard .top and .gro file as input to grompp. | |
void | useGroFromDatabase (const char *name) |
Use a standard .gro file as input to grompp. | |
int | callGrompp (const CommandLine &callerRef) |
Calls grompp (on rank 0, with a customized command line) to prepare for the mdrun test. | |
int | callGrompp () |
Convenience wrapper for a default call to callGrompp . | |
int | callGromppOnThisRank (const CommandLine &callerRef) |
Calls grompp (on this rank, with a customized command line) to prepare for the mdrun test. | |
int | callGromppOnThisRank () |
Convenience wrapper for a default call to callGromppOnThisRank . | |
int | callMdrun (const CommandLine &callerRef) |
Calls mdrun for testing with a customized command line. | |
int | callMdrun () |
Convenience wrapper for calling mdrun for testing with default command line. | |
Public Attributes | |
Names for frequently used grompp and mdrun output files | |
These strings can be set to point to files present in the source tree, or to temporary files created for the test fixture. In the latter case, IntegrationTestFixture::fileManager_ should be used to fill these strings with paths to files, so that they are created in a temporary directory and (by default behaviour of TestFileManager) deleted when the test is complete. | |
std::string | topFileName_ |
std::string | groFileName_ |
std::string | fullPrecisionTrajectoryFileName_ |
std::string | reducedPrecisionTrajectoryFileName_ |
std::string | groOutputFileName_ |
std::string | ndxFileName_ |
std::string | mdpInputFileName_ |
std::string | mdpOutputFileName_ |
std::string | tprFileName_ |
std::string | logFileName_ |
std::string | edrFileName_ |
std::string | cptFileName_ |
std::string | swapFileName_ |
int | nsteps_ |