vt::vrt::collection::lb::BaseLB struct

Derived classes

struct vt::vrt::collection::balance::replay::WorkloadDataMigrator
A helper objgroup for workload replay. Derives from vt::Vrt::collection::lb::BaseLB in order to gain access to normalizeReassignments but is not a load balancer in the traditional sense. A new instance should be created for each call to normalizeReassignments.
struct LoadSamplerBaseLB
struct OfflineLB
struct RandomLB
struct RotateLB
struct TemperedLB
struct TestSerializationLB

Public types

using ObjIDType = balance::ElementIDStruct
using ElementLoadType = std::unordered_map<ObjIDType, LoadType>
using ElementCommType = elm::CommMapType
using TransferDestType = std::tuple<ObjIDType, NodeType>
using TransferVecType = std::vector<TransferDestType>
using TransferType = std::map<NodeType, TransferVecType>
using MigrationCountCB = std::function<void(int32_t)>
using QuantityType = std::map<lb::StatisticQuantity, double>
using StatisticMapType = std::unordered_map<lb::Statistic, QuantityType>
using LoadSummary = balance::LoadSummary
using ObjLoadListType = std::vector<std::tuple<ObjIDType, LoadSummary, LoadSummary, balance::ElmUserDataType>>
using ObjDestinationListType = std::vector<std::tuple<ObjIDType, NodeType>>

Constructors, destructors, conversion operators

BaseLB(bool in_comm_aware = false) explicit
BaseLB(BaseLB const&) deleted
BaseLB(BaseLB&&) defaulted noexcept
~BaseLB() defaulted virtual

Public functions

auto operator=(BaseLB const&) -> BaseLB& deleted
auto operator=(BaseLB&&) -> BaseLB& defaulted noexcept
auto startLB(PhaseType phase, objgroup::proxy::Proxy<BaseLB> proxy, balance::LoadModel* model, StatisticMapType const& in_stats, ElementCommType const& in_comm_lb_data, LoadType total_load, balance::DataMapType const& in_data_map) -> std::shared_ptr<const balance::Reassignment>
This sets up and invokes the particular strategy implementations through virtual methods initParams and runLB, and then normalizes their output to a reassignment that can be evaluated and applied.
void importProcessorData(StatisticMapType const& in_stats, ElementCommType const& cm, balance::DataMapType const& in_data_map)
Import processor data to the base LB.
void notifyCurrentHostNodeOfObjectsDeparting(TransferMsg<ObjDestinationListType>* msg)
void notifyNewHostNodeOfObjectsArriving(TransferMsg<ObjLoadListType>* msg)
auto loadMilli(LoadType const& load) -> LoadType
void applyMigrations(TransferVecType const& transfers, MigrationCountCB migration_count_callback)
void migrationDone()
void migrateObjectTo(ObjIDType const obj_id, NodeType const node)
void transferSend(NodeType from, TransferVecType const& transfer)
void transferMigrations(TransferMsg<TransferVecType>* msg)
void finalize(int32_t global_count)
void inputParams(balance::ConfigEntry* config) pure virtual
void runLB(LoadType total_load) pure virtual
auto getStats() const -> StatisticMapType const *
auto getTransfers() -> TransferVecType&
auto isCommAware() const -> bool
void recvSharedEdges(CommMsg* msg)

Protected static functions

static void setStrategySpecificModel(std::shared_ptr<balance::LoadModel> model)

Protected functions

void getArgs(PhaseType phase)
auto normalizeReassignments() -> std::shared_ptr<const balance::Reassignment>
Normalizes the reassignment graph by setting up in/out edges on both sides regardless of how they are passed to migrateObjectTo.
auto getCollectiveEpochCost() const -> auto
Get the estimated time needed for load-balancing.
auto maxLoadExceedsLBCost() const -> bool
Check if load-balancing should be done.

Protected variables

TimeType start_time_
ElementCommType const * comm_data
objgroup::proxy::Proxy<BaseLB> proxy_
PhaseType phase_
std::unique_ptr<balance::ConfigEntry> config_entry_
balance::LoadModel* load_model_
bool comm_aware_

Function documentation

std::shared_ptr<const balance::Reassignment> vt::vrt::collection::lb::BaseLB::startLB(PhaseType phase, objgroup::proxy::Proxy<BaseLB> proxy, balance::LoadModel* model, StatisticMapType const& in_stats, ElementCommType const& in_comm_lb_data, LoadType total_load, balance::DataMapType const& in_data_map)

This sets up and invokes the particular strategy implementations through virtual methods initParams and runLB, and then normalizes their output to a reassignment that can be evaluated and applied.

Parameters
phase in the phase we are load balancing
proxy in the base proxy
model in the load model
in_stats in LB statistics
in_comm_lb_data in comm map data
total_load in total modeled load for this rank
in_data_map in the user-defined data map
Returns A normalized reassignment

This must be called collectively.

void vt::vrt::collection::lb::BaseLB::importProcessorData(StatisticMapType const& in_stats, ElementCommType const& cm, balance::DataMapType const& in_data_map)

Import processor data to the base LB.

Parameters
in_stats in statistics
cm in the comm map
in_data_map in user-defined data

std::shared_ptr<const balance::Reassignment> vt::vrt::collection::lb::BaseLB::normalizeReassignments() protected

Normalizes the reassignment graph by setting up in/out edges on both sides regardless of how they are passed to migrateObjectTo.

Returns A normalized reassignment

auto vt::vrt::collection::lb::BaseLB::getCollectiveEpochCost() const protected

Get the estimated time needed for load-balancing.

Returns the estimated time

bool vt::vrt::collection::lb::BaseLB::maxLoadExceedsLBCost() const protected

Check if load-balancing should be done.

Returns true when the maximum load exceeds the cost of load balancing; false otherwise