Skip to content

Commit

Permalink
#1838: lb: remove total work concept from load balancers
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Aug 4, 2022
1 parent 39ebc3a commit 5d4e6ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 71 deletions.
12 changes: 5 additions & 7 deletions src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,11 @@ void TemperedLB::doLBStages(TimeType start_imb) {
cur_objs_.clear();
for (auto obj : *load_model_) {
if (obj.isMigratable()) {
cur_objs_[obj] = getModeledWork(obj);
cur_objs_[obj] = load_model_->getModeledWork(
obj,
{balance::PhaseOffset::NEXT_PHASE,
balance::PhaseOffset::WHOLE_PHASE}
);
}
}
this_new_load_ = this_load;
Expand Down Expand Up @@ -1361,10 +1365,4 @@ void TemperedLB::migrate() {
vtAssertExpr(false);
}

TimeType TemperedLB::getModeledWork(const elm::ElementIDStruct& obj) {
return load_model_->getModeledLoad(
obj, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
}

}}}} /* end namespace vt::vrt::collection::lb */
1 change: 0 additions & 1 deletion src/vt/vrt/collection/balance/temperedlb/temperedlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ struct TemperedLB : BaseLB {
ElementLoadType::iterator selectObject(
LoadType size, ElementLoadType& load, std::set<ObjIDType> const& available
);
virtual TimeType getModeledWork(const elm::ElementIDStruct& obj);

void lazyMigrateObjsTo(EpochType epoch, NodeType node, ObjsType const& objs);
void inLazyMigrations(balance::LazyMigrationMsg* msg);
Expand Down
52 changes: 0 additions & 52 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@

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

#include "vt/vrt/collection/balance/lb_common.h"
#include "vt/vrt/collection/balance/model/load_model.h"

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

void TemperedWMin::init(objgroup::proxy::Proxy<TemperedWMin> in_proxy) {
Expand All @@ -55,53 +52,4 @@ void TemperedWMin::init(objgroup::proxy::Proxy<TemperedWMin> in_proxy) {
strat->init(proxy);
}

/*static*/ std::unordered_map<std::string, std::string>
TemperedWMin::getInputKeysWithHelp() {
auto map = TemperedLB::getInputKeysWithHelp();
map["alpha"] =
R"(
Values: <double>
Default: 1.0
Description:
Load part coefficient in affine combination of load and communication.
)";
map["beta"] =
R"(
Values: <double>
Default: 0.0
Description:
Communication part coefficient in affine combination of load and communication.
)";
map["gamma"] =
R"(
Values: <double>
Default: 0.0
Description:
Unspecified constant cost.
)";
return map;
}

void TemperedWMin::inputParams(balance::SpecEntry* spec) {
TemperedLB::inputParams(spec);

alpha_ = spec->getOrDefault<double>("alpha", alpha_);
beta_ = spec->getOrDefault<double>("beta", beta_);
gamma_ = spec->getOrDefault<double>("gamma", gamma_);

vt_debug_print(
normal, temperedwmin,
"TemperedWMin::inputParams: alpha={}, beta={}, gamma={}\n",
alpha_, beta_, gamma_
);
}

TimeType TemperedWMin::getModeledWork(const elm::ElementIDStruct& obj) {
balance::PhaseOffset when =
{balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE};

return alpha_ * load_model_->getModeledLoad(obj, when) +
beta_ * load_model_->getModeledComm(obj, when) + gamma_;
}

}}}} // namespace vt::vrt::collection::lb
11 changes: 0 additions & 11 deletions src/vt/vrt/collection/balance/temperedwmin/temperedwmin.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@ struct TemperedWMin : TemperedLB {

public:
void init(objgroup::proxy::Proxy<TemperedWMin> in_proxy);
static std::unordered_map<std::string, std::string> getInputKeysWithHelp();

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

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

private:
double alpha_ = 1.0;
double beta_ = 0.0;
double gamma_ = 0.0;
};

}}}} /* end namespace vt::vrt::collection::lb */
Expand Down

0 comments on commit 5d4e6ce

Please sign in to comment.