Skip to content

Commit

Permalink
#2197: Queue epoch actions before notifying successors
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Sep 28, 2024
1 parent 5538883 commit c64e81b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/vt/termination/term_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/vt/termination/termination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

Expand Down

0 comments on commit c64e81b

Please sign in to comment.