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

#include <GridControlEvent.h>

Collaboration diagram for peano4::grid::GridControlEvent:

Public Types

enum class  RefinementControl : int { Refine =0 , Erase =1 }
 
enum  ObjectConstruction { NoData }
 

Public Member Functions

 GridControlEvent ()
 
 GridControlEvent (RefinementControl __refinementControl, tarch::la::Vector< Dimensions, double > __offset, tarch::la::Vector< Dimensions, double > __width, tarch::la::Vector< Dimensions, double > __h)
 
peano4::grid::GridControlEvent::RefinementControl getRefinementControl () const
 
void setRefinementControl (RefinementControl value)
 
tarch::la::Vector< Dimensions, doublegetOffset () const
 
void setOffset (const tarch::la::Vector< Dimensions, double > &value)
 
double getOffset (int index) const
 
void setOffset (int index, double value)
 
tarch::la::Vector< Dimensions, doublegetWidth () const
 
void setWidth (const tarch::la::Vector< Dimensions, double > &value)
 
double getWidth (int index) const
 
void setWidth (int index, double value)
 
tarch::la::Vector< Dimensions, doublegetH () const
 
void setH (const tarch::la::Vector< Dimensions, double > &value)
 
double getH (int index) const
 
void setH (int index, double value)
 
 GridControlEvent (const GridControlEvent &copy)=default
 
int getSenderRank () const
 
 GridControlEvent (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::GridControlEvent &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::GridControlEvent &buffer, int source, int tag, MPI_Comm communicator)
 
