#include <hpxsimulator.h>
Inherits LibGeoDecomp::DistributedSimulator< CELL_TYPE >.
Public Types | |
typedef DistributedSimulator < CELL_TYPE >::Topology | Topology |
typedef LibGeoDecomp::DistributedSimulator < CELL_TYPE > | ParentType |
typedef UpdateGroup< CELL_TYPE, PARTITION, STEPPER > | UpdateGroupType |
typedef ParentType::GridType | GridType |
Public Member Functions | |
HpxSimulator (Initializer< CELL_TYPE > *initializer, const float overcommitFactor, LoadBalancer *balancer=0, const unsigned loadBalancingPeriod=1, const unsigned ghostZoneWidth=1) | |
HpxSimulator (Initializer< CELL_TYPE > *initializer, const hpx::util::function< std::size_t()> &numUpdateGroups, LoadBalancer *balancer=0, const unsigned loadBalancingPeriod=1, const unsigned ghostZoneWidth=1) | |
void | calculateBoundingBoxes (std::vector< CoordBox< DIM > > &boundingBoxes, std::size_t rank_start, std::size_t rank_end, const CoordBox< DIM > &box, const std::vector< std::size_t > &weights) |
void | init () |
void | run () |
performs step() until the maximum number of steps is reached. | |
void | stop () |
void | step () |
performs a single simulation step. | |
virtual unsigned | getStep () const |
returns the number of the current logical simulation step. | |
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 void | addWriter (ParallelWriter< CELL_TYPE > *writer) |
register writer which will observe the simulation. | |
std::size_t | numUpdateGroups () const |
std::vector< Chronometer > | gatherStatistics () |
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 |
Private Member Functions | |
std::vector< Chronometer > | nanoStep (std::size_t remainingNanoSteps) |
std::vector< std::size_t > | initialWeights (const std::size_t items, const std::size_t size) const |
std::vector< Chronometer > | runTimed () |
Private Attributes | |
boost::shared_ptr< LoadBalancer > | balancer |
unsigned | loadBalancingPeriod |
unsigned | ghostZoneWidth |
PartitionManager< Topology > | partitionManager |
std::vector< hpx::id_type > | updateGroupsIds |
boost::atomic< bool > | initialized |
std::vector< Chronometer > | statistics |
Friends | |
class | HpxSimulatorTest |
typedef ParentType::GridType LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::GridType |
Reimplemented from LibGeoDecomp::DistributedSimulator< CELL_TYPE >.
typedef LibGeoDecomp::DistributedSimulator<CELL_TYPE> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::ParentType |
typedef DistributedSimulator<CELL_TYPE>::Topology LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::Topology |
Reimplemented from LibGeoDecomp::DistributedSimulator< CELL_TYPE >.
typedef UpdateGroup<CELL_TYPE, PARTITION, STEPPER> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::UpdateGroupType |
LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::HpxSimulator | ( | Initializer< CELL_TYPE > * | initializer, | |
const float | overcommitFactor, | |||
LoadBalancer * | balancer = 0 , |
|||
const unsigned | loadBalancingPeriod = 1 , |
|||
const unsigned | ghostZoneWidth = 1 | |||
) | [inline] |
LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::HpxSimulator | ( | Initializer< CELL_TYPE > * | initializer, | |
const hpx::util::function< std::size_t()> & | numUpdateGroups, | |||
LoadBalancer * | balancer = 0 , |
|||
const unsigned | loadBalancingPeriod = 1 , |
|||
const unsigned | ghostZoneWidth = 1 | |||
) | [inline] |
virtual void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::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 from LibGeoDecomp::Simulator< CELL_TYPE >.
virtual void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::addWriter | ( | ParallelWriter< CELL_TYPE > * | writer | ) | [inline, virtual] |
register writer which will observe the simulation.
The DistributedSimulator will assume that it now owns the ParallelWriter, so it'll delete it upon destruction.
Reimplemented from LibGeoDecomp::DistributedSimulator< CELL_TYPE >.
void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::calculateBoundingBoxes | ( | std::vector< CoordBox< DIM > > & | boundingBoxes, | |
std::size_t | rank_start, | |||
std::size_t | rank_end, | |||
const CoordBox< DIM > & | box, | |||
const std::vector< std::size_t > & | weights | |||
) | [inline] |
References LibGeoDecomp::CoordBox< DIM >::dimensions, LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::ghostZoneWidth, LibGeoDecomp::CoordBox< DIM >::origin, and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::partitionManager.
Referenced by LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init().
std::vector<Chronometer> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::gatherStatistics | ( | ) | [inline, virtual] |
Returns histograms which detail how much execution time was spent on which part of the algorithm.
Will return one element per rank.
Implements LibGeoDecomp::Simulator< CELL_TYPE >.
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::statistics.
virtual unsigned LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::getStep | ( | ) | const [inline, virtual] |
returns the number of the current logical simulation step.
Reimplemented from LibGeoDecomp::Simulator< CELL_TYPE >.
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialized, LibGeoDecomp::Initializer< CELL >::startStep(), and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::updateGroupsIds.
void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init | ( | ) | [inline] |
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::calculateBoundingBoxes(), LibGeoDecomp::CoordBox< DIM >::dimensions, LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::ghostZoneWidth, LibGeoDecomp::Initializer< CELL >::gridBox(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialized, LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialWeights(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::loadBalancingPeriod, LibGeoDecomp::min(), LibGeoDecomp::Simulator< CELL_TYPE >::steerers, LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::updateGroupsIds, and LibGeoDecomp::DistributedSimulator< CELL_TYPE >::writers.
Referenced by LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::runTimed(), and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::step().
std::vector<std::size_t> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialWeights | ( | const std::size_t | items, | |
const std::size_t | size | |||
) | const [inline, private] |
std::vector<Chronometer> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::nanoStep | ( | std::size_t | remainingNanoSteps | ) | [inline, private] |
std::size_t LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::numUpdateGroups | ( | ) | const [inline] |
void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::run | ( | ) | [inline, virtual] |
performs step() until the maximum number of steps is reached.
Implements LibGeoDecomp::Simulator< CELL_TYPE >.
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::runTimed(), and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::statistics.
std::vector<Chronometer> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::runTimed | ( | ) | [inline, private] |
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init(), LibGeoDecomp::Initializer< CELL >::maxSteps(), LibGeoDecomp::Simulator< CELL_TYPE >::NANO_STEPS, and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::nanoStep().
Referenced by LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::run().
void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::step | ( | ) | [inline, virtual] |
performs a single simulation step.
Implements LibGeoDecomp::Simulator< CELL_TYPE >.
References LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init(), LibGeoDecomp::Simulator< CELL_TYPE >::NANO_STEPS, and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::nanoStep().
void LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::stop | ( | ) | [inline] |
friend class HpxSimulatorTest [friend] |
boost::shared_ptr<LoadBalancer> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::balancer [private] |
const int LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::DIM = Topology::DIM [static] |
Reimplemented from LibGeoDecomp::Simulator< CELL_TYPE >.
unsigned LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::ghostZoneWidth [private] |
boost::atomic<bool> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialized [private] |
unsigned LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::loadBalancingPeriod [private] |
PartitionManager<Topology> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::partitionManager [private] |
std::vector<Chronometer> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::statistics [private] |
std::vector<hpx::id_type> LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::updateGroupsIds [private] |
Referenced by LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::getStep(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::HpxSimulator(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::init(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::initialWeights(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::nanoStep(), LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::numUpdateGroups(), and LibGeoDecomp::HpxSimulator::HpxSimulator< CELL_TYPE, PARTITION, STEPPER >::stop().