Skip to content

Commit

Permalink
Merge pull request #1758 from DARMA-tasking/1757-allow-destroy-lb-out…
Browse files Browse the repository at this point in the history
…side-manager

1757 Allow destroying an LB from outside the LBManager
  • Loading branch information
nlslatt authored May 3, 2022
2 parents 918ca75 + 3381f68 commit 3030d38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,14 @@ void LBManager::startup() {
});
}

void LBManager::destroyLB() {
// Destruct the objgroup that was used for LB
if (destroy_lb_ != nullptr) {
destroy_lb_();
destroy_lb_ = nullptr;
}
}

void LBManager::finishedLB(PhaseType phase) {
vt_debug_print(
normal, lb,
Expand All @@ -387,11 +395,7 @@ void LBManager::finishedLB(PhaseType phase) {
theNodeLBData()->startIterCleanup(phase, model_->getNumPastPhasesNeeded());
theNodeLBData()->outputLBDataForPhase(phase);

// Destruct the objgroup that was used for LB
if (destroy_lb_ != nullptr) {
destroy_lb_();
destroy_lb_ = nullptr;
}
destroyLB();
}

void LBManager::statsHandler(StatsMsgType* msg) {
Expand Down
2 changes: 2 additions & 0 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ struct LBManager : runtime::component::Component<LBManager> {
*/
static void printLBArgsHelp(std::string lb);

void destroyLB();

protected:
/**
* \internal
Expand Down

0 comments on commit 3030d38

Please sign in to comment.