Skip to content

Commit

Permalink
#410: term: use new direct epoch category tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jun 20, 2019
1 parent 604f599 commit f47e269
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/vt/termination/termination.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ struct TerminationDetector :

friend struct ds::StateDS;

bool isRooted(EpochType epoch);
bool isDS(EpochType epoch);
/*
* Test different types of epochs
*/
bool isRooted(EpochType epoch) const;
bool isDS(EpochType epoch) const;
bool isDep(EpochType epoch) const;

TermStateDSType* getDSTerm(EpochType epoch, bool is_root = false);

void resetGlobalTerm();
Expand Down
16 changes: 8 additions & 8 deletions src/vt/termination/termination.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ inline void TerminationDetector::consume(
return produceConsume(in_epoch, num_units, false, node);
}

inline bool TerminationDetector::isRooted(EpochType epoch) {
inline bool TerminationDetector::isRooted(EpochType epoch) const {
bool const is_sentinel = epoch == any_epoch_sentinel or epoch == no_epoch;
return is_sentinel ? false : epoch::EpochManip::isRooted(epoch);
}

inline bool TerminationDetector::isDS(EpochType epoch) {
if (isRooted(epoch)) {
auto const ds_epoch = epoch::eEpochCategory::DijkstraScholtenEpoch;
auto const epoch_category = epoch::EpochManip::category(epoch);
auto const is_ds = epoch_category == ds_epoch;
return is_ds;
} else {
inline bool TerminationDetector::isDS(EpochType epoch) const {
if (not isRooted(epoch)) {
return false;
}
return epoch::EpochManip::isDS(epoch);
}

inline bool TerminationDetector::isDep(EpochType epoch) const {
return epoch::EpochManip::isDep(epoch);
}

}} /* end namespace vt::term */
Expand Down

0 comments on commit f47e269

Please sign in to comment.