Skip to content

Commit

Permalink
#1659: lb: use correct value for Object_work_modeled statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Oct 12, 2022
1 parent 19f4d8c commit 017581d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
26 changes: 19 additions & 7 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,25 @@ void LBManager::computeStatistics(

// FIXME: this is only TemperedWMin specific and requires composed
// WeightedCommunicationVolume model (TemperedWMin::total_work_model_)
auto work = model->getModeledLoad(
elm, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
obj_work_model.emplace_back(
LoadData{lb::Statistic::Object_work_modeled, work}
);
total_work_from_model += work;
auto proxy_iter = lb_instances_.find("chosen");
if (proxy_iter == lb_instances_.end()) {
vt_debug_print(verbose, lb,"No load balancer instance chosen\n");
continue;
}

auto strat = proxy_iter->second.get();
if (strat) {
auto tempered = reinterpret_cast<lb::TemperedWMin*>(strat);
if (not tempered) {
continue;
}

auto work = tempered->getModeledValue(elm);
obj_work_model.emplace_back(
LoadData{lb::Statistic::Object_work_modeled, work}
);
total_work_from_model += work;
}
}

TimeType total_load_raw = 0.;
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#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"
#include <memory>

namespace vt { namespace vrt { namespace collection { namespace lb {

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

void inputParams(balance::SpecEntry* spec) override;

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

private:
Expand Down

0 comments on commit 017581d

Please sign in to comment.