static void send (const peano4::grid::GridControlEvent &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::GridControlEvent &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
 
static void sendAndPollDanglingMessages (const peano4::grid::GridControlEvent &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 
static void receiveAndPollDanglingMessages (peano4::grid::GridControlEvent &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 

Private Attributes

RefinementControl _refinementControl
 
tarch::la::Vector< Dimensions, double_offset
 
tarch::la::Vector< Dimensions, double_width
 
tarch::la::Vector< Dimensions, double_h
 
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 34 of file GridControlEvent.h.

Member Enumeration Documentation

◆ ObjectConstruction

Enumerator
NoData 

Definition at line 135 of file GridControlEvent.h.

◆ RefinementControl

Enumerator
Refine 
Erase 

Definition at line 36 of file GridControlEvent.h.

Constructor & Destructor Documentation

◆ GridControlEvent() [1/4]

peano4::grid::GridControlEvent::GridControlEvent ( )

Definition at line 40 of file GridControlEvent.h.

◆ GridControlEvent() [2/4]

peano4::grid::GridControlEvent::GridControlEvent ( RefinementControl __refinementControl,
tarch::la::Vector< Dimensions, double > __offset,
tarch::la::Vector< Dimensions, double > __width,
tarch::la::Vector< Dimensions, double > __h )

Definition at line 6 of file GridControlEvent.cpp.

References setH(), setOffset(), setRefinementControl(), and setWidth().

Here is the call graph for this function:

◆ GridControlEvent() [3/4]

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

◆ GridControlEvent() [4/4]

peano4::grid::GridControlEvent::GridControlEvent ( ObjectConstruction )

Definition at line 139 of file GridControlEvent.h.

Member Function Documentation

◆ freeBoundaryExchangeDatatype()

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

Definition at line 149 of file GridControlEvent.cpp.

◆ freeForkDatatype()

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

Definition at line 122 of file GridControlEvent.cpp.

◆ freeGlobalCommunciationDatatype()

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

Definition at line 131 of file GridControlEvent.cpp.

◆ freeJoinDatatype()

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

Definition at line 140 of file GridControlEvent.cpp.

◆ freeMultiscaleDataExchangeDatatype()

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

Definition at line 158 of file GridControlEvent.cpp.

◆ getBoundaryExchangeDatatype()

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

Definition at line 111 of file GridControlEvent.cpp.

◆ getForkDatatype()

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

◆ getGlobalCommunciationDatatype()

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

◆ getH() [1/2]

◆ getH() [2/2]

double peano4::grid::GridControlEvent::getH ( int index) const

Definition at line 75 of file GridControlEvent.cpp.

◆ getJoinDatatype()

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

Definition at line 106 of file GridControlEvent.cpp.

◆ getMultiscaleDataExchangeDatatype()

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

Definition at line 116 of file GridControlEvent.cpp.

◆ getOffset() [1/2]

◆ getOffset() [2/2]

double peano4::grid::GridControlEvent::getOffset ( int index) const

Definition at line 43 of file GridControlEvent.cpp.

◆ getRefinementControl()

peano4::grid::GridControlEvent::RefinementControl peano4::grid::GridControlEvent::getRefinementControl ( ) const

Definition at line 27 of file GridControlEvent.cpp.

Referenced by peano4::grid::internal::equals(), and peano4::grid::internal::refinementEventOverrulesCoarsening().

Here is the caller graph for this function:

◆ getSenderRank()

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

◆ getWidth() [1/2]

◆ getWidth() [2/2]

double peano4::grid::GridControlEvent::getWidth ( int index) const

Definition at line 59 of file GridControlEvent.cpp.

◆ initDatatype()

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

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

Definition at line 170 of file GridControlEvent.cpp.

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

Here is the caller graph for this function:

◆ receive() [1/2]

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

Definition at line 259 of file GridControlEvent.cpp.

References _senderDestinationRank.

Referenced by receiveAndPollDanglingMessages().

Here is the caller graph for this function:

◆ receive() [2/2]

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

Definition at line 284 of file GridControlEvent.cpp.

References _senderDestinationRank.

◆ receiveAndPollDanglingMessages()

◆ send() [1/2]

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

Referenced by sendAndPollDanglingMessages().

Here is the caller graph for this function:

◆ send() [2/2]

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

◆ sendAndPollDanglingMessages()

◆ setH() [1/2]

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

◆ setH() [2/2]

void peano4::grid::GridControlEvent::setH ( int index,
double value )

Definition at line 79 of file GridControlEvent.cpp.

◆ setOffset() [1/2]

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

◆ setOffset() [2/2]

void peano4::grid::GridControlEvent::setOffset ( int index,
double value )

Definition at line 47 of file GridControlEvent.cpp.

◆ setRefinementControl()

void peano4::grid::GridControlEvent::setRefinementControl ( RefinementControl value)

◆ setWidth() [1/2]

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

◆ setWidth() [2/2]

void peano4::grid::GridControlEvent::setWidth ( int index,
double value )

Definition at line 63 of file GridControlEvent.cpp.

◆ shutdownDatatype()

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

Free the underlying MPI datatype.

Definition at line 242 of file GridControlEvent.cpp.

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

Here is the caller graph for this function:

◆ toString()

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

Definition at line 13 of file GridControlEvent.cpp.

Referenced by exahype2::RefinementControl::addCommand(), and peano4::grid::internal::mergeAdjacentRefinementEvents().

Here is the caller graph for this function:

Field Documentation

◆ _h

tarch::la::Vector<Dimensions,double> peano4::grid::GridControlEvent::_h
private

Definition at line 154 of file GridControlEvent.h.

◆ _offset

tarch::la::Vector<Dimensions,double> peano4::grid::GridControlEvent::_offset
private

◆ _refinementControl

RefinementControl peano4::grid::GridControlEvent::_refinementControl
private

Definition at line 151 of file GridControlEvent.h.

◆ _senderDestinationRank

int peano4::grid::GridControlEvent::_senderDestinationRank
private

Definition at line 158 of file GridControlEvent.h.

Referenced by receive(), and receive().

◆ _width

tarch::la::Vector<Dimensions,double> peano4::grid::GridControlEvent::_width
private

Definition at line 153 of file GridControlEvent.h.

◆ Datatype

MPI_Datatype peano4::grid::GridControlEvent::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 167 of file GridControlEvent.h.


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