SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Class that handles SSAGES resources for a simulation. More...
#include <ResourceHandler.h>
Public Member Functions | |
ResourceHandler (mxx::comm &&world, mxx::comm &&comm, size_t walkerid, const std::vector< class Method * > &methods, class CVManager *cvmanager) | |
Constructor. More... | |
std::string | GetInput () const |
Returns inputs of the walker for the current processor. More... | |
MPI_Comm | GetLocalComm () const |
Returns local (walker-specific) MPI communicator. More... | |
MPI_Comm | GetWorldComm () const |
Returns world (all processors) MPI communicator. More... | |
const mxx::comm & | GetLocalMxxComm () const |
Returns local (walker-specific) mxx communicator. More... | |
const mxx::comm & | GetWorldMxxComm () const |
Returns world (all processors) mxx communicator. More... | |
size_t | GetWalkerID () const |
Returns processor-specific walker ID. More... | |
size_t | GetNumWalkers () const |
Returns the total number of walkers across all processors. More... | |
void | ConfigureHook (class Hook *hook) |
Configure the Hook from given resources. More... | |
~ResourceHandler () | |
Destructor. | |
Static Public Member Functions | |
static ResourceHandler * | Build (const Json::Value &json, const MPI_Comm &world) |
Build a new ResourceHandler from JSON. More... | |
Private Attributes | |
mxx::comm | world_ |
MPI communicator containing all processors. | |
mxx::comm | comm_ |
MPI communicator containing processors for specific walker. | |
size_t | walkerid_ |
Walker ID for specific driver. | |
size_t | nwalkers_ |
Number of walkers. | |
class Snapshot * | snapshot_ |
Snapshot of system state (pointer). | |
std::vector< class Method * > | methods_ |
Vector of advanced sampling methods. | |
class Logger * | logger_ |
CV logger. | |
class CVManager * | cvmanager_ |
Collective variable manager. | |
class Hook * | hook_ |
Hook pointer. | |
std::vector< std::string > | inputs_ |
Input file vector. | |
Class that handles SSAGES resources for a simulation.
ResourceHandler is responsible for intialzing the major components of a simulation including the engine, methods, and collective variables. It is also responsible for the lifetime of the objects it creates.
Each simulation engine must implement a driver which calls this resource handler and passes it the appropriate hook.
Definition at line 44 of file ResourceHandler.h.
SSAGES::ResourceHandler::ResourceHandler | ( | mxx::comm && | world, |
mxx::comm && | comm, | ||
size_t | walkerid, | ||
const std::vector< class Method * > & | methods, | ||
class CVManager * | cvmanager | ||
) |
Constructor.
world | MPI communicator containing all processors. |
comm | MPI communicator containing walker-specific processors. |
walkerid | ID of the walker for the current processor. |
methods | Vector of pointers to methods. |
cvmanager | Pointer to CV manager. |
Definition at line 35 of file ResourceHandler.cpp.
References comm_, and snapshot_.
Referenced by Build().
|
static |
Build a new ResourceHandler from JSON.
json | JSON root node containing driver (and children) specifications. |
world | MPI communicator containing all processors. |
Definition at line 54 of file ResourceHandler.cpp.
References SSAGES::CVManager::AddCVtoMap(), SSAGES::Logger::Build(), SSAGES::CollectiveVariable::BuildCV(), SSAGES::Method::BuildMethod(), Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), SSAGES::CVManager::LookupCV(), Json::ObjectRequirement::Parse(), ResourceHandler(), and Json::ObjectRequirement::Validate().
void SSAGES::ResourceHandler::ConfigureHook | ( | class Hook * | hook | ) |
Configure the Hook from given resources.
hook | Pointer to specified Hook. |
Definition at line 44 of file ResourceHandler.cpp.
References SSAGES::Hook::AddListener(), cvmanager_, hook_, logger_, methods_, SSAGES::Hook::SetCVManager(), SSAGES::Hook::SetSnapshot(), and snapshot_.
|
inline |
|
inline |
Returns local (walker-specific) MPI communicator.
Definition at line 104 of file ResourceHandler.h.
References comm_.
|
inline |
Returns local (walker-specific) mxx communicator.
Definition at line 122 of file ResourceHandler.h.
References comm_.
|
inline |
Returns the total number of walkers across all processors.
Definition at line 149 of file ResourceHandler.h.
References nwalkers_.
|
inline |
Returns processor-specific walker ID.
Definition at line 140 of file ResourceHandler.h.
References walkerid_.
|
inline |
Returns world (all processors) MPI communicator.
Definition at line 113 of file ResourceHandler.h.
References world_.
|
inline |
Returns world (all processors) mxx communicator.
Definition at line 131 of file ResourceHandler.h.
References world_.