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

Class that all user interactions with Lumberjack are through. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/lumberjack/Lumberjack.hpp>

Public Member Functions

void initialize (Communicator *communicator, int ranksLimit, bool isCommunicatorOwned=false)
 Called to initialize the Lumberjack. More...
 
void finalize ()
 Called to finalize the Lumberjack. More...
 
void addCombiner (Combiner *combiner)
 Adds a Combiner to the Lumberjack. More...
 
void removeCombiner (const std::string &combinerIdentifier)
 Removes a Combiner from the Lumberjack. More...
 
void clearCombiners ()
 Clears all Combiner classes from the Lumberjack. More...
 
void ranksLimit (int value)
 Sets the rank limit. More...
 
int ranksLimit ()
 Returns the limit on tracked ranks. More...
 
void clearMessages ()
 Clears all Message classes from the Lumberjack. More...
 
const std::vector< Message * > & getMessages () const
 Returns a const reference vector with all currently held Message classes. More...
 
void queueMessage (const std::string &text, double creationTime=0.0)
 Queues a message to be sent and combined. More...
 
void queueMessage (const std::string &text, const std::string &fileName, const int lineNumber, int level, double creationTime, const std::string &tag)
 Queues a message to be sent and combined. More...
 
void queueMessage (const std::string &text, const std::vector< int > &ranks, const int count, const std::string &fileName, const int lineNumber, int level, double creationTime, const std::string &tag)
 Queues a message to be sent and combined. More...
 
void pushMessagesOnce ()
 This pushes all messages once up the Communicator class's tree structure. More...
 
void pushMessagesFully ()
 This pushes all messages fully up the Communicator class's tree structure. More...
 
bool isOutputNode ()
 Function indicates whether this node should be outputting messages. The Communicator class's communication structure dictates this. More...
 
void setCommunicator (Communicator *communicator, bool isCommunicatorOwned)
 set communicator pointer stored in object as well as ownership More...
 
CommunicatorgetCommunicator ()
 get communicator pointer stored in object More...
 
bool isCommunicatorOwned ()
 Returns Boolean flag that controls whether communicator instance is owned by Lumberjack. More...
 

Detailed Description

Class that all user interactions with Lumberjack are through.

This class performs all the high level functionality of Lumberjack, such as, holding and combining Message classes and telling the given Communicator to push Message classes.

See also
BinaryTreeCommunicator RootCommunicator Message Combiner

Member Function Documentation

◆ initialize()

void axom::lumberjack::Lumberjack::initialize ( Communicator communicator,
int  ranksLimit,
bool  isCommunicatorOwned = false 
)

Called to initialize the Lumberjack.

This performs any setup work the Lumberjack needs before doing any work. It is required that this is called before using the Lumberjack.

Parameters
[in]communicatorThe Lumberjack Communicator that will send/receive messages
[in]ranksLimitLimit on how many ranks are individually tracker per Message.
[in]isCommunicatorOwnedWhen set to true, Lumberjack will be responsible for freeing communication object when finalize() is called.

◆ finalize()

void axom::lumberjack::Lumberjack::finalize ( )

Called to finalize the Lumberjack.

This performs any cleanup work the Lumberjack needs to do before going away. It is required that this is the last function called by Lumberjack.

◆ addCombiner()

void axom::lumberjack::Lumberjack::addCombiner ( Combiner combiner)

Adds a Combiner to the Lumberjack.

Lumberjack can have multiple Combiner classes. This is helpful when you have different combining criteria for different Message classes. If you try to add the same Combiner more than once, the second Combiner will not be added. This is determined solely on Combiner::id. Combiner classes that are added first have precedence. Lumberjack will call delete on the Combiner when finalize is called.

Parameters
[in]combinerThe Combiner that will be added.

◆ removeCombiner()

void axom::lumberjack::Lumberjack::removeCombiner ( const std::string &  combinerIdentifier)

Removes a Combiner from the Lumberjack.

Parameters
[in]combinerIdentifierThe Combiner identifier that will be removed.

This removes and calls delete on a Combiner held by the Lumberjack. If no Combiner::id matches the given identifier than nothing is removed.

◆ clearCombiners()

void axom::lumberjack::Lumberjack::clearCombiners ( )

Clears all Combiner classes from the Lumberjack.

This removes and calls delete on all Combiner classes held by the Lumberjack.

◆ ranksLimit() [1/2]

void axom::lumberjack::Lumberjack::ranksLimit ( int  value)

