From f1c89d3f96efb67c9d410e88549b1b321ea3c761 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Tue, 6 Jun 2023 19:30:17 +0200 Subject: [PATCH] #2150: LB: Remove old toMilli function and use TimeType's milliseconds() instead --- src/vt/vrt/collection/balance/baselb/baselb.h | 2 -- src/vt/vrt/collection/balance/baselb/load_sampler.cc | 2 +- src/vt/vrt/collection/balance/greedylb/greedylb.cc | 4 ++-- src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc | 4 ++-- src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/vt/vrt/collection/balance/baselb/baselb.h b/src/vt/vrt/collection/balance/baselb/baselb.h index fe271e204c..37045caab1 100644 --- a/src/vt/vrt/collection/balance/baselb/baselb.h +++ b/src/vt/vrt/collection/balance/baselb/baselb.h @@ -134,8 +134,6 @@ struct BaseLB { balance::DataMapType const& in_data_map ); - static LoadType loadMilli(LoadType const& load); - void notifyCurrentHostNodeOfObjectsDeparting( TransferMsg* msg ); diff --git a/src/vt/vrt/collection/balance/baselb/load_sampler.cc b/src/vt/vrt/collection/balance/baselb/load_sampler.cc index cda4df4060..10b3b989f1 100644 --- a/src/vt/vrt/collection/balance/baselb/load_sampler.cc +++ b/src/vt/vrt/collection/balance/baselb/load_sampler.cc @@ -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); diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb.cc b/src/vt/vrt/collection/balance/greedylb/greedylb.cc index ee0e2cdda3..5069e71e04 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb.cc +++ b/src/vt/vrt/collection/balance/greedylb/greedylb.cc @@ -412,9 +412,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; diff --git a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc index a647d5169c..458b2e87a1 100644 --- a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc +++ b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc @@ -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; diff --git a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc index 978f466825..cc7416e9ab 100644 --- a/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc +++ b/src/vt/vrt/collection/balance/zoltanlb/zoltanlb.cc @@ -131,7 +131,7 @@ void ZoltanLB::inputParams(balance::ConfigEntry* config) { void ZoltanLB::runLB(LoadType 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_); @@ -485,7 +485,7 @@ std::unique_ptr ZoltanLB::makeGraph() { obj, {balance::PhaseOffset::NEXT_PHASE, balance::PhaseOffset::WHOLE_PHASE} ); - auto time = static_cast(loadMilli(load)); + auto time = load.milliseconds(); graph->vertex_weight[idx++] = time; } }