AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::lumberjack Namespace Reference

Classes

class  BinaryTreeCommunicator
 A Communicator that utilizes a binary tree stucture of MPI nodes to scalably pass Message classes. More...
 
class  Combiner
 Abstract base class defining the interface of all Combiner classes. More...
 
class  Communicator
 Abstract base class defining the interface of all Communicator classes. More...
 
class  Lumberjack
 Class that all user interactions with Lumberjack are through. More...
 
class  Message
 Holds information about messages and where they came from. More...
 
class  RootCommunicator
 A Communicator that all MPI nodes communicate with the root node. This class does NOT scale and is provided for demonstration purposes only. More...
 
class  TextEqualityCombiner
 Combines Message classes if their Message::text are equal. More...
 
class  TextTagCombiner
 Combines Message classes if their Message::text and Message::tag are equal. More...
 

Functions

const char * packMessages (const std::vector< Message * > &messages)
 This packs all given Message classes into one const char buffer. More...
 
void unpackMessages (std::vector< Message * > &messages, const char *packedMessages, const int ranksLimit)
 This unpacks the given const char buffer and adds the created Messages classes to the given vector. More...
 
bool isPackedMessagesEmpty (const char *packedMessages)
 This checks if a given set of packed messages is empty. More...
 
const char * mpiBlockingReceiveMessages (MPI_Comm comm)
 Receives any Message sent to this rank. Returns null if terminating message is sent. More...
 
void mpiNonBlockingSendMessages (MPI_Comm comm, int destinationRank, const char *packedMessagesToBeSent)
 Sends all Message sent to the given rank. More...
 

Variables

const char *const zeroMessage = "0"
 Message to indicate no messages need to be sent from child node. More...
 
const char memberDelimiter = '*'
 Delimiter used for packing messages and separating their members. More...
 
const char rankDelimiter = ','
 Delimiter used for packing messages and separating their individual tracked ranks. More...
 

Function Documentation

◆ packMessages()

const char* axom::lumberjack::packMessages ( const std::vector< Message * > &  messages)

This packs all given Message classes into one const char buffer.

The messages are packed into the following format: <message count>[*<packed message size>*<packed message>]... This function does not alter the messages vector.

Parameters
[in]messagesMessage classes to be packed for sending
Returns
Packed char array of all given messages
Note
It is the caller's responsibility to deallocate the returned buffer

◆ unpackMessages()

void axom::lumberjack::unpackMessages ( std::vector< Message * > &  messages,
const char *  packedMessages,
const int  ranksLimit 
)

This unpacks the given const char buffer and adds the created Messages classes to the given vector.

The messages are packed into the following format: <message count>[*<packed message size>*<packed message>]... This function only adds to the messages vector and does not alter the packagedMessages parameter.

Note
It is the caller's responsibility to deallocate the Message added to the messages vector
Parameters
[in,out]messagesVector to append created messages to
[in]packedMessagesPacked messages to be unpacked
[in]ranksLimitLimits how many ranks are tracked per Message.

◆ isPackedMessagesEmpty()

bool axom::lumberjack::isPackedMessagesEmpty ( const char *  packedMessages)
inline

This checks if a given set of packed messages is empty.

Parameters
[in]packedMessagesPacked messages to be checked for empty.
Returns
Whether or not the given packed messages is empty.

References zeroMessage.

◆ mpiBlockingReceiveMessages()

const char* axom::lumberjack::mpiBlockingReceiveMessages ( MPI_Comm  comm)

Receives any Message sent to this rank. Returns null if terminating message is sent.

Parameters
[in]commThe MPI Communicator.

◆ mpiNonBlockingSendMessages()

void axom::lumberjack::mpiNonBlockingSendMessages ( MPI_Comm  comm,
int  destinationRank,
const char *  packedMessagesToBeSent 
)

Sends all Message sent to the given rank.

Clears and deletes all Message classes when done.

Parameters
[in]commThe MPI Communicator.
[in]destinationRankWhere the Message classes is being sent.
[in,out]packedMessagesToBeSentAll of the Message classes to be sent packed together.

Variable Documentation

◆ zeroMessage

const char* const axom::lumberjack::zeroMessage = "0"

Message to indicate no messages need to be sent from child node.

◆ memberDelimiter

const char axom::lumberjack::memberDelimiter = '*'

Delimiter used for packing messages and separating their members.

◆ rankDelimiter

const char axom::lumberjack::rankDelimiter = ','

Delimiter used for packing messages and separating their individual tracked ranks.