From e2777a3b9b510f8e46e61623606e1b12a057b956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 6 Oct 2022 12:32:17 +0200 Subject: [PATCH] #1830: lb: make `getModeledValue` const --- src/vt/vrt/collection/balance/temperedlb/temperedlb.cc | 2 +- src/vt/vrt/collection/balance/temperedlb/temperedlb.h | 2 +- src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc | 2 +- src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc index 158dc6210d..1b03ec8028 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc @@ -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} ); diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.h b/src/vt/vrt/collection/balance/temperedlb/temperedlb.h index 117f30da7a..345b907b6f 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.h +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.h @@ -124,7 +124,7 @@ struct TemperedLB : BaseLB { ElementLoadType::iterator selectObject( LoadType size, ElementLoadType& load, std::set 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); diff --git a/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc b/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc index 128d77a6f6..bd1f9166b7 100644 --- a/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc +++ b/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc @@ -123,7 +123,7 @@ std::vector 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" diff --git a/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h b/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h index 467caf5246..47525cbeaa 100644 --- a/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h +++ b/src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h @@ -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 */ @@ -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 getPotentialRecipients() const override; private: