SSAGES  0.1
A MetaDynamics Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
ResourceHandler.h
1 
20 #pragma once
21 
22 #include <mxx/comm.hpp>
23 #include <vector>
24 
25 // Forward declare.
26 namespace Json {
27  class Value;
28 }
29 
30 namespace SSAGES
31 {
32 
34 
45  {
46  private:
48  mxx::comm world_;
49 
51  mxx::comm comm_;
52 
54  uint walkerid_;
55 
57  uint nwalkers_;
58 
61 
63  std::vector<class Method*> methods_;
64 
66  class Logger* logger_;
67 
70 
72  class Hook* hook_;
73 
75  std::vector<std::string> inputs_;
76 
77  public:
79 
88  ResourceHandler(mxx::comm&& world, mxx::comm&& comm, uint walkerid,
89  const std::vector<class Method*>& methods, class CVManager* cvmanager);
90 
91 
92  std::string GetInput() const
93  {
94  return inputs_[walkerid_];
95  }
96 
97  MPI_Comm GetLocalComm() const
98  {
99  return comm_;
100  }
101 
102  MPI_Comm GetWorldComm() const
103  {
104  return world_;
105  }
106 
107  const mxx::comm& GetLocalMxxComm() const
108  {
109  return comm_;
110  }
111 
112  const mxx::comm& GetWorldMxxComm() const
113  {
114  return world_;
115  }
116 
117  uint GetWalkerID() const
118  {
119  return walkerid_;
120  }
121 
122  uint GetNumWalkers() const
123  {
124  return nwalkers_;
125  }
126 
127  void ConfigureHook(class Hook* hook);
128 
130 
137  static ResourceHandler* Build(const Json::Value& json, const MPI_Comm& world);
138 
141  };
142 }
Collective variable manager.
Definition: CVManager.h:40
Class containing a snapshot of the current simulation in time.
Definition: Snapshot.h:43
std::vector< std::string > inputs_
Input file vector.
class CVManager * cvmanager_
Collective variable manager.
Base class for hooks into the simultion engines.
Definition: Hook.h:35
uint walkerid_
Walker ID for specific driver.
mxx::comm comm_
MPI communicator containing processors for specific walker.
static ResourceHandler * Build(const Json::Value &json, const MPI_Comm &world)
Build a new ResourceHandler from JSON.
class Logger * logger_
CV logger.
class Snapshot * snapshot_
Snapshot of system state (pointer).
Base class for logging SSAGES data.
Definition: Logger.h:41
class Hook * hook_
Hook pointer.
mxx::comm world_
MPI communicator containing all processors.
Class that handles SSAGES resources for a simulation.
std::vector< class Method * > methods_
Vector of advanced sampling methods.
ResourceHandler(mxx::comm &&world, mxx::comm &&comm, uint walkerid, const std::vector< class Method * > &methods, class CVManager *cvmanager)
Constructor.
uint nwalkers_
Number of walkers.