From 5670ef2fb04facf245e075775baff34f9a247c17 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Mon, 9 Mar 2020 10:46:28 -0700 Subject: [PATCH] #723: term: make labels const& for epochs --- src/vt/termination/termination.cc | 14 +++++++------- src/vt/termination/termination.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/vt/termination/termination.cc b/src/vt/termination/termination.cc index 199b81c47b..520015b396 100644 --- a/src/vt/termination/termination.cc +++ b/src/vt/termination/termination.cc @@ -967,7 +967,7 @@ void TerminationDetector::finishedEpoch(EpochType const& epoch) { } EpochType TerminationDetector::makeEpochRootedWave( - SuccessorEpochCapture successor, std::string label + SuccessorEpochCapture successor, std::string const& label ) { auto const epoch = epoch::EpochManip::makeNewRootedEpoch(); @@ -1000,7 +1000,7 @@ EpochType TerminationDetector::makeEpochRootedWave( } EpochType TerminationDetector::makeEpochRootedDS( - SuccessorEpochCapture successor, std::string label + SuccessorEpochCapture successor, std::string const& label ) { auto const ds_cat = epoch::eEpochCategory::DijkstraScholtenEpoch; auto const epoch = epoch::EpochManip::makeNewRootedEpoch(false, ds_cat); @@ -1033,7 +1033,7 @@ EpochType TerminationDetector::makeEpochRooted( } EpochType TerminationDetector::makeEpochRooted( - std::string label, UseDS use_ds, SuccessorEpochCapture successor + std::string const& label, UseDS use_ds, SuccessorEpochCapture successor ) { /* * This method should only be called by the root node for the rooted epoch @@ -1072,7 +1072,7 @@ EpochType TerminationDetector::makeEpochCollective( } EpochType TerminationDetector::makeEpochCollective( - std::string label, SuccessorEpochCapture successor + std::string const& label, SuccessorEpochCapture successor ) { auto const epoch = epoch::EpochManip::makeNewEpoch(); @@ -1094,7 +1094,7 @@ EpochType TerminationDetector::makeEpochCollective( } EpochType TerminationDetector::makeEpoch( - std::string label, bool is_coll, UseDS use_ds, + std::string const& label, bool is_coll, UseDS use_ds, SuccessorEpochCapture successor ) { return is_coll ? @@ -1119,7 +1119,7 @@ void TerminationDetector::activateEpoch(EpochType const& epoch) { } void TerminationDetector::makeRootedHan( - EpochType const& epoch, bool is_root, std::string label + EpochType const& epoch, bool is_root, std::string const& label ) { bool const is_ready = !is_root; @@ -1141,7 +1141,7 @@ void TerminationDetector::makeRootedHan( } void TerminationDetector::setupNewEpoch( - EpochType const& epoch, std::string label + EpochType const& epoch, std::string const& label ) { auto epoch_iter = epoch_state_.find(epoch); diff --git a/src/vt/termination/termination.h b/src/vt/termination/termination.h index 7f30561539..eaea79cd15 100644 --- a/src/vt/termination/termination.h +++ b/src/vt/termination/termination.h @@ -173,7 +173,7 @@ struct TerminationDetector : * \return the new epoch */ EpochType makeEpochRooted( - std::string label, + std::string const& label, UseDS use_ds = UseDS{false}, SuccessorEpochCapture successor = SuccessorEpochCapture{} ); @@ -187,7 +187,7 @@ struct TerminationDetector : * \return the new epoch */ EpochType makeEpochCollective( - std::string label, + std::string const& label, SuccessorEpochCapture successor = SuccessorEpochCapture{} ); @@ -202,7 +202,7 @@ struct TerminationDetector : * \return the new epoch */ EpochType makeEpoch( - std::string label, + std::string const& label, bool is_coll, UseDS use_ds = UseDS{false}, SuccessorEpochCapture successor = SuccessorEpochCapture{} @@ -217,10 +217,10 @@ struct TerminationDetector : * Directly call into a specific type of rooted epoch, can not be overridden */ EpochType makeEpochRootedWave( - SuccessorEpochCapture successor, std::string label = "" + SuccessorEpochCapture successor, std::string const& label = "" ); EpochType makeEpochRootedDS( - SuccessorEpochCapture successor, std::string label = "" + SuccessorEpochCapture successor, std::string const& label = "" ); private: @@ -280,10 +280,10 @@ struct TerminationDetector : bool propagateEpoch(TermStateType& state); void epochTerminated(EpochType const& epoch, CallFromEnum from); void epochContinue(EpochType const& epoch, TermWaveType const& wave); - void setupNewEpoch(EpochType const& epoch, std::string label); + void setupNewEpoch(EpochType const& epoch, std::string const& label); void readyNewEpoch(EpochType const& epoch); void makeRootedHan( - EpochType const& epoch, bool is_root, std::string label = "" + EpochType const& epoch, bool is_root, std::string const& label = "" ); public: