Skip to content

Commit

Permalink
#723: term: make labels const& for epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Mar 9, 2020
1 parent 5442579 commit 5670ef2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/vt/termination/termination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand All @@ -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 ?
Expand All @@ -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;

Expand All @@ -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);

Expand Down
14 changes: 7 additions & 7 deletions src/vt/termination/termination.h
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
);
Expand All @@ -187,7 +187,7 @@ struct TerminationDetector :
* \return the new epoch
*/
EpochType makeEpochCollective(
std::string label,
std::string const& label,
SuccessorEpochCapture successor = SuccessorEpochCapture{}
);

Expand All @@ -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{}
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5670ef2

Please sign in to comment.