Skip to content

Commit

Permalink
#1838: lb: add getModeledWork method to load models
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Aug 4, 2022
1 parent a75ff51 commit 39ebc3a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/vt/vrt/collection/balance/model/load_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ struct LoadModel
return {};
}

/**
* \brief Provide an estimate of the given object's work during a specified
* interval
*
* \param[in] object The object whose work is requested
* \param[in] when The interval in which the estimated work is requested
*
* \return How much work the object is estimated to require
*
* The `updateLoads` method must have been called before any call to
* this.
*/
virtual TimeType getModeledWork(ElementIDStruct object, PhaseOffset when) {
return {};
}

/**
* \brief Compute how many phases of past load statistics need to be
* kept availble for the model to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@
*/

#include "vt/vrt/collection/balance/model/weighted_communication_volume.h"
#include "vt/vrt/collection/balance/model/composed_model.h"

namespace vt { namespace vrt { namespace collection { namespace balance {

TimeType WeightedCommunicationVolume::getModeledWork(
ElementIDStruct object, PhaseOffset when
) {
return alpha_ * ComposedModel::getModeledLoad(object, when) +
beta_ * ComposedModel::getModeledComm(object, when) + gamma_;
}

}}}} // namespace vt::vrt::collection::balance
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class WeightedCommunicationVolume : public ComposedModel {
beta_(beta),
gamma_(gamma) { }

TimeType getModeledWork(ElementIDStruct object, PhaseOffset when) override;

private:
double alpha_;
double beta_;
Expand Down

0 comments on commit 39ebc3a

Please sign in to comment.