Skip to content

Commit

Permalink
#1359: LB: add function to print documentation for all LBs
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt authored and lifflander committed Sep 28, 2021
1 parent 2b59441 commit 15624bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,22 @@ void LBManager::printLBArgsHelp(LBType lb) {
}
}

/*static*/
void LBManager::printLBArgsHelp(std::string lb_name) {
if (lb_name.compare("NoLB") == 0) {
for (auto&& lb : vrt::collection::balance::lb_names_) {
vrt::collection::balance::LBManager::printLBArgsHelp(lb.first);
}
} else {
for (auto&& lb : vrt::collection::balance::lb_names_) {
if (lb_name == lb.second) {
vrt::collection::balance::LBManager::printLBArgsHelp(lb.first);
break;
}
}
}
}

void LBManager::startup() {
thePhase()->registerHookCollective(phase::PhaseHook::EndPostMigration, []{
auto const phase = thePhase()->getCurrentPhase();
Expand Down
8 changes: 8 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 @@ -141,6 +141,14 @@ struct LBManager : runtime::component::Component<LBManager> {
*/
static void printLBArgsHelp(LBType lb);

/**
* \internal
* \brief Print documentation for LB args for all LBs or the one specified
*
* \param[in] lb the load balancer in use
*/
static void printLBArgsHelp(std::string lb);

protected:
/**
* \internal
Expand Down

0 comments on commit 15624bf

Please sign in to comment.