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, double > getX () 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, double > getH () 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, int > getAccessNumber () 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
 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 )

◆ AutomatonState() [3/4]

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

◆ ~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)

◆ freeBoundaryExchangeDatatype()

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

◆ freeForkDatatype()

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

◆ freeGlobalCommunciationDatatype()

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

◆ freeJoinDatatype()

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

◆ freeMultiscaleDataExchangeDatatype()

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

◆ getAccessNumber() [1/2]

tarch::la::Vector< DimensionsTimesTwo, int > peano4::grid::AutomatonState::getAccessNumber ( ) const

◆ getAccessNumber() [2/2]

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

◆ getBoundaryExchangeDatatype()

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

◆ getEvenFlags() [1/2]

std::bitset< Dimensions > peano4::grid::AutomatonState::getEvenFlags ( ) const

◆ getEvenFlags() [2/2]

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

◆ getForkDatatype()

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

◆ getGlobalCommunciationDatatype()

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

◆ getH() [1/2]

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

◆ getH() [2/2]

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

◆ getInverted()

bool peano4::grid::AutomatonState::getInverted ( ) const

◆ getJoinDatatype()

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

◆ getLevel()

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

◆ getMultiscaleDataExchangeDatatype()

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

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

◆ getX() [1/2]

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

◆ getX() [2/2]

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

◆ initDatatype()

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

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

◆ operator=()

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

◆ receive() [1/2]

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

◆ receive() [2/2]

static 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

◆ receiveAndPollDanglingMessages()

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

◆ send() [1/2]

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

◆ send() [2/2]

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

◆ sendAndPollDanglingMessages()

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

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

◆ setEvenFlags() [1/2]

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

◆ setEvenFlags() [2/2]

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

◆ setH() [1/2]

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

◆ setH() [2/2]

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

◆ setInverted()

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

◆ setLevel()

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

◆ setX() [1/2]

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

◆ setX() [2/2]

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

◆ shutdownDatatype()

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

Free the underlying MPI datatype.

◆ toString()

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

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.

◆ _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
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 file: