From 046d59786531049269395d9be51d258ebeff8a07 Mon Sep 17 00:00:00 2001 From: Nicole Lemaster Slattengren Date: Tue, 9 Apr 2024 11:45:16 -0700 Subject: [PATCH] #2266: lbmanager: print lb time only on rank 0 --- .../balance/lb_invoke/lb_manager.cc | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc index bb43c69666..2de4a94fae 100644 --- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc +++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc @@ -206,12 +206,14 @@ void LBManager::defaultPostLBWork(ReassignmentMsg* msg) { auto const start_time = timing::getCurrentTime(); applyReassignment(reassignment); - auto const mig_time = timing::getCurrentTime() - start_time; - vt_debug_print( - terse, phase, - "phase={}: mig_time={}\n", - phase, mig_time - ); + if (theContext()->getNode() == 0) { + auto const mig_time = timing::getCurrentTime() - start_time; + vt_debug_print( + terse, phase, + "phase={}: mig_time={}\n", + phase, mig_time + ); + } // Inform the collection manager to rebuild spanning trees if needed if (reassignment->global_migration_count != 0) { @@ -270,12 +272,14 @@ LBManager::runLB(PhaseType phase, vt::Callback cb) { phase, base_proxy, model_.get(), stats, *comm, total_load_from_model, *data_map ); - auto const lb_time = timing::getCurrentTime() - start_time; - vt_debug_print( - terse, phase, - "phase={}: lb_time={}\n", - phase, lb_time - ); + if (theContext()->getNode() == 0) { + auto const lb_time = timing::getCurrentTime() - start_time; + vt_debug_print( + terse, phase, + "phase={}: lb_time={}\n", + phase, lb_time + ); + } cb.send(reassignment, phase); }