AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Class that all user interactions with Lumberjack are through. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/lumberjack/Lumberjack.hpp>
Public Member Functions | |
void | initialize (Communicator *communicator, int ranksLimit) |
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) |
Queues a message to be sent and combined. More... | |
void | queueMessage (const std::string &text, const std::string &fileName, const int lineNumber, int level, 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... | |
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.
void axom::lumberjack::Lumberjack::initialize | ( | Communicator * | communicator, |
int | ranksLimit | ||
) |
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.
[in] | communicator | The Lumberjack Communicator that will send/receive messages |
[in] | ranksLimit | Limit on how many ranks are individually tracker per Message. |
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.
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.
[in] | combiner | The Combiner that will be added. |
void axom::lumberjack::Lumberjack::removeCombiner | ( | const std::string & | combinerIdentifier | ) |
Removes a Combiner from the Lumberjack.
[in] | combinerIdentifier | The 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.
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.
void axom::lumberjack::Lumberjack::ranksLimit | ( | int | value | ) |
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.
void axom::lumberjack::Lumberjack::clearMessages | ( | ) |
Clears all Message classes from the Lumberjack.
This removes and calls delete on all Messages classes held by Lumberjack.
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.
void axom::lumberjack::Lumberjack::queueMessage | ( | const std::string & | text | ) |
Queues a message to be sent and combined.
[in] | text | Text 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.
void axom::lumberjack::Lumberjack::queueMessage | ( | const std::string & | text, |
const std::string & | fileName, | ||
const int | lineNumber, | ||
int | level, | ||
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.
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.
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.
bool axom::lumberjack::Lumberjack::isOutputNode | ( | ) |
Function indicates whether this node should be outputting messages. The Communicator class's communication structure dictates this.