Skip to content

Commit

Permalink
#1941: remove repeated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
stmcgovern committed Sep 16, 2022
1 parent 309155e commit e6a122b
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions src/vt/termination/termination.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,6 @@ TerminationDetector::findOrCreateState(EpochType const& epoch, bool is_ready) {
return epoch_iter->second;
}

void TerminationDetector::produceConsumeState(
TermStateType& state, TermCounterType const num_units, bool produce,
NodeType node
) {
auto& counter = produce ? state.l_prod : state.l_cons;
counter += num_units;

vt_debug_print(
verbose, term,
"produceConsumeState: epoch={:x}, event_count={}, l_prod={}, l_cons={}, "
"num_units={}, produce={}, node={}\n",
state.getEpoch(), state.getRecvChildCount(), state.l_prod, state.l_cons, num_units,
print_bool(produce), node
);

if (state.readySubmitParent()) {
propagateEpoch(state);
}
}

TerminationDetector::TermStateDSType*
TerminationDetector::getDSTerm(EpochType epoch, bool is_root) {
vt_debug_print(
Expand Down Expand Up @@ -189,38 +169,6 @@ TerminationDetector::getDSTerm(EpochType epoch, bool is_root) {
}
}

void TerminationDetector::produceConsume(
EpochType epoch, TermCounterType num_units, bool produce, NodeType node
) {
vt_debug_print(
normal, term,
"produceConsume: epoch={:x}, rooted={}, ds={}, count={}, produce={}, "
"node={}\n",
epoch, isRooted(epoch), isDS(epoch), num_units, produce, node
);

// If a node is not passed, use the current node (self-prod/cons)
if (node == uninitialized_destination) {
node = theContext()->getNode();
}

produceConsumeState(any_epoch_state_, num_units, produce, node);

if (epoch != any_epoch_sentinel) {
if (isDS(epoch)) {
auto ds_term = getDSTerm(epoch);
if (produce) {
ds_term->msgSent(node,num_units);
} else {
ds_term->msgProcessed(node,num_units);
}
} else {
auto& state = findOrCreateState(epoch, false);
produceConsumeState(state, num_units, produce, node);
}
}
}

void TerminationDetector::maybePropagate() {
if (any_epoch_state_.readySubmitParent()) {
propagateEpoch(any_epoch_state_);
Expand Down

0 comments on commit e6a122b

Please sign in to comment.