vt::vrt::collection::balance::LoadModel struct

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

Derived classes

class ComposedModel
Utility class to support implementation of composable load modeling components.
struct RawData
A strictly retrospective view of the recorded object timings.

Constructors, destructors, conversion operators

LoadModel() defaulted
~LoadModel() defaulted virtual

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) pure virtual
Initialize the model instance with pointers to the measured load data.
void updateLoads(PhaseType last_completed_phase) pure virtual
Signals that load data for a new phase is available.
auto getComm(] PhaseOffset when) const -> CommMapType virtual
Provide all the comm info for a given phase.
auto getModeledLoad(ElementIDStruct object, PhaseOffset when) const -> LoadType pure virtual
Provide an estimate of the given object's load during a specified interval.
auto hasRawLoad() const -> bool virtual
Whether or not the model is based on the RawData model.
auto getRawLoad(] ElementIDStruct object, ] PhaseOffset when) const -> LoadType virtual
Provide the given object's raw load during a specified interval.
auto hasUserData() const -> bool virtual
Whether or not the model is based on the RawData model.
auto getUserData(] ElementIDStruct object, ] PhaseOffset when) const -> ElmUserDataType virtual
Provide the given object's user data during a specified interval.
auto getModeledComm(] ElementIDStruct object, ] PhaseOffset when) const -> LoadType virtual
Provide an estimate of the communication cost for a given object during a specified interval.
auto getNumPastPhasesNeeded(unsigned int look_back = 0) const -> unsigned int pure virtual
Compute how many phases of past load statistics need to be kept available for the model to use.
auto begin() const -> ObjectIterator pure virtual
auto end() const -> ObjectIterator
auto getNumObjects() const -> int virtual
auto getNumCompletedPhases() const -> unsigned int pure virtual
auto getNumSubphases() const -> int pure virtual
template<typename Serializer>
void serialize(] Serializer& s)

Function documentation

void vt::vrt::collection::balance::LoadModel::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) pure virtual

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::LoadModel::updateLoads(PhaseType last_completed_phase) pure virtual

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.

CommMapType vt::vrt::collection::balance::LoadModel::getComm(] PhaseOffset when) const virtual

Provide all the comm info for a given phase.

Parameters
when in the interval in which comm is desired
Returns the comm info

LoadType vt::vrt::collection::balance::LoadModel::getModeledLoad(ElementIDStruct object, PhaseOffset when) const pure virtual

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.

LoadType vt::vrt::collection::balance::LoadModel::getRawLoad(] ElementIDStruct object, ] PhaseOffset when) const virtual

Provide the given object's raw load during a specified interval.

Parameters
object in The object whose raw load is desired
when in The interval in which the raw load is desired
Returns How much computation time the object required

ElmUserDataType vt::vrt::collection::balance::LoadModel::getUserData(] ElementIDStruct object, ] PhaseOffset when) const virtual

Provide the given object's user data during a specified interval.

Parameters
object in The object whose user data is desired
when in The interval in which the user data is desired
Returns The user data associated with the object

LoadType vt::vrt::collection::balance::LoadModel::getModeledComm(] ElementIDStruct object, ] PhaseOffset when) const virtual

Provide an estimate of the communication cost for a given object during a specified interval.

Parameters
object in The object whose communication is desired
when in The interval in which the communication takes place
Returns How much communication 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::LoadModel::getNumPastPhasesNeeded(unsigned int look_back = 0) const pure virtual

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::LoadModel::begin() const pure virtual

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

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

ObjectIterator vt::vrt::collection::balance::LoadModel::end() const

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::LoadModel::getNumObjects() const virtual

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::LoadModel::getNumCompletedPhases() const pure virtual

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::LoadModel::getNumSubphases() const pure virtual

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

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