vt::vrt::collection::balance::LBManager struct

A VT component that manages creation and coordination of load balancers.

Manages starting and stopping load balancers depending on user's selection and invocation.

Base classes

template<typename T>
struct vt::runtime::component::Component<LBManager>
Component class for a generic VT runtime module, CRTP'ed over the component's actual type

Public types

using LBProxyType = objgroup::proxy::Proxy<lb::BaseLB>
using QuantityType = lb::StatisticQuantityMap
using StatisticMapType = lb::StatisticMap

Public static functions

static auto construct() -> std::unique_ptr<LBManager>
static void printLBArgsHelp(LBType lb)
Print documentation for LB args for the chosen LB.
static void printLBArgsHelp(std::string lb)
Print documentation for LB args for all LBs or the one specified.

Constructors, destructors, conversion operators

LBManager() defaulted
System call to construct a LBManager.
LBManager(LBManager const&) deleted
LBManager(LBManager&&) defaulted
~LBManager() virtual

Public functions

auto name() -> std::string override
Get the name of the component.
void startup() override
Empty default overridden startup method.
void finalize() override
Empty default overridden finalize method.
void fatalError() override
Invoked if an fatal error occurs.
auto decideLBToRun(PhaseType phase, bool try_file = true) -> LBType
Decide which LB to invoke given a certain phase.
auto getProxy() const -> objgroup::proxy::Proxy<LBManager>
Get the proxy for the LBManager.
void setProxy(objgroup::proxy::Proxy<LBManager> proxy)
Setup the proxy for the LBManager.
void selectStartLB(PhaseType phase, vt::Callback<ReassignmentMsg> cb)
Collectively start load balancing after deciding which to run.
void selectStartLB(PhaseType phase)
Collectively start load balancing after deciding which to run.
void startLB(PhaseType phase, LBType lb, vt::Callback<ReassignmentMsg> cb)
Collectively start load balancing.
void destroyLB()
void setLoadModel(std::shared_ptr<LoadModel> model)
Set a model of expected object loads to use in place of the current installed model.
auto getBaseLoadModel() -> std::shared_ptr<LoadModel>
Get the system-set basic model of object load.
auto getLoadModel() -> std::shared_ptr<LoadModel>
Get the currently installed model of object load.
template<typename SerializerT>
void serialize(SerializerT& s)
void stagePreLBStatistics(const StatisticMapType& statistics)
void stagePostLBStatistics(const StatisticMapType& statistics, int32_t migration_count)
void commitPhaseStatistics(PhaseType phase)
template<typename LB>
auto makeLB(std::string const& lb_name = {}) -> LBProxyType
Collectively construct a new load balancer.
void computeStatistics(std::shared_ptr<LoadModel> model, bool comm_collectives, PhaseType phase, vt::Callback<std::vector<balance::LoadData>> cb)
Compute statistics given a load model.
void statsHandler(std::vector<balance::LoadData> const& in_stat_vec)
auto getPhaseInfo() -> lb::PhaseInfo*
void setComputingBeforeLBStats(bool before_lb)

Protected functions

void finishedLB(PhaseType phase)
Call when LB is finished to complete post-LB actions.
void runLB(PhaseType phase, vt::Callback<ReassignmentMsg> cb)
Run the currently chosen load balancer.
void defaultPostLBWork(ReassignmentMsg* r)

Function documentation

static void vt::vrt::collection::balance::LBManager::printLBArgsHelp(LBType lb)

Print documentation for LB args for the chosen LB.

Parameters
lb in the load balancer to query

static void vt::vrt::collection::balance::LBManager::printLBArgsHelp(std::string lb)

Print documentation for LB args for all LBs or the one specified.

Parameters
lb in the load balancer in use

LBType vt::vrt::collection::balance::LBManager::decideLBToRun(PhaseType phase, bool try_file = true)

Decide which LB to invoke given a certain phase.

Parameters
phase in the phase in question
try_file in whether to try to read from file
Returns the LB to run

objgroup::proxy::Proxy<LBManager> vt::vrt::collection::balance::LBManager::getProxy() const

Get the proxy for the LBManager.

Returns proxy to the LBManager

void vt::vrt::collection::balance::LBManager::setProxy(objgroup::proxy::Proxy<LBManager> proxy)

Setup the proxy for the LBManager.

Parameters
proxy in the proxy to set

void vt::vrt::collection::balance::LBManager::selectStartLB(PhaseType phase, vt::Callback<ReassignmentMsg> cb)

Collectively start load balancing after deciding which to run.

Parameters
phase in the phase
cb in the callback for delivering the reassignment

void vt::vrt::collection::balance::LBManager::selectStartLB(PhaseType phase)

Collectively start load balancing after deciding which to run.

Parameters
phase in the phase

void vt::vrt::collection::balance::LBManager::startLB(PhaseType phase, LBType lb, vt::Callback<ReassignmentMsg> cb)

Collectively start load balancing.

Parameters
phase in the phase
lb in the load balancer to run
cb in the callback for delivering the reassignment

void vt::vrt::collection::balance::LBManager::setLoadModel(std::shared_ptr<LoadModel> model)

Set a model of expected object loads to use in place of the current installed model.

Parameters
model in the model to apply

This should be called with a similarly-constructed model instance on every node

template<typename LB>
LBProxyType vt::vrt::collection::balance::LBManager::makeLB(std::string const& lb_name = {})

Collectively construct a new load balancer.

Parameters
lb_name in optional name of the load balancer
Returns objgroup proxy to the new load balancer

void vt::vrt::collection::balance::LBManager::computeStatistics(std::shared_ptr<LoadModel> model, bool comm_collectives, PhaseType phase, vt::Callback<std::vector<balance::LoadData>> cb)

Compute statistics given a load model.

Parameters
model in the load model
comm_collectives in whether to consider collective communication
phase in the phase
cb in the callback to receive the statistics

void vt::vrt::collection::balance::LBManager::finishedLB(PhaseType phase) protected

Call when LB is finished to complete post-LB actions.

Parameters
phase in the phase

void vt::vrt::collection::balance::LBManager::runLB(PhaseType phase, vt::Callback<ReassignmentMsg> cb) protected

Run the currently chosen load balancer.

Parameters
phase in the phase
cb in the callback for delivering the reassignment