Sets the rank limit.

This is the limit on how many ranks generated a given message are individually tracked per Message. After the limit has been reached, only the Message::rankCount is incremented.

Parameters
[in]valueLimits how many ranks are tracked per Message.

◆ ranksLimit() [2/2]

int axom::lumberjack::Lumberjack::ranksLimit ( )

Returns the limit on tracked ranks.

This is the limit on how many ranks generated a given message are individually tracked per Message. After the limit has been reached, only the Message::rankCount is incremented.

Returns
The limit on tracked ranks

◆ clearMessages()

void axom::lumberjack::Lumberjack::clearMessages ( )

Clears all Message classes from the Lumberjack.

This removes and calls delete on all Messages classes held by Lumberjack.

◆ getMessages()

const std::vector<Message*>& axom::lumberjack::Lumberjack::getMessages ( ) const

Returns a const reference vector with all currently held Message classes.

This returns a const reference to the vector that holds the Message classes held by this node. You should check isOutputNode() to indicate if you should output messages depending on your communication scheme.

◆ queueMessage() [1/3]

void axom::lumberjack::Lumberjack::queueMessage ( const std::string &  text,
double  creationTime = 0.0 
)

Queues a message to be sent and combined.

Parameters
[in]textText of the Message.

This creates a Message and queues it to be sent through the Communicator to the root node. This message may be combined with others depending on the given criteria by the already defined Combiner classes. Depending on the behavior of the Communicator, the message will not be outputted immediately.

◆ queueMessage() [2/3]

void axom::lumberjack::Lumberjack::queueMessage ( const std::string &  text,
const std::string &  fileName,
const int  lineNumber,
int  level,
double  creationTime,
const std::string &  tag 
)

Queues a message to be sent and combined.

This creates a Message and queues it to be sent through the Communicator to the root node. This message may be combined with others depending on the given criteria by the already defined Combiner classes. Depending on the behavior of the Communicator, the message will not be outputted immediately.

Parameters
[in]textText of the Message
[in]fileNameFile name of Message
[in]lineNumberLine number of Message
[in]levelThe level of the severity of the Message.
[in]tagThe tag of where the Message originated.

◆ queueMessage() [3/3]

void axom::lumberjack::Lumberjack::queueMessage ( const std::string &  text,
const std::vector< int > &  ranks,
const int  count,
const std::string &  fileName,
const int  lineNumber,
int  level,
double  creationTime,
const std::string &  tag 
)

Queues a message to be sent and combined.

This creates a Message and queues it to be sent through the Communicator to the root node with a pre-existing ranks list. This message may be combined with others depending on the given criteria by the already defined Combiner classes. Depending on the behavior of the Communicator, the message will not be outputted immediately.

Parameters
[in]textText of the Message
[in]textRanks list
[in]fileNameFile name of Message
[in]lineNumberLine number of Message
[in]levelThe level of the severity of the Message.
[in]tagThe tag of where the Message originated.

◆ pushMessagesOnce()

void axom::lumberjack::Lumberjack::pushMessagesOnce ( )

This pushes all messages once up the Communicator class's tree structure.

All of the children push their Message classes to their parent node. This is helpful if you want to spread the work load of Lumberjack over a large set of work. Before and after Message classes are pushed, they are combined.

◆ pushMessagesFully()

void axom::lumberjack::Lumberjack::pushMessagesFully ( )

This pushes all messages fully up the Communicator class's tree structure.

All messages are continually pushed until all messages are pushed to the root node.After Message classes are pushed once they are combined before being pushed again.

◆ isOutputNode()

bool axom::lumberjack::Lumberjack::isOutputNode ( )

Function indicates whether this node should be outputting messages. The Communicator class's communication structure dictates this.

Returns
Boolean indicates whether you should output messages

◆ setCommunicator()

void axom::lumberjack::Lumberjack::setCommunicator ( Communicator communicator,
bool  isCommunicatorOwned 
)

set communicator pointer stored in object as well as ownership

◆ getCommunicator()

Communicator* axom::lumberjack::Lumberjack::getCommunicator ( )

get communicator pointer stored in object

Returns
Communicator pointer

◆ isCommunicatorOwned()

bool axom::lumberjack::Lumberjack::isCommunicatorOwned ( )

Returns Boolean flag that controls whether communicator instance is owned by Lumberjack.

Returns
Communicator pointer

The documentation for this class was generated from the following file: