Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to allow Lumberjack to own communicator #1513

Merged
merged 20 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
34806c5
Add option to allow Lumberjack to own communicator
gberg617 Mar 5, 2025
b6710bd
Merge branch 'develop' into feature/bergel1/lumberjack_set_communicator
gberg617 Mar 5, 2025
fbf8ad1
Merge branch 'develop' into feature/bergel1/lumberjack_set_communicator
gberg617 Mar 6, 2025
6089e5b
Merge branch 'develop' into feature/bergel1/lumberjack_set_communicator
gberg617 Mar 12, 2025
700658a
added initialize check and swap communicator
gberg617 Mar 12, 2025
79ea92a
Merge branch 'feature/bergel1/lumberjack_set_communicator' of https:/…
gberg617 Mar 12, 2025
d840e6d
added release notes and documentation
gberg617 Mar 12, 2025
75e5e5e
small wording fixes
gberg617 Mar 12, 2025
d94b1f4
changed swapCommunicator to setCommunicator
gberg617 Mar 14, 2025
93faaf6
small wording fix
gberg617 Mar 17, 2025
6b7552b
add nullptr check before calling delete
gberg617 Mar 17, 2025
b5a21f1
Merge branch 'develop' into feature/bergel1/lumberjack_set_communicator
gberg617 Mar 17, 2025
8720c85
Update src/axom/lumberjack/docs/sphinx/lumberjack_class.rst
gberg617 Mar 19, 2025
ba7fced
Update src/axom/lumberjack/tests/lumberjack_Lumberjack.hpp
gberg617 Mar 19, 2025
476a6ff
Update src/axom/lumberjack/docs/sphinx/lumberjack_class.rst
gberg617 Mar 19, 2025
8281b30
added ability to change ownership when setting communicator
gberg617 Mar 21, 2025
7528bd6
Merge branch 'feature/bergel1/lumberjack_set_communicator' of https:/…
gberg617 Mar 21, 2025
863a8b5
updated documentation
gberg617 Mar 21, 2025
628a1ba
removed some stuff
gberg617 Mar 21, 2025
f1f9126
Merge branch 'develop' into feature/bergel1/lumberjack_set_communicator
gberg617 Mar 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/axom/lumberjack/Lumberjack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ namespace axom
{
namespace lumberjack
{
void Lumberjack::initialize(Communicator* communicator, int ranksLimit)
void Lumberjack::initialize(Communicator* communicator,
int ranksLimit,
bool isCommunicatorOwned)
{
m_communicator = communicator;
m_isCommunicatorOwned = isCommunicatorOwned;
m_ranksLimit = ranksLimit;
m_combiners.push_back(new TextTagCombiner);
}

void Lumberjack::finalize()
{
if(m_isCommunicatorOwned)
{
delete m_communicator;
}
m_communicator = nullptr;
clearCombiners();
clearMessages();
Expand Down
7 changes: 6 additions & 1 deletion src/axom/lumberjack/Lumberjack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ class Lumberjack
* messages
* \param [in] ranksLimit Limit on how many ranks are individually tracker per
* Message.
* \param [in] isCommunicatorOwned When set to true, Lumberjack will be
* responsible for freeing communication object when finalize() is called.
*****************************************************************************
*/
void initialize(Communicator* communicator, int ranksLimit);
void initialize(Communicator* communicator,
int ranksLimit,
bool isCommunicatorOwned = false);

/*!
*****************************************************************************
Expand Down Expand Up @@ -239,6 +243,7 @@ class Lumberjack
void combineMessages();

Communicator* m_communicator;
bool m_isCommunicatorOwned;
int m_ranksLimit;
std::vector<Combiner*> m_combiners;
std::vector<Message*> m_messages;
Expand Down