Peano
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, int > getAdjacentRanks () 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, int > getBackupOfAdjacentRanks () 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)
 
GridVertex & operator= (const GridVertex &other)
 
int getSenderRank () const
 
 GridVertex (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::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

State _state
 
tarch::la::Vector< TwoPowerD, int > _adjacentRanks
 
tarch::la::Vector< TwoPowerD, int > _backupOfAdjacentRanks
 
bool _hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep
 
bool _isAntecessorOfRefinedVertexInCurrentTreeSweep
 
bool _hasBeenParentOfSubtreeVertexInPreviousTreeSweep
 
bool _isParentOfSubtreeVertexInCurrentTreeSweep
 
int _numberOfAdjacentRefinedLocalCells
 
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 173 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)

◆ GridVertex() [4/4]

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

Definition at line 175 of file GridVertex.h.

Member Function Documentation

◆ freeBoundaryExchangeDatatype()

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

◆ freeForkDatatype()

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

◆ freeGlobalCommunciationDatatype()

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

◆ freeJoinDatatype()

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

◆ freeMultiscaleDataExchangeDatatype()

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

◆ getAdjacentRanks() [1/2]

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

Definition at line 247 of file GridVertex.h.

References TwoPowerD.

◆ getAdjacentRanks() [2/2]

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

Definition at line 265 of file GridVertex.h.

◆ getBackupOfAdjacentRanks() [1/2]

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

Definition at line 275 of file GridVertex.h.

◆ getBackupOfAdjacentRanks() [2/2]

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

Definition at line 285 of file GridVertex.h.

◆ getBoundaryExchangeDatatype()

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

◆ getForkDatatype()

static 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.

◆ getGlobalCommunciationDatatype()

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

◆ getHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep()

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

Definition at line 295 of file GridVertex.h.

◆ getHasBeenParentOfSubtreeVertexInPreviousTreeSweep()

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

Definition at line 315 of file GridVertex.h.

◆ getIsAntecessorOfRefinedVertexInCurrentTreeSweep()

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

Definition at line 305 of file GridVertex.h.

◆ getIsParentOfSubtreeVertexInCurrentTreeSweep()

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

Definition at line 325 of file GridVertex.h.

◆ getJoinDatatype()

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

◆ getLevel()

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

Definition at line 377 of file GridVertex.h.

◆ getMultiscaleDataExchangeDatatype()

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

◆ getNumberOfAdjacentRefinedLocalCells()

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

Definition at line 335 of file GridVertex.h.

◆ 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.

◆ getState()

peano4::grid::GridVertex::State peano4::grid::GridVertex::getState ( ) const

Definition at line 237 of file GridVertex.h.

References _state.

◆ initDatatype()

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

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

◆ operator=()

GridVertex & peano4::grid::GridVertex::operator= ( const GridVertex &  other)

◆ receive() [1/2]

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

◆ receive() [2/2]

static 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

◆ receiveAndPollDanglingMessages()

static void peano4::grid::GridVertex::receiveAndPollDanglingMessages ( peano4::grid::GridVertex &  message,
int  source,
int  tag,
MPI_Comm  communicator = tarch::mpi::Rank::getInstance().getCommunicator() 
)
static

◆ send() [1/2]

static 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.

◆ send() [2/2]

static 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.

◆ sendAndPollDanglingMessages()

static void peano4::grid::GridVertex::sendAndPollDanglingMessages ( const peano4::grid::GridVertex &  message,
int  destination,
int  tag,
MPI_Comm  communicator = tarch::mpi::Rank::getInstance().getCommunicator() 
)
static

◆ setAdjacentRanks() [1/2]

void peano4::grid::GridVertex::setAdjacentRanks ( const tarch::la::Vector< TwoPowerD, int > &  value)

Definition at line 257 of file GridVertex.h.

References TwoPowerD.

◆ setAdjacentRanks() [2/2]

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

Definition at line 270 of file GridVertex.h.

◆ setBackupOfAdjacentRanks() [1/2]

void peano4::grid::GridVertex::setBackupOfAdjacentRanks ( const tarch::la::Vector< TwoPowerD, int > &  value)

Definition at line 280 of file GridVertex.h.

◆ setBackupOfAdjacentRanks() [2/2]

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

Definition at line 290 of file GridVertex.h.

◆ setHasBeenAntecessorOfRefinedVertexInPreviousTreeSweep()

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

Definition at line 300 of file GridVertex.h.

◆ setHasBeenParentOfSubtreeVertexInPreviousTreeSweep()

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

Definition at line 320 of file GridVertex.h.

◆ setIsAntecessorOfRefinedVertexInCurrentTreeSweep()

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

Definition at line 310 of file GridVertex.h.

◆ setIsParentOfSubtreeVertexInCurrentTreeSweep()

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

Definition at line 330 of file GridVertex.h.

◆ setLevel()

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

Definition at line 382 of file GridVertex.h.

◆ setNumberOfAdjacentRefinedLocalCells()

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

Definition at line 340 of file GridVertex.h.

◆ setState()

void peano4::grid::GridVertex::setState ( State  value)

Definition at line 242 of file GridVertex.h.

◆ shutdownDatatype()

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

Free the underlying MPI datatype.

◆ toString()

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

Field Documentation

◆ _adjacentRanks

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

Definition at line 201 of file GridVertex.h.

◆ _backupOfAdjacentRanks

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

Definition at line 203 of file GridVertex.h.

◆ _hasBeenAntecessorOfRefinedVertexInPreviousTreeSweep

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

Definition at line 204 of file GridVertex.h.

◆ _hasBeenParentOfSubtreeVertexInPreviousTreeSweep

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

Definition at line 206 of file GridVertex.h.

◆ _isAntecessorOfRefinedVertexInCurrentTreeSweep

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

Definition at line 205 of file GridVertex.h.

◆ _isParentOfSubtreeVertexInCurrentTreeSweep

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

Definition at line 207 of file GridVertex.h.

◆ _level

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

Definition at line 218 of file GridVertex.h.

◆ _numberOfAdjacentRefinedLocalCells

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

Definition at line 208 of file GridVertex.h.

◆ _senderDestinationRank

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

Definition at line 222 of file GridVertex.h.

◆ _state

State peano4::grid::GridVertex::_state
private

Definition at line 196 of file GridVertex.h.

Referenced by getState().

◆ 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 231 of file GridVertex.h.


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