diff --git a/src/vt/termination/term_action.cc b/src/vt/termination/term_action.cc index ce901459a4..3b62cbdc6e 100644 --- a/src/vt/termination/term_action.cc +++ b/src/vt/termination/term_action.cc @@ -115,8 +115,11 @@ void TermAction::addActionEpoch(EpochType const& epoch, ActionType action) { return addAction(action); } else { auto encapsulated_epoch = getCurrentEpoch(); - theTerm()->produce(encapsulated_epoch); epoch_actions_[epoch][encapsulated_epoch].push_back(action); + + if (encapsulated_epoch != term::any_epoch_sentinel) { + theTerm()->addDependency(epoch, encapsulated_epoch); + } } afterAddEpochAction(epoch); } @@ -134,7 +137,6 @@ void TermAction::triggerAllEpochActions( if (auto iter2 = iter->second.find(encapsulated_epoch); iter2 != iter->second.end()) { for (auto&& action : iter2->second) { - theTerm()->consume(encapsulated_epoch); action(); } iter->second.erase(iter2); diff --git a/src/vt/termination/termination.cc b/src/vt/termination/termination.cc index 197b7057a7..d3207b782e 100644 --- a/src/vt/termination/termination.cc +++ b/src/vt/termination/termination.cc @@ -649,6 +649,9 @@ void TerminationDetector::epochTerminated(EpochType const& epoch, CallFromEnum f epoch, isRooted(epoch), isDS(epoch), from == CallFromEnum::Root ? true : false ); + // Trigger actions associated with epoch + queueActions(epoch); + // Clear all the successor epochs that are nested by this epoch (waiting on it // to complete) if (epoch != term::any_epoch_sentinel) { @@ -658,9 +661,6 @@ void TerminationDetector::epochTerminated(EpochType const& epoch, CallFromEnum f } } - // Trigger actions associated with epoch - queueActions(epoch); - // Update the window for the epoch archetype updateResolvedEpochs(epoch);