Skip to content

Commit

Permalink
#2150: LB: Remove BaseLB::loadMilli and use TimeType::milliseconds in…
Browse files Browse the repository at this point in the history
…stead
  • Loading branch information
JacobDomagala committed May 30, 2023
1 parent 8972a7b commit fd7266b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
6 changes: 0 additions & 6 deletions src/vt/vrt/collection/balance/baselb/baselb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ std::shared_ptr<const balance::Reassignment> BaseLB::startLB(
return normalizeReassignments();
}

/*static*/
BaseLB::LoadType BaseLB::loadMilli(LoadType const& load) {
// Convert `load` in seconds to milliseconds, typically for binning purposes
return load * 1000;
}

void BaseLB::importProcessorData(
StatisticMapType const& in_stats, ElementCommType const& comm_in
) {
Expand Down
2 changes: 0 additions & 2 deletions src/vt/vrt/collection/balance/baselb/baselb.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ struct BaseLB {
StatisticMapType const& in_stats, ElementCommType const& cm
);

static LoadType loadMilli(LoadType const& load);

void notifyCurrentHostNodeOfObjectsDeparting(
TransferMsg<ObjDestinationListType>* msg
);
Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/baselb/load_sampler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void LoadSamplerBaseLB::buildHistogram() {
TimeType load = load_model_->getModeledLoad(
obj, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
auto const& load_milli = loadMilli(load.seconds());
auto const& load_milli = load.milliseconds();
auto const& bin = histogramSample(load_milli);
if (obj.isMigratable()) {
obj_sample[bin].push_back(obj);
Expand Down
6 changes: 3 additions & 3 deletions src/vt/vrt/collection/balance/greedylb/greedylb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void GreedyLB::inputParams(balance::ConfigEntry* config) {
}

void GreedyLB::runLB(TimeType total_load) {
this_load = loadMilli(total_load.seconds());
this_load = total_load.milliseconds();
buildHistogram();
loadStats();
}
Expand Down Expand Up @@ -413,9 +413,9 @@ void GreedyLB::loadOverBin(ObjBinType bin, ObjBinListType& bin_list) {
load_over[bin].push_back(obj_id);
bin_list.pop_back();

auto const& obj_time_milli = loadMilli(load_model_->getModeledLoad(
auto const& obj_time_milli = load_model_->getModeledLoad(
obj_id, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
).seconds());
).milliseconds();

this_load -= obj_time_milli;

Expand Down
4 changes: 2 additions & 2 deletions src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ void HierarchicalLB::loadOverBin(ObjBinType bin, ObjBinListType& bin_list) {
load_over[bin].push_back(obj_id);
bin_list.pop_back();

auto const& obj_time_milli = loadMilli(load_model_->getModeledLoad(obj_id,
auto const& obj_time_milli = load_model_->getModeledLoad(obj_id,
{balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
).seconds());
).milliseconds();

this_load -= obj_time_milli;

Expand Down
4 changes: 2 additions & 2 deletions src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ZoltanLB::inputParams(balance::ConfigEntry* config) {

void ZoltanLB::runLB(TimeType total_load) {
auto const& this_node = theContext()->getNode();
this_load = loadMilli(total_load);
this_load = total_load.milliseconds());

if (this_node == 0) {
vt_debug_print(terse, lb, "ZoltanLB: runLB: edges={}\n", do_edges_);
Expand Down Expand Up @@ -487,7 +487,7 @@ std::unique_ptr<ZoltanLB::Graph> ZoltanLB::makeGraph() {
obj,
{balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE}
);
auto time = static_cast<int>(loadMilli(load));
auto time = static_cast<int>(load.milliseconds());
graph->vertex_weight[idx++] = time;
}
}
Expand Down

0 comments on commit fd7266b

Please sign in to comment.