Skip to content

Commit

Permalink
#1838: TemperedWMin: make sure that load model does not change
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Aug 9, 2022
1 parent 67a1d2d commit 3441b9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#include "vt/vrt/collection/balance/temperedwmin/temperedwmin.h"

#include "vt/configs/error/config_assert.h"
#include "vt/vrt/collection/balance/lb_invoke/lb_manager.h"
#include "vt/vrt/collection/balance/model/load_model.h"
#include "vt/vrt/collection/balance/model/weighted_communication_volume.h"
Expand Down Expand Up @@ -99,9 +100,14 @@ void TemperedWMin::inputParams(balance::SpecEntry* spec) {
total_work_model_ = std::make_unique<balance::WeightedCommunicationVolume>(
theLBManager()->getLoadModel(), alpha_, beta_, gamma_
);
load_model_ptr = theLBManager()->getLoadModel().get();
}

TimeType TemperedWMin::getModeledValue(const elm::ElementIDStruct& obj) {
vtAssert(
theLBManager()->getLoadModel().get() == load_model_ptr,
"Load model must not change"
);
balance::PhaseOffset when =
{balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE};

Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct TemperedWMin : TemperedLB {

private:
std::unique_ptr<balance::LoadModel> total_work_model_ = nullptr;
balance::LoadModel* load_model_ptr = nullptr;

double alpha_ = 1.0;
double beta_ = 0.0;
Expand Down

0 comments on commit 3441b9e

Please sign in to comment.