Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1967: TD: add enable/disable for performance tests #1968

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/vt/termination/termination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,4 +1233,18 @@ std::size_t TerminationDetector::getNumTerminatedCollectiveEpochs() const {
return window->getTotalTerminated();
}

void TerminationDetector::disableTD(EpochType in_epoch) {
vtAssert(not isDS(in_epoch), "Must not be a DS epoch");
auto& state = in_epoch == any_epoch_sentinel ?
any_epoch_state_ : findOrCreateState(in_epoch, false);
state.incrementDependency();
}

void TerminationDetector::enableTD(EpochType in_epoch) {
vtAssert(not isDS(in_epoch), "Must not be a DS epoch");
auto& state = in_epoch == any_epoch_sentinel ?
any_epoch_state_ : findOrCreateState(in_epoch, false);
state.decrementDependency();
}

}} // end namespace vt::term
19 changes: 19 additions & 0 deletions src/vt/termination/termination.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,25 @@ struct TerminationDetector :
*/
void addDependency(EpochType predecessor, EpochType successoor);

/**
* \brief Disable termination detection on an epoch. Local counting is still
* enabled, but any non-local progress is halted until it is enabled
*
* \warning Does not work with DS epochs
*
* \param[in] in_epoch the epoch
*/
void disableTD(EpochType in_epoch = any_epoch_sentinel);

/**
* \brief Enable termination detection on an epoch.
*
* \warning Does not work with DS epochs
*
* \param[in] in_epoch the epoch
*/
void enableTD(EpochType in_epoch = any_epoch_sentinel);

public:
// Methods for testing state of TD from unit tests
EpochContainerType<TermStateType> const& getEpochState() { return epoch_state_; }
Expand Down