Peano 4
Loading...
Searching...
No Matches
peano4::grid::GridVertex Struct Reference

#include <GridVertex.h>

Collaboration diagram for peano4::grid::GridVertex:

Public Types

enum class  State : int {
  HangingVertex = 0 , New = 1 , Unrefined = 2 , Refined = 3 ,
  RefinementTriggered = 4 , Refining = 5 , EraseTriggered = 6 , Erasing = 7 ,
  Delete = 8
}
 
enum  ObjectConstruction { NoData }
 

Public Member Functions

 GridVertex ()
 
 GridVertex (State __state, tarch::la::Vector< TwoPowerD, int > __adjacentRanks, tarch::la::Vector< TwoPowerD, int > __backupOfAdjacentRanks, bool __hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep, bool __isAntecessorOfRefinedVertexInCurrentTreeSweep, bool __hasBeenParentOfSubtreeVertexInPreviousTreeSweep, bool __isParentOfSubtreeVertexInCurrentTreeSweep, int __numberOfAdjacentRefinedLocalCells, tarch::la::Vector< Dimensions, double > __x, int __level)
 
peano4::grid::GridVertex::State getState () const
 
void setState (State value)
 
tarch::la::Vector< TwoPowerD, intgetAdjacentRanks () const
 
void setAdjacentRanks (const tarch::la::Vector< TwoPowerD, int > &value)
 
int getAdjacentRanks (int index) const
 
void setAdjacentRanks (int index, int value)
 
tarch::la::Vector< TwoPowerD, intgetBackupOfAdjacentRanks () const
 
void setBackupOfAdjacentRanks (const tarch::la::Vector< TwoPowerD, int > &value)
 
int getBackupOfAdjacentRanks (int index) const
 
void setBackupOfAdjacentRanks (int index, int value)
 
bool getHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep () const
 
void setHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep (bool value)
 
bool getIsAntecessorOfRefinedVertexInCurrentTreeSweep () const
 
void setIsAntecessorOfRefinedVertexInCurrentTreeSweep (bool value)
 
bool getHasBeenParentOfSubtreeVertexInPreviousTreeSweep () const
 
void setHasBeenParentOfSubtreeVertexInPreviousTreeSweep (bool value)
 
bool getIsParentOfSubtreeVertexInCurrentTreeSweep () const
 
void setIsParentOfSubtreeVertexInCurrentTreeSweep (bool value)
 
int getNumberOfAdjacentRefinedLocalCells () const
 
void setNumberOfAdjacentRefinedLocalCells (int value)
 
int getLevel () const
 
void setLevel (int value)
 
 GridVertex (const GridVertex &copy)
 
GridVertexoperator= (const GridVertex &other)
 
PragmaPop int getSenderRank () const
 
 GridVertex (ObjectConstruction)
 
std::string toString () const
 

Static Public Member Functions

PragmaPush static SilenceUnknownAttribute 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 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::GridVertex &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::GridVertex &buffer, int source, int tag, MPI_Comm communicator)
 
static void send (const peano4::grid::GridVertex &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::GridVertex &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
 
static void sendAndPollDanglingMessages (const peano4::grid::GridVertex &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 
static void receiveAndPollDanglingMessages (peano4::grid::GridVertex &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 

Private Attributes

PragmaPush SilenceUnknownAttribute State _state
 
tarch::la::Vector< TwoPowerD, int_adjacentRanks
 
tarch::la::Vector< TwoPowerD, int_backupOfAdjacentRanks
 
bool _hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep
 
bool _isAntecessorOfRefinedVertexInCurrentTreeSweep
 
bool _hasBeenParentOfSubtreeVertexInPreviousTreeSweep
 
bool _isParentOfSubtreeVertexInCurrentTreeSweep
 
int _numberOfAdjacentRefinedLocalCells
 
PragmaPop int _level
 
int _senderDestinationRank
 

Static Private Attributes

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

Detailed Description

Definition at line 25 of file GridVertex.h.

Member Enumeration Documentation

◆ ObjectConstruction

Enumerator
NoData 

Definition at line 157 of file GridVertex.h.

◆ State

enum class peano4::grid::GridVertex::State : int
strong
Enumerator
HangingVertex 
New 
Unrefined 
Refined 
RefinementTriggered 
Refining 
EraseTriggered 
Erasing 
Delete 

Definition at line 27 of file GridVertex.h.

Constructor & Destructor Documentation

◆ GridVertex() [1/4]

peano4::grid::GridVertex::GridVertex ( )

Definition at line 39 of file GridVertex.h.

◆ GridVertex() [2/4]

peano4::grid::GridVertex::GridVertex ( State __state,
tarch::la::Vector< TwoPowerD, int > __adjacentRanks,
tarch::la::Vector< TwoPowerD, int > __backupOfAdjacentRanks,
bool __hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep,
bool __isAntecessorOfRefinedVertexInCurrentTreeSweep,
bool __hasBeenParentOfSubtreeVertexInPreviousTreeSweep,
bool __isParentOfSubtreeVertexInCurrentTreeSweep,
int __numberOfAdjacentRefinedLocalCells,
tarch::la::Vector< Dimensions, double > __x,
int __level )

◆ GridVertex() [3/4]

peano4::grid::GridVertex::GridVertex ( const GridVertex & copy)

Definition at line 32 of file GridVertex.cpp.

References setLevel(), and setX().

Here is the call graph for this function:

◆ GridVertex() [4/4]

peano4::grid::GridVertex::GridVertex ( ObjectConstruction )

Definition at line 159 of file GridVertex.h.

Member Function Documentation

◆ getAdjacentRanks() [1/2]

◆ getAdjacentRanks() [2/2]

int peano4::grid::GridVertex::getAdjacentRanks ( int index) const

Definition at line 128 of file GridVertex.cpp.

◆ getBackupOfAdjacentRanks() [1/2]

tarch::la::Vector< TwoPowerD, int > peano4::grid::GridVertex::getBackupOfAdjacentRanks ( ) const

Definition at line 138 of file GridVertex.cpp.

Referenced by peano4::grid::Spacetree::getNeighbourTrees(), and operator=().

Here is the caller graph for this function:

◆ getBackupOfAdjacentRanks() [2/2]

int peano4::grid::GridVertex::getBackupOfAdjacentRanks ( int index) const

Definition at line 148 of file GridVertex.cpp.

◆ getBoundaryExchangeDatatype()

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

Definition at line 280 of file GridVertex.cpp.

◆ getForkDatatype()

MPI_Datatype peano4::grid::GridVertex::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 262 of file GridVertex.cpp.

◆ getGlobalCommunciationDatatype()

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

Definition at line 268 of file GridVertex.cpp.

◆ getHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep()

bool peano4::grid::GridVertex::getHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep ( ) const

Definition at line 158 of file GridVertex.cpp.

Referenced by operator=().

Here is the caller graph for this function:

◆ getHasBeenParentOfSubtreeVertexInPreviousTreeSweep()

bool peano4::grid::GridVertex::getHasBeenParentOfSubtreeVertexInPreviousTreeSweep ( ) const

Definition at line 178 of file GridVertex.cpp.

Referenced by operator=().

Here is the caller graph for this function:

◆ getIsAntecessorOfRefinedVertexInCurrentTreeSweep()

bool peano4::grid::GridVertex::getIsAntecessorOfRefinedVertexInCurrentTreeSweep ( ) const

Definition at line 168 of file GridVertex.cpp.

Referenced by operator=(), and peano4::grid::Spacetree::updateVertexBeforeStore().

Here is the caller graph for this function:

◆ getIsParentOfSubtreeVertexInCurrentTreeSweep()

bool peano4::grid::GridVertex::getIsParentOfSubtreeVertexInCurrentTreeSweep ( ) const

Definition at line 188 of file GridVertex.cpp.

Referenced by operator=(), and peano4::grid::Spacetree::updateVertexBeforeStore().

Here is the caller graph for this function:

◆ getJoinDatatype()

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

Definition at line 274 of file GridVertex.cpp.

◆ getLevel()

int peano4::grid::GridVertex::getLevel ( ) const

Definition at line 240 of file GridVertex.cpp.

Referenced by operator=().

Here is the caller graph for this function:

◆ getMultiscaleDataExchangeDatatype()

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

Definition at line 286 of file GridVertex.cpp.

◆ getNumberOfAdjacentRefinedLocalCells()

int peano4::grid::GridVertex::getNumberOfAdjacentRefinedLocalCells ( ) const

Definition at line 198 of file GridVertex.cpp.

Referenced by operator=(), and peano4::grid::Spacetree::updateVertexBeforeStore().

Here is the caller graph for this function:

◆ getSenderRank()

int peano4::grid::GridVertex::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 291 of file GridVertex.cpp.

◆ getState()

◆ initDatatype()

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

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

Definition at line 296 of file GridVertex.cpp.

References TwoPowerD.

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

Here is the caller graph for this function:

◆ operator=()

◆ receive() [1/2]

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

Definition at line 436 of file GridVertex.cpp.

References _senderDestinationRank.

Referenced by receiveAndPollDanglingMessages().

Here is the caller graph for this function:

◆ receive() [2/2]

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

Definition at line 463 of file GridVertex.cpp.

References _senderDestinationRank.

◆ receiveAndPollDanglingMessages()

◆ send() [1/2]

void peano4::grid::GridVertex::send ( const peano4::grid::GridVertex & 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 431 of file GridVertex.cpp.

Referenced by sendAndPollDanglingMessages().

Here is the caller graph for this function:

◆ send() [2/2]

void peano4::grid::GridVertex::send ( const peano4::grid::GridVertex & 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 443 of file GridVertex.cpp.

◆ sendAndPollDanglingMessages()

◆ setAdjacentRanks() [1/2]

◆ setAdjacentRanks() [2/2]

void peano4::grid::GridVertex::setAdjacentRanks ( int index,
int value )

Definition at line 133 of file GridVertex.cpp.

◆ setBackupOfAdjacentRanks() [1/2]

◆ setBackupOfAdjacentRanks() [2/2]

void peano4::grid::GridVertex::setBackupOfAdjacentRanks ( int index,
int value )

Definition at line 153 of file GridVertex.cpp.

◆ setHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep()

void peano4::grid::GridVertex::setHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep ( bool value)

Definition at line 163 of file GridVertex.cpp.

Referenced by peano4::grid::createVertex(), GridVertex(), and peano4::grid::tests::GridTraversalEventGeneratorTest::testCreateLeaveCellTraversalEvent1().

Here is the caller graph for this function:

◆ setHasBeenParentOfSubtreeVertexInPreviousTreeSweep()

void peano4::grid::GridVertex::setHasBeenParentOfSubtreeVertexInPreviousTreeSweep ( bool value)

Definition at line 183 of file GridVertex.cpp.

Referenced by GridVertex().

Here is the caller graph for this function:

◆ setIsAntecessorOfRefinedVertexInCurrentTreeSweep()

void peano4::grid::GridVertex::setIsAntecessorOfRefinedVertexInCurrentTreeSweep ( bool value)

Definition at line 173 of file GridVertex.cpp.

Referenced by peano4::grid::createVertex(), GridVertex(), and peano4::grid::tests::GridTraversalEventGeneratorTest::testCreateLeaveCellTraversalEvent1().

Here is the caller graph for this function:

◆ setIsParentOfSubtreeVertexInCurrentTreeSweep()

void peano4::grid::GridVertex::setIsParentOfSubtreeVertexInCurrentTreeSweep ( bool value)

Definition at line 193 of file GridVertex.cpp.

Referenced by GridVertex().

Here is the caller graph for this function:

◆ setLevel()

void peano4::grid::GridVertex::setLevel ( int value)

Definition at line 245 of file GridVertex.cpp.

Referenced by peano4::grid::createVertex(), GridVertex(), and peano4::grid::tests::GridTraversalEventGeneratorTest::testCreateLeaveCellTraversalEvent1().

Here is the caller graph for this function:

◆ setNumberOfAdjacentRefinedLocalCells()

void peano4::grid::GridVertex::setNumberOfAdjacentRefinedLocalCells ( int value)

Definition at line 203 of file GridVertex.cpp.

Referenced by peano4::grid::createVertex(), and GridVertex().

Here is the caller graph for this function:

◆ setState()

◆ shutdownDatatype()

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

Free the underlying MPI datatype.

Definition at line 411 of file GridVertex.cpp.

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

Here is the caller graph for this function:

◆ toString()

Field Documentation

◆ _adjacentRanks

tarch::la::Vector<TwoPowerD, int> peano4::grid::GridVertex::_adjacentRanks
private

Definition at line 185 of file GridVertex.h.

◆ _backupOfAdjacentRanks

tarch::la::Vector<TwoPowerD, int> peano4::grid::GridVertex::_backupOfAdjacentRanks
private

Definition at line 187 of file GridVertex.h.

◆ _hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep

bool peano4::grid::GridVertex::_hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep
private

Definition at line 188 of file GridVertex.h.

◆ _hasBeenParentOfSubtreeVertexInPreviousTreeSweep

bool peano4::grid::GridVertex::_hasBeenParentOfSubtreeVertexInPreviousTreeSweep
private

Definition at line 190 of file GridVertex.h.

◆ _isAntecessorOfRefinedVertexInCurrentTreeSweep

bool peano4::grid::GridVertex::_isAntecessorOfRefinedVertexInCurrentTreeSweep
private

Definition at line 189 of file GridVertex.h.

◆ _isParentOfSubtreeVertexInCurrentTreeSweep

bool peano4::grid::GridVertex::_isParentOfSubtreeVertexInCurrentTreeSweep
private

Definition at line 191 of file GridVertex.h.

◆ _level

PragmaPop int peano4::grid::GridVertex::_level
private

Definition at line 203 of file GridVertex.h.

◆ _numberOfAdjacentRefinedLocalCells

int peano4::grid::GridVertex::_numberOfAdjacentRefinedLocalCells
private

Definition at line 192 of file GridVertex.h.

◆ _senderDestinationRank

int peano4::grid::GridVertex::_senderDestinationRank
private

Definition at line 207 of file GridVertex.h.

Referenced by receive(), and receive().

◆ _state

PragmaPush SilenceUnknownAttribute State peano4::grid::GridVertex::_state
private

Definition at line 180 of file GridVertex.h.

◆ Datatype

MPI_Datatype peano4::grid::GridVertex::Datatype
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 216 of file GridVertex.h.


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