SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Base class for logging SSAGES data. More...
#include <Logger.h>
Public Member Functions | |
Logger (unsigned int frequency, const std::string &filename, const MPI_Comm &world, const MPI_Comm &comm) | |
Constructor. More... | |
virtual void | PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call prior to simulation initiation. More... | |
virtual void | PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call post integration. More... | |
virtual void | PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call post simulation. More... | |
void | SetCVMask (const std::vector< unsigned int > &mask) |
Sets the collective variable mask. More... | |
void | SetAppend (bool append) |
Set append mode. More... | |
virtual | ~Logger () |
Destructor. | |
Public Member Functions inherited from SSAGES::EventListener | |
EventListener (unsigned int frequency) | |
Constructor. More... | |
unsigned int | GetFrequency () const |
Get frequency of event listener. More... | |
virtual | ~EventListener () |
Destructor. | |
Static Public Member Functions | |
static Logger * | Build (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a Logger from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::EventListener | |
static unsigned int | GetWalkerID (const MPI_Comm &world, const MPI_Comm &comm) |
Get walker ID number of specified communicator. More... | |
static unsigned int | GetNumWalkers (const MPI_Comm &world, const MPI_Comm &comm) |
Get total number of walkers in the simulation. More... | |
static bool | IsMasterRank (const MPI_Comm &comm) |
Check if current processor is master. More... | |
Protected Attributes | |
mxx::comm | world_ |
Global MPI communicator. | |
mxx::comm | comm_ |
Local MPI communicator. | |
std::vector< unsigned int > | cvmask_ |
Mask which identifies which CVs to log. | |
std::string | filename_ |
Name of logfile. | |
std::ofstream | log_ |
Log file stream. | |
bool | append_ |
Append mode? | |
Base class for logging SSAGES data.
The base class for logging useful data in SSAGES that is not necessarily written out by methods. Primarily this includes the value(s) of the collective variable(s) on the various walkers over time, the magnitude of the bias if a method supports it, and so on.
|
inline |
Constructor.
frequency | Frequency of logging. |
filename | File for logging. |
world | Global MPI communicator. |
comm | MPI communicator of walker. |
Constructs an instance of a logger.
Definition at line 69 of file Logger.h.
|
static |
Build a Logger from JSON node.
json | JSON Value containing all input information. |
world | MPI global communicator. |
comm | MPI local communicator. |
path | Path for JSON path specification. |
Definition at line 75 of file Logger.cpp.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), and Json::ObjectRequirement::Validate().
Referenced by SSAGES::ResourceHandler::Build().
|
overridevirtual |
Logger call post integration.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called after each integration step.
Implements SSAGES::EventListener.
Definition at line 55 of file Logger.cpp.
References SSAGES::CVManager::GetCVs(), and SSAGES::Snapshot::GetIteration().
|
overridevirtual |
Logger call post simulation.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called after the end of the simulation run.
Implements SSAGES::EventListener.
Definition at line 71 of file Logger.cpp.
|
overridevirtual |
Logger call prior to simulation initiation.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called before the simulation is started.
Implements SSAGES::EventListener.
Definition at line 34 of file Logger.cpp.
References SSAGES::CVManager::GetCVs().
|
inline |
|
inline |