Skip to content

Commit

Permalink
#1830: lb: make getModeledValue const
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Oct 13, 2022
1 parent 8decfca commit 7573b94
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ void TemperedLB::migrate() {
vtAssertExpr(false);
}

TimeType TemperedLB::getModeledValue(const elm::ElementIDStruct& obj) {
TimeType TemperedLB::getModeledValue(const elm::ElementIDStruct& obj) const {
return load_model_->getModeledLoad(
obj, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/temperedlb/temperedlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct TemperedLB : BaseLB {
ElementLoadType::iterator selectObject(
LoadType size, ElementLoadType& load, std::set<ObjIDType> const& available
);
virtual TimeType getModeledValue(const elm::ElementIDStruct& obj);
virtual TimeType getModeledValue(const elm::ElementIDStruct& obj) const;

void lazyMigrateObjsTo(EpochType epoch, NodeType node, ObjsType const& objs);
void inLazyMigrations(balance::LazyMigrationMsg* msg);
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 @@ -123,7 +123,7 @@ std::vector<NodeType> TemperedWMin::getPotentialRecipients() const {
return nodes;
}

TimeType TemperedWMin::getModeledValue(const elm::ElementIDStruct& obj) {
TimeType TemperedWMin::getModeledValue(const elm::ElementIDStruct& obj) const {
vtAssert(
theLBManager()->getLoadModel().get() == load_model_ptr,
"Load model must not change"
Expand Down
3 changes: 1 addition & 2 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ struct TemperedWMin : TemperedLB {
void inputParams(balance::ConfigEntry* config) override;

protected:
TimeType getModeledValue(const elm::ElementIDStruct& obj) override;

/**
* Allow migration when there are objects to migrate and other ranks are known
*/
Expand All @@ -79,6 +77,7 @@ struct TemperedWMin : TemperedLB {
*/
bool isUnderloaded(LoadType load) const override { return true; }

TimeType getModeledValue(const elm::ElementIDStruct& obj) const override;
std::vector<NodeType> getPotentialRecipients() const override;

private:
Expand Down

0 comments on commit 7573b94

Please sign in to comment.