Peano
Loading...
Searching...
No Matches
peano4::grid::GridStatistics Struct Reference

#include <GridStatistics.h>

Collaboration diagram for peano4::grid::GridStatistics:

Public Types

enum  ObjectConstruction { NoData }

Public Member Functions

 GridStatistics ()
 GridStatistics (int __numberOfLocalUnrefinedCells, int __numberOfRemoteUnrefinedCells, int __numberOfLocalRefinedCells, int __numberOfRemoteRefinedCells, int __stationarySweeps, bool __coarseningHasBeenVetoed, bool __removedEmptySubtree, tarch::la::Vector< Dimensions, double > __minH)
int getNumberOfLocalUnrefinedCells () const
void setNumberOfLocalUnrefinedCells (int value)
int getNumberOfRemoteUnrefinedCells () const
void setNumberOfRemoteUnrefinedCells (int value)
int getNumberOfLocalRefinedCells () const
void setNumberOfLocalRefinedCells (int value)
int getNumberOfRemoteRefinedCells () const
void setNumberOfRemoteRefinedCells (int value)
int getStationarySweeps () const
void setStationarySweeps (int value)
bool getCoarseningHasBeenVetoed () const
void setCoarseningHasBeenVetoed (bool value)
bool getRemovedEmptySubtree () const
void setRemovedEmptySubtree (bool value)
tarch::la::Vector< Dimensions, doublegetMinH () const
void setMinH (const tarch::la::Vector< Dimensions, double > &value)
double getMinH (int index) const
void setMinH (int index, double value)
 GridStatistics (const GridStatistics &copy)=default
int getSenderRank () const
 GridStatistics (ObjectConstruction)
std::string toString () const

Static Public Member Functions

static MPI_Datatype getForkDatatype ()
 Hands out MPI datatype if we work without the LLVM MPI extension.
static MPI_Datatype getJoinDatatype ()
static MPI_Datatype getBoundaryExchangeDatatype ()
static MPI_Datatype getMultiscaleDataExchangeDatatype ()
static MPI_Datatype getGlobalCommunciationDatatype ()
static void freeForkDatatype ()
static void freeJoinDatatype ()
static void freeBoundaryExchangeDatatype ()
static void freeMultiscaleDataExchangeDatatype ()
static void freeGlobalCommunciationDatatype ()
static void initDatatype ()
 Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.
static void shutdownDatatype ()
 Free the underlying MPI datatype.
static void send (const peano4::grid::GridStatistics &buffer, int destination, int tag, MPI_Comm communicator)
 In DaStGen (the first version), I had a non-static version of the send as well as the receive.
