SerialSimulator is the simplest implementation of the Simulator concept (or rather the MonolithicSimulator, to be exact). More...
#include <serialsimulator.h>
Inherits LibGeoDecomp::MonolithicSimulator< CELL_TYPE >.
Public Types | |
typedef MonolithicSimulator < CELL_TYPE >::GridType | GridBaseType |
typedef MonolithicSimulator < CELL_TYPE >::Topology | Topology |
typedef MonolithicSimulator < CELL_TYPE >::WriterVector | WriterVector |
typedef APITraits::SelectSoA < CELL_TYPE >::Value | SupportsSoA |
typedef GridTypeSelector < CELL_TYPE, Topology, false, SupportsSoA >::Value | GridType |
typedef Steerer< CELL_TYPE > ::SteererFeedback | SteererFeedback |
Public Member Functions | |
SerialSimulator (Initializer< CELL_TYPE > *initializer) | |
creates a SerialSimulator with the given initializer. | |
virtual | ~SerialSimulator () |
virtual void | step () |
performs a single simulation step. | |
virtual void | step (SteererFeedback *feedback) |
virtual void | run () |
continue simulating until the maximum number of steps is reached. | |
virtual const GridBaseType * | getGrid () |
returns the current grid. | |
Static Public Attributes | |
static const int | DIM = Topology::DIM |
Protected Member Functions | |
void | nanoStep (const unsigned &nanoStep) |
void | handleOutput (WriterEvent event) |
notifies all registered Writers | |
void | handleInput (SteererEvent event, SteererFeedback *feedback) |
notifies all registered Steerers | |
void | setIORegions () |
Protected Attributes | |
GridType * | curGrid |
GridType * | newGrid |
Region< DIM > | simArea |
Friends | |
class | SerialSimulatorTest |
SerialSimulator is the simplest implementation of the Simulator concept (or rather the MonolithicSimulator, to be exact).
It's purpose is to make fostering new applications easier. The absence of concurrency simplifies debugging. As its name implies, it doesn't do any threading, but vectorization (SIMD) is supported.
typedef MonolithicSimulator<CELL_TYPE>::GridType LibGeoDecomp::SerialSimulator< CELL_TYPE >::GridBaseType |
typedef GridTypeSelector<CELL_TYPE, Topology, false, SupportsSoA>::Value LibGeoDecomp::SerialSimulator< CELL_TYPE >::GridType |
Reimplemented from LibGeoDecomp::Simulator< CELL_TYPE >.
typedef Steerer<CELL_TYPE>::SteererFeedback LibGeoDecomp::SerialSimulator< CELL_TYPE >::SteererFeedback |
typedef APITraits::SelectSoA<CELL_TYPE>::Value LibGeoDecomp::SerialSimulator< CELL_TYPE >::SupportsSoA |
typedef MonolithicSimulator<CELL_TYPE>::Topology LibGeoDecomp::SerialSimulator< CELL_TYPE >::Topology |
Reimplemented from LibGeoDecomp::Simulator< CELL_TYPE >.
typedef MonolithicSimulator<CELL_TYPE>::WriterVector LibGeoDecomp::SerialSimulator< CELL_TYPE >::WriterVector |
Reimplemented from LibGeoDecomp::MonolithicSimulator< CELL_TYPE >.
LibGeoDecomp::SerialSimulator< CELL_TYPE >::SerialSimulator | ( | Initializer< CELL_TYPE > * | initializer | ) | [inline, explicit] |
creates a SerialSimulator with the given initializer.
References LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid, LibGeoDecomp::Initializer< CELL >::grid(), LibGeoDecomp::Initializer< CELL >::gridBox(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::newGrid, LibGeoDecomp::SerialSimulator< CELL_TYPE >::simArea, LibGeoDecomp::Initializer< CELL >::startStep(), and LibGeoDecomp::Simulator< CELL_TYPE >::stepNum.
virtual LibGeoDecomp::SerialSimulator< CELL_TYPE >::~SerialSimulator | ( | ) | [inline, virtual] |
virtual const GridBaseType* LibGeoDecomp::SerialSimulator< CELL_TYPE >::getGrid | ( | ) | [inline, virtual] |
returns the current grid.
Implements LibGeoDecomp::MonolithicSimulator< CELL_TYPE >.
References LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid.
void LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleInput | ( | SteererEvent | event, | |
SteererFeedback * | feedback | |||
) | [inline, protected] |
notifies all registered Steerers
References LibGeoDecomp::Simulator< CELL_TYPE >::chronometer, LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid, LibGeoDecomp::Simulator< CELL_TYPE >::getStep(), LibGeoDecomp::Simulator< CELL_TYPE >::gridDim, LibGeoDecomp::SerialSimulator< CELL_TYPE >::simArea, LibGeoDecomp::Simulator< CELL_TYPE >::steerers, and LibGeoDecomp::Simulator< CELL_TYPE >::stepNum.
Referenced by LibGeoDecomp::SerialSimulator< CELL_TYPE >::run(), and LibGeoDecomp::SerialSimulator< CELL_TYPE >::step().
void LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleOutput | ( | WriterEvent | event | ) | [inline, protected] |
notifies all registered Writers
References LibGeoDecomp::Simulator< CELL_TYPE >::chronometer, LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid, LibGeoDecomp::Simulator< CELL_TYPE >::getStep(), LibGeoDecomp::WRITER_STEP_FINISHED, and LibGeoDecomp::MonolithicSimulator< CELL_TYPE >::writers.
Referenced by LibGeoDecomp::SerialSimulator< CELL_TYPE >::run(), and LibGeoDecomp::SerialSimulator< CELL_TYPE >::step().
void LibGeoDecomp::SerialSimulator< CELL_TYPE >::nanoStep | ( | const unsigned & | nanoStep | ) | [inline, protected] |
virtual void LibGeoDecomp::SerialSimulator< CELL_TYPE >::run | ( | ) | [inline, virtual] |
continue simulating until the maximum number of steps is reached.
Implements LibGeoDecomp::Simulator< CELL_TYPE >.
References LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid, LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleInput(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleOutput(), LibGeoDecomp::Simulator< CELL_TYPE >::initializer, LibGeoDecomp::SerialSimulator< CELL_TYPE >::setIORegions(), LibGeoDecomp::Steerer< CELL_TYPE >::SteererFeedback::simulationEnded(), LibGeoDecomp::STEERER_ALL_DONE, LibGeoDecomp::STEERER_INITIALIZED, LibGeoDecomp::SerialSimulator< CELL_TYPE >::step(), LibGeoDecomp::Simulator< CELL_TYPE >::stepNum, LibGeoDecomp::WRITER_ALL_DONE, and LibGeoDecomp::WRITER_INITIALIZED.
void LibGeoDecomp::SerialSimulator< CELL_TYPE >::setIORegions | ( | ) | [inline, protected] |
virtual void LibGeoDecomp::SerialSimulator< CELL_TYPE >::step | ( | SteererFeedback * | feedback | ) | [inline, virtual] |
References LibGeoDecomp::Simulator< CELL_TYPE >::chronometer, LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleInput(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleOutput(), LibGeoDecomp::Simulator< CELL_TYPE >::NANO_STEPS, LibGeoDecomp::SerialSimulator< CELL_TYPE >::nanoStep(), LibGeoDecomp::STEERER_NEXT_STEP, LibGeoDecomp::Simulator< CELL_TYPE >::stepNum, and LibGeoDecomp::WRITER_STEP_FINISHED.
virtual void LibGeoDecomp::SerialSimulator< CELL_TYPE >::step | ( | ) | [inline, virtual] |
performs a single simulation step.
Implements LibGeoDecomp::Simulator< CELL_TYPE >.
Referenced by LibGeoDecomp::SerialSimulator< CELL_TYPE >::run().
friend class SerialSimulatorTest [friend] |
GridType* LibGeoDecomp::SerialSimulator< CELL_TYPE >::curGrid [protected] |
Referenced by LibGeoDecomp::SerialSimulator< CELL_TYPE >::getGrid(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleInput(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::handleOutput(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::nanoStep(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::run(), LibGeoDecomp::SerialSimulator< CELL_TYPE >::SerialSimulator(), and LibGeoDecomp::SerialSimulator< CELL_TYPE >::~SerialSimulator().
const int LibGeoDecomp::SerialSimulator< CELL_TYPE >::DIM = Topology::DIM [static] |
Reimplemented from LibGeoDecomp::Simulator< CELL_TYPE >.
GridType* LibGeoDecomp::SerialSimulator< CELL_TYPE >::newGrid [protected] |
Region<DIM> LibGeoDecomp::SerialSimulator< CELL_TYPE >::simArea [protected] |