Public Types | Public Member Functions | Static Public Attributes | Friends

LibGeoDecomp::Initializer< CELL > Class Template Reference

The initializer sets up the initial state of the grid. More...

#include <initializer.h>

Inherited by LibGeoDecomp::ClonableInitializer< CELL >.

Collaboration diagram for LibGeoDecomp::Initializer< CELL >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
APITraits::SelectTopology
< CELL >::Value 
Topology
typedef CELL Cell

Public Member Functions

virtual ~Initializer ()
virtual void grid (GridBase< CELL, DIM > *target)=0
 initializes all cells of the grid at target
virtual CoordBox< DIMgridBox ()
 Allows a Simulator to discover the extent of the whole simulation.
virtual Coord< DIMgridDimensions () const =0
 returns the size of the gridBox().
virtual unsigned startStep () const =0
 yields the logical time step at which the simulation should start
virtual unsigned maxSteps () const =0
 gives the time step at which the simulation should terminate.

Static Public Attributes

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

Friends

class Serialization

Detailed Description

template<typename CELL>
class LibGeoDecomp::Initializer< CELL >

The initializer sets up the initial state of the grid.

For this a Simulator will invoke Initializer::grid(). Keep in mind that grid() might be called multiple times and that for parallel runs each Initializer will be responsible just for a sub-cuboid of the whole grid.


Member Typedef Documentation

template<typename CELL>
typedef CELL LibGeoDecomp::Initializer< CELL >::Cell
template<typename CELL>
typedef APITraits::SelectTopology<CELL>::Value LibGeoDecomp::Initializer< CELL >::Topology

Constructor & Destructor Documentation

template<typename CELL>
virtual LibGeoDecomp::Initializer< CELL >::~Initializer (  )  [inline, virtual]

Member Function Documentation

template<typename CELL>
virtual void LibGeoDecomp::Initializer< CELL >::grid ( GridBase< CELL, DIM > *  target  )  [pure virtual]
template<typename CELL>
virtual CoordBox<DIM> LibGeoDecomp::Initializer< CELL >::gridBox (  )  [inline, virtual]

Allows a Simulator to discover the extent of the whole simulation.

Usually Simulations will use 0 as the origin, but there is no oblication to do so.

Reimplemented in LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >.

Referenced by LibGeoDecomp::CudaSimulator< CELL_TYPE >::CudaSimulator(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init(), and LibGeoDecomp::SerialSimulator< CELL_TYPE >::SerialSimulator().

template<typename CELL>
virtual Coord<DIM> LibGeoDecomp::Initializer< CELL >::gridDimensions (  )  const [pure virtual]
template<typename CELL>
virtual unsigned LibGeoDecomp::Initializer< CELL >::maxSteps (  )  const [pure virtual]

gives the time step at which the simulation should terminate.

Example: if startStep is 0 and maxSteps is 10, then the Simulator should start at t=0, update to t=1, update to t=2, ... until it has updated to t=10.

If startStep is 5 and maxSteps is 8, then the Simulator is expected to init at t=5, update to t=6, update to t=7, and finally update to t=8.

Implemented in LibGeoDecomp::ClonableInitializerWrapper< INITIALIZER >, LibGeoDecomp::MPIIOInitializer< CELL_TYPE >, LibGeoDecomp::SimpleInitializer< CELL_TYPE >, LibGeoDecomp::TestInitializer< TEST_CELL >, LibGeoDecomp::SimpleInitializer< NonPoDTestCell >, and LibGeoDecomp::TestInitializer< TestCell< 2 > >.

Referenced by LibGeoDecomp::CudaSimulator< CELL_TYPE >::run(), and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::runTimed().

template<typename CELL>
virtual unsigned LibGeoDecomp::Initializer< CELL >::startStep (  )  const [pure virtual]

Friends And Related Function Documentation

template<typename CELL>
friend class Serialization [friend]

Member Data Documentation

template<typename CELL>
const int LibGeoDecomp::Initializer< CELL >::DIM = Topology::DIM [static]
template<typename CELL>
const unsigned LibGeoDecomp::Initializer< CELL >::NANO_STEPS = APITraits::SelectNanoSteps<CELL>::VALUE [static]

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