Skip to content

Commit

Permalink
#1838: lb: remove getModeledWork interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Aug 17, 2022
1 parent 73d0b43 commit c72e02a
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ void LBManager::computeStatistics(
);
total_load_from_model += load;

auto work = model->getModeledWork(
// FIXME: this is only TemperedWMin specific and requires composed
// WeightedCommunicationVolume model
auto work = model->getModeledLoad(
elm, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
obj_work_model.emplace_back(
Expand Down
5 changes: 0 additions & 5 deletions src/vt/vrt/collection/balance/model/composed_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ ComposedModel::getModeledComm(ElementIDStruct object, PhaseOffset when) {
return base_->getModeledComm(object, when);
}

TimeType
ComposedModel::getModeledWork(ElementIDStruct object, PhaseOffset when) {
return base_->getModeledWork(object, when);
}

bool ComposedModel::hasRawLoad() const {
return base_->hasRawLoad();
}
Expand Down
1 change: 0 additions & 1 deletion src/vt/vrt/collection/balance/model/composed_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class ComposedModel : public LoadModel

TimeType getModeledLoad(ElementIDStruct object, PhaseOffset when) override;
TimeType getModeledComm(ElementIDStruct object, PhaseOffset when) override;
TimeType getModeledWork(ElementIDStruct object, PhaseOffset when) override;
bool hasRawLoad() const override;
TimeType getRawLoad(ElementIDStruct object, PhaseOffset when) override;
unsigned int getNumPastPhasesNeeded(unsigned int look_back) override;
Expand Down
16 changes: 0 additions & 16 deletions src/vt/vrt/collection/balance/model/load_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,6 @@ 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 @@ -46,7 +46,7 @@

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

TimeType WeightedCommunicationVolume::getModeledWork(
TimeType WeightedCommunicationVolume::getModeledLoad(
ElementIDStruct object, PhaseOffset when
) {
return alpha_ * ComposedModel::getModeledLoad(object, when) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class WeightedCommunicationVolume : public ComposedModel {
beta_(beta),
gamma_(gamma) { }

TimeType getModeledWork(ElementIDStruct object, PhaseOffset when) override;
TimeType getModeledLoad(ElementIDStruct object, PhaseOffset when) override;

private:
double alpha_;
Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TimeType TemperedWMin::getModeledValue(const elm::ElementIDStruct& obj) {
balance::PhaseOffset when =
{balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE};

return total_work_model_->getModeledWork(obj, when);
return total_work_model_->getModeledLoad(obj, when);
}

}}}} // namespace vt::vrt::collection::lb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ TEST_F(TestModelWeightedCommunicationVolume, test_model) {
++objects_seen;

const auto subphase = num_phases == 0 ? PhaseOffset::WHOLE_PHASE : 1;
auto work_val = test_model->getModeledWork(obj, PhaseOffset{0, subphase});
auto work_val = test_model->getModeledLoad(obj, PhaseOffset{0, subphase});
EXPECT_EQ(work_val, expected_work[num_phases])
<< fmt::format("For element={} on phase={}\n", obj, num_phases);
}
Expand Down

0 comments on commit c72e02a

Please sign in to comment.