Peano 4
Loading...
Searching...
No Matches
peano4::parallel::TreeManagementMessage Struct Reference

#include <TreeManagementMessage.h>

Public Types

enum class  Action : int {
  RequestNewRemoteTree =0 , CreateNewRemoteTree =1 , RemoveChildTreeFromBooksAsChildBecameEmpty =2 , JoinWithWorker =3 ,
  Acknowledgement =4
}
 
enum  ObjectConstruction { NoData }
 

Public Member Functions

 TreeManagementMessage ()
 
 TreeManagementMessage (int __masterSpacetreeId, int __workerSpacetreeId, Action __action)
 
int getMasterSpacetreeId () const
 
void setMasterSpacetreeId (int value)
 
int getWorkerSpacetreeId () const
 
void setWorkerSpacetreeId (int value)
 
peano4::parallel::TreeManagementMessage::Action getAction () const
 
void setAction (Action value)
 
 TreeManagementMessage (const TreeManagementMessage &copy)=default
 
PragmaPop int getSenderRank () const
 
 TreeManagementMessage (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::parallel::TreeManagementMessage &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::parallel::TreeManagementMessage &buffer, int source, int tag, MPI_Comm communicator)
 
static void send (const peano4::parallel::TreeManagementMessage &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::parallel::TreeManagementMessage &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
 
static void sendAndPollDanglingMessages (const peano4::parallel::TreeManagementMessage &message, int destination, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 
static void receiveAndPollDanglingMessages (peano4::parallel::TreeManagementMessage &message, int source, int tag, MPI_Comm communicator=tarch::mpi::Rank::getInstance().getCommunicator())
 

Private Attributes

PragmaPush SilenceUnknownAttribute int _masterSpacetreeId
 
int _workerSpacetreeId
 
Action _action
 
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 27 of file TreeManagementMessage.h.

Member Enumeration Documentation

◆ Action

Enumerator
RequestNewRemoteTree 
CreateNewRemoteTree 
RemoveChildTreeFromBooksAsChildBecameEmpty 
JoinWithWorker 
Acknowledgement 

Definition at line 29 of file TreeManagementMessage.h.

◆ ObjectConstruction

Constructor & Destructor Documentation

◆ TreeManagementMessage() [1/4]

peano4::parallel::TreeManagementMessage::TreeManagementMessage ( )

Definition at line 33 of file TreeManagementMessage.h.

◆ TreeManagementMessage() [2/4]

peano4::parallel::TreeManagementMessage::TreeManagementMessage ( int __masterSpacetreeId,
int __workerSpacetreeId,
Action __action )

Definition at line 10 of file TreeManagementMessage.cpp.

References setAction(), setMasterSpacetreeId(), and setWorkerSpacetreeId().

Here is the call graph for this function:

◆ TreeManagementMessage() [3/4]

peano4::parallel::TreeManagementMessage::TreeManagementMessage ( const TreeManagementMessage & copy)
default

◆ TreeManagementMessage() [4/4]

peano4::parallel::TreeManagementMessage::TreeManagementMessage ( ObjectConstruction )

Definition at line 112 of file TreeManagementMessage.h.

Member Function Documentation

◆ getAction()

◆ getBoundaryExchangeDatatype()

MPI_Datatype peano4::parallel::TreeManagementMessage::getBoundaryExchangeDatatype ( )
static

Definition at line 94 of file TreeManagementMessage.cpp.

◆ getForkDatatype()

MPI_Datatype peano4::parallel::TreeManagementMessage::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 76 of file TreeManagementMessage.cpp.

◆ getGlobalCommunciationDatatype()

MPI_Datatype peano4::parallel::TreeManagementMessage::getGlobalCommunciationDatatype ( )
static

Definition at line 82 of file TreeManagementMessage.cpp.

◆ getJoinDatatype()

MPI_Datatype peano4::parallel::TreeManagementMessage::getJoinDatatype ( )
static

Definition at line 88 of file TreeManagementMessage.cpp.

◆ getMasterSpacetreeId()

int peano4::parallel::TreeManagementMessage::getMasterSpacetreeId ( ) const

Definition at line 34 of file TreeManagementMessage.cpp.

◆ getMultiscaleDataExchangeDatatype()

MPI_Datatype peano4::parallel::TreeManagementMessage::getMultiscaleDataExchangeDatatype ( )
static

Definition at line 100 of file TreeManagementMessage.cpp.

◆ getSenderRank()

int peano4::parallel::TreeManagementMessage::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 105 of file TreeManagementMessage.cpp.

◆ getWorkerSpacetreeId()

int peano4::parallel::TreeManagementMessage::getWorkerSpacetreeId ( ) const

Definition at line 44 of file TreeManagementMessage.cpp.

Referenced by peano4::parallel::SpacetreeSet::split().

Here is the caller graph for this function:

◆ initDatatype()

void peano4::parallel::TreeManagementMessage::initDatatype ( )
static

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

Definition at line 110 of file TreeManagementMessage.cpp.

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

Here is the caller graph for this function:

◆ receive() [1/2]

◆ receive() [2/2]

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

Definition at line 228 of file TreeManagementMessage.cpp.

References _senderDestinationRank.

◆ receiveAndPollDanglingMessages()

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

◆ send() [1/2]

void peano4::parallel::TreeManagementMessage::send ( const peano4::parallel::TreeManagementMessage & 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 196 of file TreeManagementMessage.cpp.

Referenced by peano4::parallel::SpacetreeSet::answerQuestions(), peano4::parallel::SpacetreeSet::cleanUpTrees(), sendAndPollDanglingMessages(), and peano4::parallel::tests::PingPongTest::testDaStGenArrayTreeManagementMessage().

Here is the caller graph for this function:

◆ send() [2/2]

void peano4::parallel::TreeManagementMessage::send ( const peano4::parallel::TreeManagementMessage & 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 208 of file TreeManagementMessage.cpp.

◆ sendAndPollDanglingMessages()

◆ setAction()

◆ setMasterSpacetreeId()

void peano4::parallel::TreeManagementMessage::setMasterSpacetreeId ( int value)

Definition at line 39 of file TreeManagementMessage.cpp.

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

Here is the caller graph for this function:

◆ setWorkerSpacetreeId()

void peano4::parallel::TreeManagementMessage::setWorkerSpacetreeId ( int value)

◆ shutdownDatatype()

void peano4::parallel::TreeManagementMessage::shutdownDatatype ( )
static

Free the underlying MPI datatype.

Definition at line 176 of file TreeManagementMessage.cpp.

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

Here is the caller graph for this function:

◆ toString()

Field Documentation

◆ _action

Action peano4::parallel::TreeManagementMessage::_action
private

Definition at line 128 of file TreeManagementMessage.h.

◆ _masterSpacetreeId

PragmaPush SilenceUnknownAttribute int peano4::parallel::TreeManagementMessage::_masterSpacetreeId
private

Definition at line 126 of file TreeManagementMessage.h.

◆ _senderDestinationRank

int peano4::parallel::TreeManagementMessage::_senderDestinationRank
private

Definition at line 133 of file TreeManagementMessage.h.

Referenced by receive(), and receive().

◆ _workerSpacetreeId

int peano4::parallel::TreeManagementMessage::_workerSpacetreeId
private

Definition at line 127 of file TreeManagementMessage.h.

◆ Datatype

MPI_Datatype peano4::parallel::TreeManagementMessage::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 142 of file TreeManagementMessage.h.


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