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

#include <AutomatonState.h>

Collaboration diagram for peano4::grid::AutomatonState:

Public Types

enum  ObjectConstruction { NoData }
 

Public Member Functions

 AutomatonState ()=default
 
 AutomatonState (int __level, tarch::la::Vector< Dimensions, double > __x, tarch::la::Vector< Dimensions, double > __h, bool __inverted, std::bitset< Dimensions > __evenFlags, tarch::la::Vector< DimensionsTimesTwo, int > __accessNumber)
 
 AutomatonState (const AutomatonState &copy)
 
AutomatonStateoperator= (const AutomatonState &other)
 
 ~AutomatonState ()=default
 
int getLevel () const
 
void setLevel (int value)
 
tarch::la::Vector< Dimensions, doublegetX () const
 
void setX (const tarch::la::Vector< Dimensions, double > &value)
 
double getX (int index) const
 
void setX (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)
 
bool getInverted () const
 
void setInverted (bool value)
 
std::bitset< Dimensions > getEvenFlags () const
 
void setEvenFlags (const std::bitset< Dimensions > &value)
 
bool getEvenFlags (int index) const
 
void setEvenFlags (int index, bool value)
 
void flipEvenFlags (int index)
 
tarch::la::Vector< DimensionsTimesTwo, intgetAccessNumber () const
 
void setAccessNumber (const tarch::la::Vector< DimensionsTimesTwo, int > &value)
 
int getAccessNumber (int index) const
 
void setAccessNumber (int index, int value)
 
int getSenderRank () const
 
 AutomatonState (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::AutomatonState &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::AutomatonState &buffer, int source, int tag, MPI_Comm communicator)
 
static void send (const peano4::grid::AutomatonState &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::AutomatonState &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
 
static void sendAndPollDanglingMessages (const peano4::grid::AutomatonState &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 
static void receiveAndPollDanglingMessages (peano4::grid::AutomatonState &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 

Private Attributes

int _level
 
tarch::la::Vector< Dimensions, double_x
 
tarch::la::Vector< Dimensions, double_h
 
bool _inverted
 
std::bitset< Dimensions > _evenFlags
 
tarch::la::Vector< DimensionsTimesTwo, int_accessNumber
 
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 32 of file AutomatonState.h.

Member Enumeration Documentation

◆ ObjectConstruction

Enumerator
NoData 

Definition at line 160 of file AutomatonState.h.

Constructor & Destructor Documentation

◆ AutomatonState() [1/4]

peano4::grid::AutomatonState::AutomatonState ( )
default

◆ AutomatonState() [2/4]

peano4::grid::AutomatonState::AutomatonState ( int __level,
tarch::la::Vector< Dimensions, double > __x,
tarch::la::Vector< Dimensions, double > __h,
bool __inverted,
std::bitset< Dimensions > __evenFlags,
tarch::la::Vector< DimensionsTimesTwo, int > __accessNumber )

Definition at line 6 of file AutomatonState.cpp.

References setAccessNumber(), setEvenFlags(), setH(), setInverted(), setLevel(), and setX().

Here is the call graph for this function:

◆ AutomatonState() [3/4]

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

Definition at line 15 of file AutomatonState.cpp.

References setEvenFlags(), setH(), setInverted(), setLevel(), and setX().

Here is the call graph for this function:

◆ ~AutomatonState()

peano4::grid::AutomatonState::~AutomatonState ( )
default

◆ AutomatonState() [4/4]

peano4::grid::AutomatonState::AutomatonState ( ObjectConstruction )

Definition at line 162 of file AutomatonState.h.

Member Function Documentation

◆ flipEvenFlags()

void peano4::grid::AutomatonState::flipEvenFlags ( int index)

Definition at line 161 of file AutomatonState.cpp.

Referenced by peano4::grid::PeanoCurve::invertEvenFlag().

Here is the caller graph for this function:

◆ freeBoundaryExchangeDatatype()

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

Definition at line 263 of file AutomatonState.cpp.

◆ freeForkDatatype()

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

Definition at line 236 of file AutomatonState.cpp.

◆ freeGlobalCommunciationDatatype()

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

Definition at line 245 of file AutomatonState.cpp.

◆ freeJoinDatatype()

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

Definition at line 254 of file AutomatonState.cpp.

◆ freeMultiscaleDataExchangeDatatype()

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

Definition at line 272 of file AutomatonState.cpp.

◆ getAccessNumber() [1/2]

◆ getAccessNumber() [2/2]

int peano4::grid::AutomatonState::getAccessNumber ( int index) const

Definition at line 184 of file AutomatonState.cpp.

◆ getBoundaryExchangeDatatype()

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

Definition at line 224 of file AutomatonState.cpp.

◆ getEvenFlags() [1/2]

◆ getEvenFlags() [2/2]

bool peano4::grid::AutomatonState::getEvenFlags ( int index) const

Definition at line 151 of file AutomatonState.cpp.

◆ getForkDatatype()

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

◆ getGlobalCommunciationDatatype()

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

Definition at line 212 of file AutomatonState.cpp.

◆ getH() [1/2]

◆ getH() [2/2]

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

Definition at line 117 of file AutomatonState.cpp.

◆ getInverted()

◆ getJoinDatatype()

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

Definition at line 218 of file AutomatonState.cpp.

◆ getLevel()

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

◆ getMultiscaleDataExchangeDatatype()

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

Definition at line 230 of file AutomatonState.cpp.

◆ getSenderRank()

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

◆ getX() [1/2]

tarch::la::Vector< Dimensions, double > peano4::grid::AutomatonState::getX ( ) const

◆ getX() [2/2]

double peano4::grid::AutomatonState::getX ( int index) const

Definition at line 89 of file AutomatonState.cpp.

◆ initDatatype()

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

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

Definition at line 285 of file AutomatonState.cpp.

References DimensionsTimesTwo.

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

Here is the caller graph for this function:

◆ operator=()

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

Definition at line 24 of file AutomatonState.cpp.

References getAccessNumber(), getEvenFlags(), getH(), getInverted(), getLevel(), getX(), setEvenFlags(), setH(), setInverted(), setLevel(), and setX().

Here is the call graph for this function:

◆ receive() [1/2]

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

Definition at line 388 of file AutomatonState.cpp.

References _senderDestinationRank.

Referenced by peano4::parallel::SpacetreeSet::answerQuestions(), and receiveAndPollDanglingMessages().

Here is the caller graph for this function:

◆ receive() [2/2]

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

Definition at line 415 of file AutomatonState.cpp.

References _senderDestinationRank.

◆ receiveAndPollDanglingMessages()

◆ send() [1/2]

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

Referenced by peano4::parallel::SpacetreeSet::addSpacetree(), and sendAndPollDanglingMessages().

Here is the caller graph for this function:

◆ send() [2/2]

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

◆ sendAndPollDanglingMessages()

◆ setAccessNumber() [1/2]

void peano4::grid::AutomatonState::setAccessNumber ( const tarch::la::Vector< DimensionsTimesTwo, int > & value)

◆ setAccessNumber() [2/2]

void peano4::grid::AutomatonState::setAccessNumber ( int index,
int value )

Definition at line 189 of file AutomatonState.cpp.

◆ setEvenFlags() [1/2]

void peano4::grid::AutomatonState::setEvenFlags ( const std::bitset< Dimensions > & value)

Definition at line 145 of file AutomatonState.cpp.

Referenced by AutomatonState(), peano4::grid::Spacetree::Spacetree(), and peano4::grid::Spacetree::Spacetree().

Here is the caller graph for this function:

◆ setEvenFlags() [2/2]

void peano4::grid::AutomatonState::setEvenFlags ( int index,
bool value )

Definition at line 156 of file AutomatonState.cpp.

◆ setH() [1/2]

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

Definition at line 109 of file AutomatonState.cpp.

Referenced by AutomatonState(), peano4::grid::Spacetree::refineState(), peano4::grid::Spacetree::Spacetree(), and peano4::grid::Spacetree::Spacetree().

Here is the caller graph for this function:

◆ setH() [2/2]

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

Definition at line 122 of file AutomatonState.cpp.

◆ setInverted()

void peano4::grid::AutomatonState::setInverted ( bool value)

Definition at line 132 of file AutomatonState.cpp.

Referenced by AutomatonState(), peano4::grid::Spacetree::Spacetree(), and peano4::grid::Spacetree::Spacetree().

Here is the caller graph for this function:

◆ setLevel()

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

Definition at line 66 of file AutomatonState.cpp.

Referenced by AutomatonState(), peano4::grid::Spacetree::refineState(), peano4::grid::Spacetree::Spacetree(), and peano4::grid::Spacetree::Spacetree().

Here is the caller graph for this function:

◆ setX() [1/2]

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

Definition at line 81 of file AutomatonState.cpp.

Referenced by AutomatonState(), peano4::grid::Spacetree::refineState(), peano4::grid::Spacetree::Spacetree(), and peano4::grid::Spacetree::Spacetree().

Here is the caller graph for this function:

◆ setX() [2/2]

void peano4::grid::AutomatonState::setX ( int index,
double value )

Definition at line 94 of file AutomatonState.cpp.

◆ shutdownDatatype()

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

Free the underlying MPI datatype.

Definition at line 369 of file AutomatonState.cpp.

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

Here is the caller graph for this function:

◆ toString()

Field Documentation

◆ _accessNumber

tarch::la::Vector<DimensionsTimesTwo, int> peano4::grid::AutomatonState::_accessNumber
private

Definition at line 208 of file AutomatonState.h.

◆ _evenFlags

std::bitset<Dimensions> peano4::grid::AutomatonState::_evenFlags
private

Definition at line 202 of file AutomatonState.h.

◆ _h

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

Definition at line 195 of file AutomatonState.h.

◆ _inverted

bool peano4::grid::AutomatonState::_inverted
private

Definition at line 197 of file AutomatonState.h.

◆ _level

int peano4::grid::AutomatonState::_level
private

Definition at line 184 of file AutomatonState.h.

◆ _senderDestinationRank

int peano4::grid::AutomatonState::_senderDestinationRank
private

Definition at line 212 of file AutomatonState.h.

Referenced by receive(), and receive().

◆ _x

tarch::la::Vector<Dimensions, double> peano4::grid::AutomatonState::_x
private

Definition at line 189 of file AutomatonState.h.

◆ Datatype

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


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