From e3f59b1c5a2834b1e920c778b6bb9d4a38c7e6e8 Mon Sep 17 00:00:00 2001 From: Sean McGovern Date: Tue, 20 Sep 2022 00:06:12 +0000 Subject: [PATCH] #1942: use isActive in termination and inline --- src/vt/termination/term_state.cc | 9 ++++----- src/vt/termination/term_state.h | 4 +++- src/vt/termination/termination.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/vt/termination/term_state.cc b/src/vt/termination/term_state.cc index 57c5dc10e4..76cb40d251 100644 --- a/src/vt/termination/term_state.cc +++ b/src/vt/termination/term_state.cc @@ -121,15 +121,14 @@ TermCounterType TermState::decrementDependency() { return --deps_; } -bool TermState::readySubmitParent(bool const needs_active) const { +bool TermState::readySubmitParent() const { vtAssert( num_children_ != uninitialized_destination, "Children must be valid" ); - auto const ret = (epoch_active_ or not needs_active) and - recv_child_count_ == num_children_ and local_terminated_ and - submitted_wave_ == cur_wave_ - 1 and not term_detected_ and - deps_ == 0; + auto const ret = epoch_active_ and local_terminated_ and + deps_ == 0 and recv_child_count_ == num_children_ and + submitted_wave_ == cur_wave_ - 1 and not term_detected_; vt_debug_print( verbose, term, diff --git a/src/vt/termination/term_state.h b/src/vt/termination/term_state.h index 5cbae03b5d..1e0d2aaa25 100644 --- a/src/vt/termination/term_state.h +++ b/src/vt/termination/term_state.h @@ -66,7 +66,7 @@ struct TermState : EpochDependency, EpochLabel { void notifyLocalTerminated(bool const terminated = true); void submitToParent(bool const is_root, bool const setup = false); void receiveContinueSignal(TermWaveType const& wave); - bool readySubmitParent(bool const needs_active = true) const; + bool readySubmitParent() const; EventCountType getRecvChildCount() const; EpochType getEpoch() const; TermWaveType getCurWave() const; @@ -76,6 +76,8 @@ struct TermState : EpochDependency, EpochLabel { void incrementDependency(); TermCounterType decrementDependency(); + inline bool isActive() const { return epoch_active_; } + TermState( EpochType const& in_epoch, bool const in_local_terminated, bool const active, NodeType const& children diff --git a/src/vt/termination/termination.h b/src/vt/termination/termination.h index 8834006308..ce9a90f092 100644 --- a/src/vt/termination/termination.h +++ b/src/vt/termination/termination.h @@ -422,7 +422,7 @@ struct TerminationDetector : * \param[in] produce whether its a produce or consume * \param[in] node the node producing to or consuming from */ - void produceConsume( + inline void produceConsume( EpochType epoch = any_epoch_sentinel, TermCounterType num_units = 1, bool produce = true, NodeType node = uninitialized_destination );