static void receive (peano4::grid::GridStatistics &buffer, int source, int tag, MPI_Comm communicator)
static void send (const peano4::grid::GridStatistics &buffer, int destination, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
 Alternative to the other send() where I trigger a non-blocking send an then invoke the functor until the corresponding MPI_Test tells me that the message went through.
static void receive (peano4::grid::GridStatistics &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
static void sendAndPollDanglingMessages (const peano4::grid::GridStatistics &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
static void receiveAndPollDanglingMessages (peano4::grid::GridStatistics &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())

Private Attributes

int _numberOfLocalUnrefinedCells
int _numberOfRemoteUnrefinedCells
int _numberOfLocalRefinedCells
int _numberOfRemoteRefinedCells
int _stationarySweeps
bool _coarseningHasBeenVetoed
bool _removedEmptySubtree
tarch::la::Vector< Dimensions, double_minH
int _senderDestinationRank

Static Private Attributes

static MPI_Datatype Datatype = MPI_DATATYPE_NULL
 Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.

Detailed Description

Definition at line 33 of file GridStatistics.h.

Member Enumeration Documentation

◆ ObjectConstruction

Enumerator
NoData 

Definition at line 134 of file GridStatistics.h.

Constructor & Destructor Documentation

◆ GridStatistics() [1/4]

peano4::grid::GridStatistics::GridStatistics ( )

Definition at line 35 of file GridStatistics.h.

Referenced by GridStatistics(), and GridStatistics().

Here is the caller graph for this function:

◆ GridStatistics() [2/4]

peano4::grid::GridStatistics::GridStatistics ( int __numberOfLocalUnrefinedCells,
int __numberOfRemoteUnrefinedCells,
int __numberOfLocalRefinedCells,
int __numberOfRemoteRefinedCells,
int __stationarySweeps,
bool __coarseningHasBeenVetoed,
bool __removedEmptySubtree,
tarch::la::Vector< Dimensions, double > __minH )

◆ GridStatistics() [3/4]

peano4::grid::GridStatistics::GridStatistics ( const GridStatistics & copy)
default

References GridStatistics().

Here is the call graph for this function:

◆ GridStatistics() [4/4]

peano4::grid::GridStatistics::GridStatistics ( ObjectConstruction )

Definition at line 138 of file GridStatistics.h.

References GridStatistics().

Here is the call graph for this function:

Member Function Documentation

◆ freeBoundaryExchangeDatatype()

void peano4::grid::GridStatistics::freeBoundaryExchangeDatatype ( )
static

Definition at line 177 of file GridStatistics.cpp.

References Datatype.

Referenced by shutdownDatatype().

Here is the caller graph for this function:

◆ freeForkDatatype()

void peano4::grid::GridStatistics::freeForkDatatype ( )
static

Definition at line 150 of file GridStatistics.cpp.

References Datatype.

Referenced by shutdownDatatype().

Here is the caller graph for this function:

◆ freeGlobalCommunciationDatatype()

void peano4::grid::GridStatistics::freeGlobalCommunciationDatatype ( )
static

Definition at line 159 of file GridStatistics.cpp.

References Datatype.

Referenced by shutdownDatatype().

Here is the caller graph for this function:

◆ freeJoinDatatype()

void peano4::grid::GridStatistics::freeJoinDatatype ( )
static

Definition at line 168 of file GridStatistics.cpp.

References Datatype.

Referenced by shutdownDatatype().

Here is the caller graph for this function:

◆ freeMultiscaleDataExchangeDatatype()

void peano4::grid::GridStatistics::freeMultiscaleDataExchangeDatatype ( )
static

Definition at line 186 of file GridStatistics.cpp.

References Datatype.

Referenced by shutdownDatatype().

Here is the caller graph for this function:

◆ getBoundaryExchangeDatatype()

MPI_Datatype peano4::grid::GridStatistics::getBoundaryExchangeDatatype ( )
static

Definition at line 139 of file GridStatistics.cpp.

References Datatype.

Referenced by initDatatype().

Here is the caller graph for this function:

◆ getCoarseningHasBeenVetoed()

bool peano4::grid::GridStatistics::getCoarseningHasBeenVetoed ( ) const

Definition at line 79 of file GridStatistics.cpp.

References _coarseningHasBeenVetoed.

Referenced by peano4::parallel::SpacetreeSet::cleanUpTrees(), and operator+().

Here is the caller graph for this function:

◆ getForkDatatype()

MPI_Datatype peano4::grid::GridStatistics::getForkDatatype ( )
static

Hands out MPI datatype if we work without the LLVM MPI extension.

If we work with this additional feature, this is the routine where the lazy initialisation is done and the datatype is also cached.

Definition at line 124 of file GridStatistics.cpp.

References Datatype.

Referenced by initDatatype().

Here is the caller graph for this function:

◆ getGlobalCommunciationDatatype()

MPI_Datatype peano4::grid::GridStatistics::getGlobalCommunciationDatatype ( )
static

Definition at line 129 of file GridStatistics.cpp.

References Datatype.

Referenced by initDatatype().

Here is the caller graph for this function:

◆ getJoinDatatype()

MPI_Datatype peano4::grid::GridStatistics::getJoinDatatype ( )
static

Definition at line 134 of file GridStatistics.cpp.

References Datatype.

Referenced by initDatatype().

Here is the caller graph for this function:

◆ getMinH() [1/2]

tarch::la::Vector< Dimensions, double > peano4::grid::GridStatistics::getMinH ( ) const

Definition at line 95 of file GridStatistics.cpp.

References _minH.

Referenced by swift2::timestepping::computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity(), operator+(), and selectNextAlgorithmicStep().

Here is the caller graph for this function:

◆ getMinH() [2/2]

double peano4::grid::GridStatistics::getMinH ( int index) const

Definition at line 103 of file GridStatistics.cpp.

References _minH.

◆ getMultiscaleDataExchangeDatatype()

MPI_Datatype peano4::grid::GridStatistics::getMultiscaleDataExchangeDatatype ( )
static

Definition at line 144 of file GridStatistics.cpp.

References Datatype.

Referenced by initDatatype().

Here is the caller graph for this function:

◆ getNumberOfLocalRefinedCells()

int peano4::grid::GridStatistics::getNumberOfLocalRefinedCells ( ) const

Definition at line 55 of file GridStatistics.cpp.

References _numberOfLocalRefinedCells.

Referenced by operator+().

Here is the caller graph for this function:

◆ getNumberOfLocalUnrefinedCells()

◆ getNumberOfRemoteRefinedCells()

int peano4::grid::GridStatistics::getNumberOfRemoteRefinedCells ( ) const

Definition at line 63 of file GridStatistics.cpp.

References _numberOfRemoteRefinedCells.

Referenced by operator+().

Here is the caller graph for this function:

◆ getNumberOfRemoteUnrefinedCells()

int peano4::grid::GridStatistics::getNumberOfRemoteUnrefinedCells ( ) const

Definition at line 47 of file GridStatistics.cpp.

References _numberOfRemoteUnrefinedCells.

Referenced by toolbox::loadbalancing::dumpStatistics(), and operator+().

Here is the caller graph for this function:

◆ getRemovedEmptySubtree()

bool peano4::grid::GridStatistics::getRemovedEmptySubtree ( ) const

Definition at line 87 of file GridStatistics.cpp.

References _removedEmptySubtree.

Referenced by operator+().

Here is the caller graph for this function:

◆ getSenderRank()

int peano4::grid::GridStatistics::getSenderRank ( ) const
Returns
The rank of the sender of an object. It only make ssense to call this routine after you've invoked receive with MPI_ANY_SOURCE.

Definition at line 194 of file GridStatistics.cpp.

References _senderDestinationRank.

◆ getStationarySweeps()

int peano4::grid::GridStatistics::getStationarySweeps ( ) const

Definition at line 71 of file GridStatistics.cpp.

References _stationarySweeps.

Referenced by peano4::grid::clear(), and operator+().

Here is the caller graph for this function:

◆ initDatatype()

void peano4::grid::GridStatistics::initDatatype ( )
static

Wrapper around getDatatype() to trigger lazy evaluation if we use the lazy initialisation.

Definition at line 198 of file GridStatistics.cpp.

References _coarseningHasBeenVetoed, _minH, _numberOfLocalRefinedCells, _numberOfLocalUnrefinedCells, _numberOfRemoteRefinedCells, _numberOfRemoteUnrefinedCells, _removedEmptySubtree, _stationarySweeps, Datatype, getBoundaryExchangeDatatype(), getForkDatatype(), getGlobalCommunciationDatatype(), getJoinDatatype(), and getMultiscaleDataExchangeDatatype().

Referenced by peano4::parallel::Node::initMPIDatatypes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receive() [1/2]

void peano4::grid::GridStatistics::receive ( peano4::grid::GridStatistics & buffer,
int source,
int tag,
MPI_Comm communicator )
static

Definition at line 311 of file GridStatistics.cpp.

References _senderDestinationRank, and Datatype.

Referenced by receiveAndPollDanglingMessages().

Here is the caller graph for this function:

◆ receive() [2/2]

void peano4::grid::GridStatistics::receive ( peano4::grid::GridStatistics & buffer,
int source,
int tag,
std::function< void()> startCommunicationFunctor,
std::function< void()> waitFunctor,
MPI_Comm communicator )
static

Definition at line 336 of file GridStatistics.cpp.

References _senderDestinationRank, and Datatype.

◆ receiveAndPollDanglingMessages()

◆ send() [1/2]

void peano4::grid::GridStatistics::send ( const peano4::grid::GridStatistics & buffer,
int destination,
int tag,
MPI_Comm communicator )
static

In DaStGen (the first version), I had a non-static version of the send as well as the receive.

However, this did not work with newer C++11 versions, as a member function using this as pointer usually doesn't see the vtable while the init sees the object from outside, i.e. including a vtable. So this routine now is basically an alias for a blocking MPI_Send.

Definition at line 307 of file GridStatistics.cpp.

References Datatype.

Referenced by sendAndPollDanglingMessages().

Here is the caller graph for this function:

◆ send() [2/2]

void peano4::grid::GridStatistics::send ( const peano4::grid::GridStatistics & buffer,
int destination,
int tag,
std::function< void()> startCommunicationFunctor,
std::function< void()> waitFunctor,
MPI_Comm communicator )
static

Alternative to the other send() where I trigger a non-blocking send an then invoke the functor until the corresponding MPI_Test tells me that the message went through.

In systems with heavy MPI usage, this can help to avoid deadlocks.

Definition at line 317 of file GridStatistics.cpp.

References Datatype.

◆ sendAndPollDanglingMessages()

◆ setCoarseningHasBeenVetoed()

void peano4::grid::GridStatistics::setCoarseningHasBeenVetoed ( bool value)

Definition at line 83 of file GridStatistics.cpp.

References _coarseningHasBeenVetoed.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setMinH() [1/2]

void peano4::grid::GridStatistics::setMinH ( const tarch::la::Vector< Dimensions, double > & value)

Definition at line 99 of file GridStatistics.cpp.

References _minH.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setMinH() [2/2]

void peano4::grid::GridStatistics::setMinH ( int index,
double value )

Definition at line 107 of file GridStatistics.cpp.

References _minH.

◆ setNumberOfLocalRefinedCells()

void peano4::grid::GridStatistics::setNumberOfLocalRefinedCells ( int value)

Definition at line 59 of file GridStatistics.cpp.

References _numberOfLocalRefinedCells.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setNumberOfLocalUnrefinedCells()

void peano4::grid::GridStatistics::setNumberOfLocalUnrefinedCells ( int value)

Definition at line 43 of file GridStatistics.cpp.

References _numberOfLocalUnrefinedCells.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setNumberOfRemoteRefinedCells()

void peano4::grid::GridStatistics::setNumberOfRemoteRefinedCells ( int value)

Definition at line 67 of file GridStatistics.cpp.

References _numberOfRemoteRefinedCells.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setNumberOfRemoteUnrefinedCells()

void peano4::grid::GridStatistics::setNumberOfRemoteUnrefinedCells ( int value)

Definition at line 51 of file GridStatistics.cpp.

References _numberOfRemoteUnrefinedCells.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setRemovedEmptySubtree()

void peano4::grid::GridStatistics::setRemovedEmptySubtree ( bool value)

Definition at line 91 of file GridStatistics.cpp.

References _removedEmptySubtree.

Referenced by peano4::parallel::SpacetreeSet::cleanUpTrees(), peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ setStationarySweeps()

void peano4::grid::GridStatistics::setStationarySweeps ( int value)

Definition at line 75 of file GridStatistics.cpp.

References _stationarySweeps.

Referenced by peano4::grid::clear(), and GridStatistics().

Here is the caller graph for this function:

◆ shutdownDatatype()

void peano4::grid::GridStatistics::shutdownDatatype ( )
static

Free the underlying MPI datatype.

Definition at line 294 of file GridStatistics.cpp.

References Datatype, freeBoundaryExchangeDatatype(), freeForkDatatype(), freeGlobalCommunciationDatatype(), freeJoinDatatype(), and freeMultiscaleDataExchangeDatatype().

Referenced by peano4::parallel::Node::shutdownMPIDatatypes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

std::string peano4::grid::GridStatistics::toString ( ) const

Field Documentation

◆ _coarseningHasBeenVetoed

bool peano4::grid::GridStatistics::_coarseningHasBeenVetoed
private

◆ _minH

tarch::la::Vector<Dimensions,double> peano4::grid::GridStatistics::_minH
private

Definition at line 157 of file GridStatistics.h.

Referenced by getMinH(), getMinH(), initDatatype(), setMinH(), setMinH(), and toString().

◆ _numberOfLocalRefinedCells

int peano4::grid::GridStatistics::_numberOfLocalRefinedCells
private

◆ _numberOfLocalUnrefinedCells

int peano4::grid::GridStatistics::_numberOfLocalUnrefinedCells
private

◆ _numberOfRemoteRefinedCells

int peano4::grid::GridStatistics::_numberOfRemoteRefinedCells
private

◆ _numberOfRemoteUnrefinedCells

int peano4::grid::GridStatistics::_numberOfRemoteUnrefinedCells
private

◆ _removedEmptySubtree

bool peano4::grid::GridStatistics::_removedEmptySubtree
private

◆ _senderDestinationRank

int peano4::grid::GridStatistics::_senderDestinationRank
private

Definition at line 161 of file GridStatistics.h.

Referenced by getSenderRank(), receive(), and receive().

◆ _stationarySweeps

int peano4::grid::GridStatistics::_stationarySweeps
private

Definition at line 154 of file GridStatistics.h.

Referenced by getStationarySweeps(), initDatatype(), setStationarySweeps(), and toString().

◆ Datatype

MPI_Datatype peano4::grid::GridStatistics::Datatype = MPI_DATATYPE_NULL
staticprivate

Whenever we use LLVM's MPI extension (DaStGe), we rely on lazy initialisation of the datatype.

However, Peano calls init explicitly in most cases. Without the LLVM extension which caches the MPI datatype once constructed, this field stores the type.

Definition at line 170 of file GridStatistics.h.

Referenced by freeBoundaryExchangeDatatype(), freeForkDatatype(), freeGlobalCommunciationDatatype(), freeJoinDatatype(), freeMultiscaleDataExchangeDatatype(), getBoundaryExchangeDatatype(), getForkDatatype(), getGlobalCommunciationDatatype(), getJoinDatatype(), getMultiscaleDataExchangeDatatype(), initDatatype(), receive(), receive(), send(), send(), and shutdownDatatype().


The documentation for this struct was generated from the following files: