![]() |
Peano
|
#include <MyObserver.h>
Public Member Functions | |
MyObserver (int spacetreeId, double h, int flopsPerCell) | |
virtual | ~MyObserver () |
void | beginTraversal (const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override |
Begin the traversal. | |
void | endTraversal (const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override |
void | enterCell (const peano4::grid::GridTraversalEvent &event) override |
Event is invoked per cell. | |
void | leaveCell (const peano4::grid::GridTraversalEvent &event) override |
TraversalObserver * | clone (int spacetreeId) override |
I use the clone to create one observer object per traversal thread. | |
std::vector< peano4::grid::GridControlEvent > | getGridControlEvents () override |
![]() | |
virtual | ~TraversalObserver () |
virtual void | loadCell (const GridTraversalEvent &event)=0 |
virtual void | storeCell (const GridTraversalEvent &event)=0 |
virtual std::vector< GridControlEvent > | getGridControlEvents () const =0 |
virtual void | exchangeAllVerticalDataExchangeStacks (int) |
Send local data from top level of local mesh to master and receive its top-down information in return. | |
virtual void | exchangeAllHorizontalDataExchangeStacks (bool) |
Exchange all the data along the domain boundaries. | |
virtual void | exchangeAllPeriodicBoundaryDataStacks () |
Exchange all periodic boundary data. | |
virtual void | streamDataFromSplittingTreeToNewTree (int) |
Stream data from current tree on which this routine is called to the new worker. | |
virtual void | streamDataFromJoiningTreeToMasterTree (int) |
virtual void | finishAllOutstandingSendsAndReceives () |
Wrap up all sends and receives, i.e. | |
virtual void | sendVertex (int, int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | sendFace (int, int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | sendCell (int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | receiveAndMergeVertex (int, int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | receiveAndMergeFace (int, int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | receiveAndMergeCell (int, SendReceiveContext, const GridTraversalEvent &) |
virtual void | deleteAllStacks () |
Static Public Attributes | |
static constexpr int | RanksObserverTemplate = 1 |
static double | FractionOfCellsYieldingIntegrationTask |
static int | IntegrationAccuracy |
![]() | |
static constexpr int | NoRebalancing = -1 |
static constexpr int | NoData = -1 |
Can this grid entity hold data. | |
static constexpr int | CreateOrDestroyPersistentGridEntity = -2 |
Implies that the data will then be local or had been local. | |
static constexpr int | CreateOrDestroyHangingGridEntity = -3 |
Implies that the data will then be local or had been local. | |
Private Attributes | |
const int | _spacetreeId |
const double | _h |
const int | _flopsPerCell |
double | _accumulator |
I use an accumulator just to ensure that the flop calculations are not removed. | |
double | _taskAccumulator |
Static Private Attributes | |
static tarch::logging::Log | _log |
Additional Inherited Members | |
![]() | |
enum class | SendReceiveContext { BoundaryExchange , MultiscaleExchange , ForkDomain , JoinDomain , PeriodicBoundaryDataSwap } |
There are three different scenarios when we merge data: More... | |
Definition at line 18 of file MyObserver.h.
examples::regulargridupscaling::MyObserver::MyObserver | ( | int | spacetreeId, |
double | h, | ||
int | flopsPerCell ) |
Definition at line 20 of file MyObserver.cpp.
|
virtual |
Definition at line 28 of file MyObserver.cpp.
|
overridevirtual |
Begin the traversal.
This routine is called per spacetree instance, i.e. per subtree (thread) per rank. Within the usual implementation, everything will reside on the call stack anyway. If the routine is called on tree no 0, this operation has to establish the master data of the global root tree, i.e. ensure that the data of level -1 is technically there for the subsequent enterCell event, though this data is ill-defined.
x | Root cell coordinates |
h | Root cell size |
Implements peano4::grid::TraversalObserver.
Definition at line 32 of file MyObserver.cpp.
|
overridevirtual |
I use the clone to create one observer object per traversal thread.
So between different spacetrees of one spacetree set, there can be no race condition. Yet, the clone() itself could be called in parallel.
Implements peano4::grid::TraversalObserver.
Definition at line 99 of file MyObserver.cpp.
|
overridevirtual |
Implements peano4::grid::TraversalObserver.
Definition at line 41 of file MyObserver.cpp.
References logDebug.
|
overridevirtual |
Event is invoked per cell.
It is however not called for the root cell, i.e. for the cell with level 0 that does not have a parent.
Implements peano4::grid::TraversalObserver.
Definition at line 50 of file MyObserver.cpp.
References std::abs(), assertion, tarch::la::frobeniusNorm(), peano4::grid::GridTraversalEvent::getCellData(), peano4::grid::GridTraversalEvent::getH(), tarch::multicore::Core::getInstance(), tarch::multicore::Core::getNumberOfThreads(), toolbox::finiteelements::getPoissonMatrixWithJumpingCoefficient(), and peano4::grid::GridTraversalEvent::getX().
|
override |
Definition at line 104 of file MyObserver.cpp.
References peano4::grid::GridControlEvent::Refine, peano4::grid::GridControlEvent::setH(), peano4::grid::GridControlEvent::setOffset(), peano4::grid::GridControlEvent::setRefinementControl(), and peano4::grid::GridControlEvent::setWidth().
|
overridevirtual |
Implements peano4::grid::TraversalObserver.
Definition at line 93 of file MyObserver.cpp.
|
private |
I use an accumulator just to ensure that the flop calculations are not removed.
Definition at line 29 of file MyObserver.h.
|
private |
Definition at line 24 of file MyObserver.h.
|
private |
Definition at line 23 of file MyObserver.h.
|
staticprivate |
Definition at line 20 of file MyObserver.h.
|
private |
Definition at line 22 of file MyObserver.h.
|
private |
Definition at line 31 of file MyObserver.h.
|
static |
Definition at line 36 of file MyObserver.h.
Referenced by main().
|
static |
Definition at line 37 of file MyObserver.h.
Referenced by main().
|
staticconstexpr |
Definition at line 34 of file MyObserver.h.
Referenced by runParallel().