Main plumed object. More...
#include <PlumedMain.h>
Public Member Functions | |
std::string | cite (const std::string &) |
Add a citation, returning a string containing the reference number, something like "[10]". More... | |
PlumedMain () | |
void | cmd (const std::string &key, void *val=NULL) |
cmd method, accessible with standard Plumed.h interface. More... | |
~PlumedMain () | |
void | readInputFile (std::string str) |
Read an input file. More... | |
void | readInputWords (const std::vector< std::string > &str) |
Read an input string. More... | |
void | init () |
Initialize the object. More... | |
void | prepareCalc () |
Prepare the calculation. More... | |
void | prepareDependencies () |
Prepare the list of active Actions and needed atoms. More... | |
void | shareData () |
Share the needed atoms. More... | |
void | performCalc () |
Perform the calculation. More... | |
void | calc () |
Complete PLUMED calculation. More... | |
void | waitData () |
Scatters the needed atoms. More... | |
void | justCalculate () |
Perform the forward loop on active actions. More... | |
void | justApply () |
Perform the backward loop on active actions. More... | |
void | runJobsAtEndOfCalculation () |
If there are calculations that need to be done at the very end of the calculations this makes sures they are done. More... | |
Atoms & | getAtoms () |
Reference to atoms object. More... | |
const ActionSet & | getActionSet () const |
Reference to the list of Action's. More... | |
Log & | getLog () |
Referenge to the log stream. More... | |
long int | getStep () const |
Return the number of the step. More... | |
void | exit (int c=0) |
Stop the run. More... | |
void | load (const std::string &) |
Load a shared library. More... | |
const std::string & | getSuffix () const |
Get the suffix string. More... | |
void | setSuffix (const std::string &) |
Set the suffix string. More... | |
double | getBias () const |
get the value of the bias More... | |
FILE * | fopen (const char *path, const char *mode) |
Opens a file. More... | |
int | fclose (FILE *fp) |
Closes a file opened with PlumedMain::fopen() More... | |
void | insertFile (FileBase &) |
Insert a file. More... | |
void | eraseFile (FileBase &) |
Erase a file. More... | |
void | fflush () |
Flush all files. More... | |
bool | getRestart () const |
Check if restarting. More... | |
void | setRestart (bool f) |
Set restart flag. More... | |
void | setExchangeStep (bool f) |
Set exchangeStep flag. More... | |
bool | getExchangeStep () const |
Get exchangeStep flag. More... | |
void | stop () |
Stop the calculation cleanly (both the MD code and plumed) More... | |
void | resetActive (bool active) |
Enforce active flag. More... | |
ExchangePatterns & | getExchangePatterns () |
Access to exchange patterns. More... | |
void | cmd (const std::string &key, const void *val) |
Const val version, which indeed just overrides the const and call the virtual method. More... | |
Public Attributes | |
Communicator & | comm |
Communicator for plumed. More... | |
Communicator & | multi_sim_comm |
bool | novirial |
Flag to switch off virial calculation (for debug and MD codes with no barostat) More... | |
bool | detailedTimers |
Flag to switch on detailed timers. More... | |
Private Types | |
typedef std::set< FileBase * > ::iterator | files_iterator |
Private Attributes | |
DLLoader & | dlloader |
WithCmd * | cltool |
Stopwatch & | stopwatch |
WithCmd * | grex |
bool | initialized |
Flag to avoid double initialization. More... | |
std::string | MDEngine |
Name of MD engine. More... | |
Log & | log |
Log stream. More... | |
Citations & | citations |
tools/Citations.holder More... | |
long int | step |
Present step number. More... | |
bool | active |
Condition for plumed to be active. More... | |
std::string | plumedDat |
Name of the input file. More... | |
Atoms & | atoms |
Object containing information about atoms (such as positions,...). More... | |
ActionSet & | actionSet |
Set of actions found in plumed.dat file. More... | |
std::vector< ActionPilot * > | pilots |
Set of Pilot actions. More... | |
std::string | suffix |
Suffix string for file opening, useful for multiple simulations in the same directory. More... | |
double | bias |
The total bias (=total energy of the restraints) More... | |
ExchangePatterns & | exchangePatterns |
Class of possible exchange patterns, used for BIASEXCHANGE but also for future parallel tempering. More... | |
bool | exchangeStep |
Set to true if on an exchange step. More... | |
bool | restart |
Flag for restart. More... | |
std::set< FileBase * > | files |
int * | stopFlag |
Stuff to make plumed stop the MD code cleanly. More... | |
bool | stopNow |
Main plumed object.
In MD engines this object is not manipulated directly but it is wrapped in plumed or PLMD::Plumed objects. Its main method is cmd(), which defines completely the external plumed interface. It does not contain any static data.
Definition at line 71 of file PlumedMain.h.
|
private |
Definition at line 132 of file PlumedMain.h.
PLMD::PlumedMain::PlumedMain | ( | ) |
Definition at line 51 of file PlumedMain.cpp.
PLMD::PlumedMain::~PlumedMain | ( | ) |
Definition at line 80 of file PlumedMain.cpp.
void PLMD::PlumedMain::calc | ( | ) |
Complete PLUMED calculation.
Shortcut for prepareCalc() + performCalc()
Definition at line 434 of file PlumedMain.cpp.
std::string PLMD::PlumedMain::cite | ( | const std::string & | item | ) |
Add a citation, returning a string containing the reference number, something like "[10]".
Definition at line 652 of file PlumedMain.cpp.
|
inlineinherited |
|
virtual |
cmd method, accessible with standard Plumed.h interface.
key | The name of the command to be executed. |
val | The argument of the command to be executed. It is called as plumed_cmd() or as PLMD::Plumed::cmd() It is the interpreter for plumed commands. It basically contains the definition of the plumed interface. If you want to add a new functionality to the interface between plumed and an MD engine, this is the right place Notice that this interface should always keep retro-compatibility |
Implements PLMD::WithCmd.
Definition at line 104 of file PlumedMain.cpp.
void PLMD::PlumedMain::eraseFile | ( | FileBase & | f | ) |
Erase a file.
Definition at line 666 of file PlumedMain.cpp.
void PLMD::PlumedMain::exit | ( | int | c = 0 | ) |
Stop the run.
Definition at line 422 of file PlumedMain.cpp.
int PLMD::PlumedMain::fclose | ( | FILE * | fp | ) |
Closes a file opened with PlumedMain::fopen()
Definition at line 648 of file PlumedMain.cpp.
void PLMD::PlumedMain::fflush | ( | ) |
Flush all files.
Definition at line 656 of file PlumedMain.cpp.
FILE * PLMD::PlumedMain::fopen | ( | const char * | path, |
const char * | mode | ||
) |
Opens a file.
Similar to plain fopen, but, if it finds an error in opening the file, it also tries with path+suffix. This trick is useful for multiple replica simulations.
Definition at line 637 of file PlumedMain.cpp.
|
inline |
Reference to the list of Action's.
Definition at line 283 of file PlumedMain.h.
|
inline |
Reference to atoms object.
Definition at line 288 of file PlumedMain.h.
double PLMD::PlumedMain::getBias | ( | ) | const |
get the value of the bias
Definition at line 633 of file PlumedMain.cpp.
|
inline |
Access to exchange patterns.
Definition at line 276 of file PlumedMain.h.
|
inline |
Get exchangeStep flag.
Definition at line 313 of file PlumedMain.h.
Log & PLMD::PlumedMain::getLog | ( | ) |
Referenge to the log stream.
Definition at line 426 of file PlumedMain.cpp.
|
inline |
Check if restarting.
Definition at line 303 of file PlumedMain.h.
|
inline |
Return the number of the step.
Definition at line 235 of file PlumedMain.h.
|
inline |
Get the suffix string.
Definition at line 293 of file PlumedMain.h.
void PLMD::PlumedMain::init | ( | ) |
void PLMD::PlumedMain::insertFile | ( | FileBase & | f | ) |
Insert a file.
Definition at line 662 of file PlumedMain.cpp.
void PLMD::PlumedMain::justApply | ( | ) |
Perform the backward loop on active actions.
Needed to apply the forces back.
Definition at line 548 of file PlumedMain.cpp.
void PLMD::PlumedMain::justCalculate | ( | ) |
Perform the forward loop on active actions.
Definition at line 508 of file PlumedMain.cpp.
void PLMD::PlumedMain::load | ( | const std::string & | ss | ) |
Load a shared library.
Definition at line 601 of file PlumedMain.cpp.
void PLMD::PlumedMain::performCalc | ( | ) |
Perform the calculation.
Shortcut for waitData() + justCalculate() + justApply()
Definition at line 494 of file PlumedMain.cpp.
void PLMD::PlumedMain::prepareCalc | ( | ) |
Prepare the calculation.
Here it is checked which are the active Actions and communication of the relevant atoms is initiated. Shortcut for prepareDependencies() + shareData()
Definition at line 439 of file PlumedMain.cpp.
void PLMD::PlumedMain::prepareDependencies | ( | ) |
Prepare the list of active Actions and needed atoms.
Scan the Actions to see which are active and which are not, so as to prepare a list of the atoms needed at this step.
Definition at line 449 of file PlumedMain.cpp.
void PLMD::PlumedMain::readInputFile | ( | std::string | str | ) |
void PLMD::PlumedMain::readInputWords | ( | const std::vector< std::string > & | str | ) |
Read an input string.
str | name of the string |
Definition at line 393 of file PlumedMain.cpp.
|
inline |
Enforce active flag.
This is a (bit dirty) hack to solve a bug. When there is no active ActionPilot, several shortcuts are used. However, these shortcuts can block GREX module. This function allows to enforce active plumed when doing exchanges, thus fixing the bug.
Definition at line 318 of file PlumedMain.h.
void PLMD::PlumedMain::runJobsAtEndOfCalculation | ( | ) |
If there are calculations that need to be done at the very end of the calculations this makes sures they are done.
Definition at line 674 of file PlumedMain.cpp.
|
inline |
Set exchangeStep flag.
Definition at line 308 of file PlumedMain.h.
|
inline |
Set restart flag.
Definition at line 261 of file PlumedMain.h.
|
inline |
Set the suffix string.
Definition at line 298 of file PlumedMain.h.
void PLMD::PlumedMain::shareData | ( | ) |
Share the needed atoms.
In asynchronous implementations, this method sends the required atoms to all the plumed processes, without waiting for the communication to complete.
Definition at line 486 of file PlumedMain.cpp.
void PLMD::PlumedMain::stop | ( | ) |
Stop the calculation cleanly (both the MD code and plumed)
Definition at line 670 of file PlumedMain.cpp.
void PLMD::PlumedMain::waitData | ( | ) |
Scatters the needed atoms.
In asynchronous implementations, this method waits for the communications started in shareData() to be completed. Otherwise, just send around needed atoms.
Definition at line 500 of file PlumedMain.cpp.
|
private |
Set of actions found in plumed.dat file.
Definition at line 110 of file PlumedMain.h.
|
private |
Condition for plumed to be active.
At every step, PlumedMain is checking if there are Action's requiring some work. If at least one Action requires some work, this variable is set to true.
Definition at line 101 of file PlumedMain.h.
|
private |
Object containing information about atoms (such as positions,...).
Definition at line 107 of file PlumedMain.h.
|
private |
The total bias (=total energy of the restraints)
Definition at line 120 of file PlumedMain.h.
|
private |
tools/Citations.holder
Definition at line 93 of file PlumedMain.h.
|
private |
Definition at line 83 of file PlumedMain.h.
Communicator& PLMD::PlumedMain::comm |
Communicator for plumed.
Includes all the processors used by plumed.
Definition at line 77 of file PlumedMain.h.
bool PLMD::PlumedMain::detailedTimers |
Flag to switch on detailed timers.
Definition at line 143 of file PlumedMain.h.
|
private |
Definition at line 81 of file PlumedMain.h.
|
private |
Class of possible exchange patterns, used for BIASEXCHANGE but also for future parallel tempering.
Definition at line 123 of file PlumedMain.h.
|
private |
Set to true if on an exchange step.
Definition at line 126 of file PlumedMain.h.
|
private |
Definition at line 131 of file PlumedMain.h.
|
private |
Definition at line 85 of file PlumedMain.h.
|
private |
Flag to avoid double initialization.
Definition at line 87 of file PlumedMain.h.
|
private |
Log stream.
Definition at line 91 of file PlumedMain.h.
|
private |
Name of MD engine.
Definition at line 89 of file PlumedMain.h.
Communicator& PLMD::PlumedMain::multi_sim_comm |
Definition at line 78 of file PlumedMain.h.
bool PLMD::PlumedMain::novirial |
Flag to switch off virial calculation (for debug and MD codes with no barostat)
Definition at line 140 of file PlumedMain.h.
|
private |
Set of Pilot actions.
These are the action the, if they are Pilot::onStep(), can trigger execution
Definition at line 114 of file PlumedMain.h.
|
private |
Name of the input file.
Definition at line 104 of file PlumedMain.h.
|
private |
Flag for restart.
Definition at line 129 of file PlumedMain.h.
|
private |
Present step number.
Definition at line 96 of file PlumedMain.h.
|
private |
Stuff to make plumed stop the MD code cleanly.
Definition at line 135 of file PlumedMain.h.
|
private |
Definition at line 136 of file PlumedMain.h.
|
private |
Definition at line 84 of file PlumedMain.h.
|
private |
Suffix string for file opening, useful for multiple simulations in the same directory.
Definition at line 117 of file PlumedMain.h.
Hosted by GitHub
![]() |
![]() |