From dc006677e9141596cb16c2085f9c5ada71ec939f Mon Sep 17 00:00:00 2001 From: Nicole Lemaster Slattengren Date: Fri, 17 Sep 2021 15:36:14 -0700 Subject: [PATCH] #1359: LB: improve printing of lb arg documentation --- .../collection/balance/lb_invoke/lb_manager.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc index 620f51925e..c8d33c8235 100644 --- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc +++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc @@ -262,6 +262,7 @@ void LBManager::startLB(PhaseType phase, LBType lb) { runLB(base_proxy, phase); } +/*static*/ void LBManager::printLBArgsHelp(LBType lb) { if (theContext()->getNode() == 0) { fmt::print("\nLB arguments for {}:\n\n", lb_names_[lb]); @@ -284,14 +285,22 @@ void LBManager::printLBArgsHelp(LBType lb) { case LBType::RandomLB: help = std::move(lb::RandomLB::getInputKeysWithHelp()); break; + case LBType::NoLB: + // deliberately skip retrieving arguments + break; default: fmt::print("Documentation has not been provided for this LB.\n\n"); + return; break; } - for (auto &arg_help : help) { - fmt::print("Argument: {}\n", arg_help.first); - fmt::print("{}\n", arg_help.second); + if (help.size() > 0) { + for (auto &arg_help : help) { + fmt::print("Argument: {}\n", arg_help.first); + fmt::print("{}\n", arg_help.second); + } + } else { + fmt::print("No LB arguments are supported by this load balancer.\n\n"); } } }