vt::vrt::collection::balance::ComposedModel class

Utility class to support implementation of composable load modeling components.

All model implementations meant to compose with arbitrary other models should inherit from this class. It implements all methods by calling the same method on the underlying model passed at construction.

Base classes

struct LoadModel
Interface for transforming measurements of past object loads into predictions of future object load for load balancing strategies.

Derived classes

struct CommOverhead
Add some implied, unaccounted work time for communication activity.
struct LinearModel
Predict an object's load with a linear regression model.
struct MultiplePhases
Predict an object's load as a sum over blocks of N future phases.
struct NaivePersistence
Predicts future object loads as exactly matching their load in the last phase.
class Norm
A load model that computes an l-norm of a given power across subphases.
struct PerCollection
Selects an underlying model to call corresponding to the collection containing the queried object.
struct PersistenceMedianLastN
Predicts loads as the median of the last N phases.
struct ProposedReassignment
class SelectSubphases
A load model to direct consideration to load data relating to a specific set of subphases, rather than the entire set.
class WeightedCommunicationVolume
Models work as an affine combination of load and communication.
struct WeightedMessages

Constructors, destructors, conversion operators

ComposedModel(std::shared_ptr<LoadModel> base) explicit

Public functions

void setLoads(std::unordered_map<PhaseType, LoadMapType> const* proc_load, std::unordered_map<PhaseType, CommMapType> const* proc_comm, std::unordered_map<PhaseType, DataMapType> const* user_data) override
Initialize the model instance with pointers to the measured load data.
void updateLoads(PhaseType last_completed_phase) override
Signals that load data for a new phase is available.
auto getModeledLoad(ElementIDStruct object, PhaseOffset when) const -> LoadType override
Provide an estimate of the given object's load during a specified interval.
auto getModeledComm(ElementIDStruct object, PhaseOffset when) const -> LoadType override
auto hasRawLoad() const -> bool override
Whether or not the model is based on the RawData model.
auto getRawLoad(ElementIDStruct object, PhaseOffset when) const -> LoadType override
auto hasUserData() const -> bool override
Whether or not the model is based on the RawData model.
auto getUserData(ElementIDStruct object, PhaseOffset when) const -> ElmUserDataType override
auto getNumPastPhasesNeeded(unsigned int look_back) const -> unsigned int override
Compute how many phases of past load statistics need to be kept available for the model to use.
auto getComm(PhaseOffset offset) const -> CommMapType override
auto begin() const -> ObjectIterator override
auto getNumObjects() const -> int override
auto getNumCompletedPhases() const -> unsigned int override
auto getNumSubphases() const -> int override

Function documentation

void vt::vrt::collection::balance::ComposedModel::setLoads(std::unordered_map<PhaseType, LoadMapType> const* proc_load, std::unordered_map<PhaseType, CommMapType> const* proc_comm, std::unordered_map<PhaseType, DataMapType> const* user_data) override

Initialize the model instance with pointers to the measured load data.

This would typically be called by LBManager when the user has passed a new model instance for a collection

void vt::vrt::collection::balance::ComposedModel::updateLoads(PhaseType last_completed_phase) override

Signals that load data for a new phase is available.

For models that want to do pre-computation based on measured loads before being asked to provide predictions from them

This would typically be called by LBManager collectively inside an epoch that can be used for global communication in advance of any calls to getModeledLoad()

The setLoads method must have been called before any call to this.

LoadType vt::vrt::collection::balance::ComposedModel::getModeledLoad(ElementIDStruct object, PhaseOffset when) const override

Provide an estimate of the given object's load during a specified interval.

Parameters
object in The object whose load is desired
when in The interval in which the estimated load is desired
Returns How much computation time the object is estimated to require

The updateLoads method must have been called before any call to this.

unsigned int vt::vrt::collection::balance::ComposedModel::getNumPastPhasesNeeded(unsigned int look_back) const override

Compute how many phases of past load statistics need to be kept available for the model to use.

Parameters
look_back in How many phases into the past the caller intends to query
Returns How many phases of past load statistics will be needed to satisfy the requested history

ObjectIterator vt::vrt::collection::balance::ComposedModel::begin() const override

Object enumeration, to abstract away access to the underlying structures from NodeLBData

The updateLoads method must have been called before any call to this.

int vt::vrt::collection::balance::ComposedModel::getNumObjects() const override

Object enumeration, to abstract away access to the underlying structures from NodeLBData

The updateLoads method must have been called before any call to this.

unsigned int vt::vrt::collection::balance::ComposedModel::getNumCompletedPhases() const override

Returns the number of phases of history available

The updateLoads method must have been called before any call to this.

int vt::vrt::collection::balance::ComposedModel::getNumSubphases() const override

Returns the number of subphases recorded in the most recent completed phase

The updateLoads method must have been called before any call to this.