Public Types | Public Member Functions | Static Public Attributes | Protected Attributes

LibGeoDecomp::Simulator< CELL_TYPE > Class Template Reference

A Simulator controls the workflow of the simulation. More...

#include <simulator.h>

Inherited by LibGeoDecomp::DistributedSimulator< CELL_TYPE >, and LibGeoDecomp::MonolithicSimulator< CELL_TYPE >.

Collaboration diagram for LibGeoDecomp::Simulator< CELL_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
APITraits::SelectTopology
< CELL_TYPE >::Value 
Topology
typedef GridBase< CELL_TYPE, DIMGridType
typedef std::vector
< boost::shared_ptr< Steerer
< CELL_TYPE > > > 
SteererVector

Public Member Functions

 Simulator (Initializer< CELL_TYPE > *initializer)
 Creates the abstract Simulator object.
virtual ~Simulator ()
virtual void step ()=0
 performs a single simulation step.
virtual void run ()=0
 performs step() until the maximum number of steps is reached.
virtual unsigned getStep () const
 returns the number of the current logical simulation step.
virtual boost::shared_ptr
< Initializer< CELL_TYPE > > 
getInitializer () const
virtual void addSteerer (Steerer< CELL_TYPE > *steerer)
 adds a Steerer which will be called back before simulation steps as specified by the Steerer's period.
virtual std::vector< ChronometergatherStatistics ()=0
 Returns histograms which detail how much execution time was spent on which part of the algorithm.

Static Public Attributes

static const int DIM = Topology::DIM
static const unsigned NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE

Protected Attributes

Chronometer chronometer
unsigned stepNum
boost::shared_ptr< Initializer
< CELL_TYPE > > 
initializer
SteererVector steerers
Coord< DIMgridDim

Detailed Description

template<typename CELL_TYPE>
class LibGeoDecomp::Simulator< CELL_TYPE >

A Simulator controls the workflow of the simulation.

It also needs to interface with the Initializer (for setting up the initial grid), Writer objects (for output) and Steerer objects (for input at runtime). Simulator itself is just an abstract base class, implementations may target different hardware architectures (e.g. CUDASimulator or SerialSimulator).


Member Typedef Documentation

template<typename CELL_TYPE>
typedef GridBase<CELL_TYPE, DIM> LibGeoDecomp::Simulator< CELL_TYPE >::GridType
template<typename CELL_TYPE>
typedef std::vector<boost::shared_ptr<Steerer<CELL_TYPE> > > LibGeoDecomp::Simulator< CELL_TYPE >::SteererVector
template<typename CELL_TYPE>
typedef APITraits::SelectTopology<CELL_TYPE>::Value LibGeoDecomp::Simulator< CELL_TYPE >::Topology

Constructor & Destructor Documentation

template<typename CELL_TYPE>
LibGeoDecomp::Simulator< CELL_TYPE >::Simulator ( Initializer< CELL_TYPE > *  initializer  )  [inline, explicit]

Creates the abstract Simulator object.

The Initializer is assumed to belong to the Simulator, which means that it'll delete the initializer at the end of its lifetime.

template<typename CELL_TYPE>
virtual LibGeoDecomp::Simulator< CELL_TYPE >::~Simulator (  )  [inline, virtual]

Member Function Documentation

template<typename CELL_TYPE>
virtual void LibGeoDecomp::Simulator< CELL_TYPE >::addSteerer ( Steerer< CELL_TYPE > *  steerer  )  [inline, virtual]

adds a Steerer which will be called back before simulation steps as specified by the Steerer's period.

The Steerer is assumed to be owned by the Simulator. It will destroy the Steerer upon its death.

Reimplemented in LibGeoDecomp::HiParSimulator::HiParSimulator< CELL_TYPE, PARTITION, STEPPER >, and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >.

template<typename CELL_TYPE>
virtual std::vector<Chronometer> LibGeoDecomp::Simulator< CELL_TYPE >::gatherStatistics (  )  [pure virtual]
template<typename CELL_TYPE>
virtual boost::shared_ptr<Initializer<CELL_TYPE> > LibGeoDecomp::Simulator< CELL_TYPE >::getInitializer (  )  const [inline, virtual]
template<typename CELL_TYPE>
virtual unsigned LibGeoDecomp::Simulator< CELL_TYPE >::getStep (  )  const [inline, virtual]
template<typename CELL_TYPE>
virtual void LibGeoDecomp::Simulator< CELL_TYPE >::run (  )  [pure virtual]
template<typename CELL_TYPE>
virtual void LibGeoDecomp::Simulator< CELL_TYPE >::step (  )  [pure virtual]

Member Data Documentation

template<typename CELL_TYPE>
Chronometer LibGeoDecomp::Simulator< CELL_TYPE >::chronometer [protected]
template<typename CELL_TYPE>
const int LibGeoDecomp::Simulator< CELL_TYPE >::DIM = Topology::DIM [static]
template<typename CELL_TYPE>
Coord<DIM> LibGeoDecomp::Simulator< CELL_TYPE >::gridDim [protected]
template<typename CELL_TYPE>
boost::shared_ptr<Initializer<CELL_TYPE> > LibGeoDecomp::Simulator< CELL_TYPE >::initializer [protected]
template<typename CELL_TYPE>
const unsigned LibGeoDecomp::Simulator< CELL_TYPE >::NANO_STEPS = APITraits::SelectNanoSteps<CELL_TYPE>::VALUE [static]
template<typename CELL_TYPE>
SteererVector LibGeoDecomp::Simulator< CELL_TYPE >::steerers [protected]
template<typename CELL_TYPE>
unsigned LibGeoDecomp::Simulator< CELL_TYPE >::stepNum [protected]

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