diff --git a/src/vt/vrt/collection/balance/baselb/baselb.h b/src/vt/vrt/collection/balance/baselb/baselb.h index d02e261eee..a29b3b5708 100644 --- a/src/vt/vrt/collection/balance/baselb/baselb.h +++ b/src/vt/vrt/collection/balance/baselb/baselb.h @@ -55,6 +55,7 @@ #include #include #include +#include namespace vt { namespace vrt { namespace collection { @@ -193,9 +194,8 @@ struct BaseLB { * * \return the estimated time */ - double getCollectiveEpochCost() const { - // 100 ns - return 0.0000001; + auto getCollectiveEpochCost() const { + return std::chrono::nanoseconds(100); } private: diff --git a/src/vt/vrt/collection/balance/greedylb/greedylb.cc b/src/vt/vrt/collection/balance/greedylb/greedylb.cc index e9ec43b4af..22b92bad38 100644 --- a/src/vt/vrt/collection/balance/greedylb/greedylb.cc +++ b/src/vt/vrt/collection/balance/greedylb/greedylb.cc @@ -161,7 +161,10 @@ void GreedyLB::loadStats() { this_load_begin = this_load; // Use an estimated load-balancing cost on average rank load to load-balance - if (avg_load > getCollectiveEpochCost()) { + auto avg_ns = std::chrono::duration_cast( + std::chrono::duration(avg_load) + ); + if (avg_ns > getCollectiveEpochCost()) { should_lb = I > greedy_tolerance; } diff --git a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc index 215694fa5b..8c37ec57a8 100644 --- a/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc +++ b/src/vt/vrt/collection/balance/hierarchicallb/hierlb.cc @@ -264,7 +264,10 @@ void HierarchicalLB::loadStats() { this_load_begin = this_load; // Use an estimated load-balancing cost on average rank load to load-balance - if (avg_load > getCollectiveEpochCost()) { + auto avg_ns = std::chrono::duration_cast( + std::chrono::duration(avg_load) + ); + if (avg_ns > getCollectiveEpochCost()) { should_lb = I > hierlb_tolerance; } diff --git a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc index f802187391..2007684c67 100644 --- a/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc +++ b/src/vt/vrt/collection/balance/temperedlb/temperedlb.cc @@ -450,7 +450,10 @@ void TemperedLB::runLB(LoadType total_load) { } // Use an estimated load-balancing cost on average rank load to load-balance - if (avg > getCollectiveEpochCost()) { + auto avg_ns = std::chrono::duration_cast( + std::chrono::duration(avg) + ); + if (avg_ns > getCollectiveEpochCost()) { should_lb = max > (run_temperedlb_tolerance + 1.0) * target_max_load_; }