SSAGES  0.8.5
Software Suite for Advanced General Ensemble Simulations
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SSAGES::EventListener Class Referenceabstract

Base abstract class for listening in to events fired by "Hook". More...

#include <EventListener.h>

Inheritance diagram for SSAGES::EventListener:
Inheritance graph
[legend]

Public Member Functions

 EventListener (unsigned int frequency)
 Constructor. More...
 
unsigned int GetFrequency () const
 Get frequency of event listener. More...
 
virtual void PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager)=0
 Method call prior to simulation initiation. More...
 
virtual void PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager)=0
 Method call post integration. More...
 
virtual void PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager)=0
 Method call post simulation. More...
 
virtual ~EventListener ()
 Destructor.
 

Static Public Member Functions

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...
 

Private Attributes

unsigned int frequency_
 Frequency for listening.
 

Detailed Description

Base abstract class for listening in to events fired by "Hook".

Definition at line 35 of file EventListener.h.

Constructor & Destructor Documentation

SSAGES::EventListener::EventListener ( unsigned int  frequency)
inline

Constructor.

Parameters
frequencyFrequency for listening.

Definition at line 45 of file EventListener.h.

45  :
46  frequency_(frequency)
47  {
48  }
unsigned int frequency_
Frequency for listening.
Definition: EventListener.h:38

Member Function Documentation

unsigned int SSAGES::EventListener::GetFrequency ( ) const
inline

Get frequency of event listener.

Returns
Frequency of event listener.

Definition at line 54 of file EventListener.h.

References frequency_, PostIntegration(), PostSimulation(), and PreSimulation().

54 { return frequency_; }
unsigned int frequency_
Frequency for listening.
Definition: EventListener.h:38

Here is the call graph for this function:

static unsigned int SSAGES::EventListener::GetNumWalkers ( const MPI_Comm &  world,
const MPI_Comm &  comm 
)
inlinestatic

Get total number of walkers in the simulation.

Parameters
worldMPI communicator for the whole simulation.
commMPI communicator for the local walker.
Returns
Total number of walkers in the simulation.

Definition at line 100 of file EventListener.h.

101  {
102  return mxx::comm(world).size()/mxx::comm(comm).size();
103  }
static unsigned int SSAGES::EventListener::GetWalkerID ( const MPI_Comm &  world,
const MPI_Comm &  comm 
)
inlinestatic

Get walker ID number of specified communicator.

Parameters
worldMPI communicator for the whole simulation.
commMPI communicator for the local walker.
Returns
Walker ID number.

Definition at line 89 of file EventListener.h.

90  {
91  return mxx::comm(world).rank()/mxx::comm(comm).size();
92  }
static bool SSAGES::EventListener::IsMasterRank ( const MPI_Comm &  comm)
inlinestatic

Check if current processor is master.

Parameters
commMPI communicator to check.
Returns
Whether the current MPI rank is the first in the communicator.

Definition at line 110 of file EventListener.h.

Referenced by SSAGES::DirectForwardFlux::CheckForInterfaceCrossings(), SSAGES::DirectForwardFlux::InitializeQueue(), SSAGES::ANN::PostIntegration(), and SSAGES::ANN::TrainNetwork().

111  {
112  return mxx::comm(comm).rank() == 0;
113  }

Here is the caller graph for this function:

virtual void SSAGES::EventListener::PostIntegration ( Snapshot snapshot,
const class CVManager cvmanager 
)
pure virtual

Method call post integration.

Parameters
snapshotPointer to the simulation snapshot.
cvmanagerCollective variable manager.

This function will be called at the end of each integration step.

Implemented in SSAGES::ForwardFlux, SSAGES::ABF, SSAGES::BFS, SSAGES::StringMethod, SSAGES::Meta, SSAGES::Umbrella, SSAGES::ANN, SSAGES::Swarm, SSAGES::FiniteTempString, SSAGES::ElasticBand, SSAGES::Logger, SSAGES::Method, and SSAGES::DirectForwardFlux.

Referenced by GetFrequency().

Here is the caller graph for this function:

virtual void SSAGES::EventListener::PostSimulation ( Snapshot snapshot,
const class CVManager cvmanager 
)
pure virtual

Method call post simulation.

Parameters
snapshotPointer to the simulation snapshot.
cvmanagerCollective variable manager.

This function will be called after the simulation has finished.

Implemented in SSAGES::ForwardFlux, SSAGES::ABF, SSAGES::BFS, SSAGES::StringMethod, SSAGES::Meta, SSAGES::Umbrella, SSAGES::ANN, SSAGES::Logger, and SSAGES::Method.

Referenced by GetFrequency().

Here is the caller graph for this function:

virtual void SSAGES::EventListener::PreSimulation ( Snapshot snapshot,
const class CVManager cvmanager 
)
pure virtual

Method call prior to simulation initiation.

Parameters
snapshotPointer to the simulation snapshot.
cvmanagerCollective variable manager.

This function will be called before the simulation is started.

Implemented in SSAGES::ForwardFlux, SSAGES::ABF, SSAGES::BFS, SSAGES::StringMethod, SSAGES::Meta, SSAGES::Umbrella, SSAGES::ANN, SSAGES::Logger, and SSAGES::Method.

Referenced by GetFrequency().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: