Skip to content

Commit

Permalink
#1507: Add verbose debugging prints to full set of TD context methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilMiller committed Jul 22, 2021
1 parent 5179013 commit c7b3a7a
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions src/vt/context/runnable_context/td.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,27 @@ TD::TD(EpochType in_ep)

void TD::begin() {
theMsg()->pushEpoch(ep_);
base_epoch_stack_size_ = theMsg()->getEpochStack().size();

auto& epoch_stack = theMsg()->getEpochStack();

vt_debug_print(
verbose, context,
"TD::begin: top={:x}, size={}\n",
epoch_stack.size() > 0 ? epoch_stack.top(): no_epoch,
epoch_stack.size()
);

base_epoch_stack_size_ = epoch_stack.size();
}

void TD::end() {
auto& epoch_stack = theMsg()->getEpochStack();

vt_debug_print(
verbose, context,
"TD::end: top={:x}, size={}\n",
"TD::end: top={:x}, size={}, base_size={}\n",
epoch_stack.size() > 0 ? epoch_stack.top(): no_epoch,
epoch_stack.size()
epoch_stack.size(), base_epoch_stack_size_
);

vtAssert(
Expand All @@ -91,6 +101,13 @@ void TD::end() {
void TD::suspend() {
auto& epoch_stack = theMsg()->getEpochStack();

vt_debug_print(
verbose, context,
"TD::suspend: top={:x}, size={}, base_size={}\n",
epoch_stack.size() > 0 ? epoch_stack.top(): no_epoch,
epoch_stack.size(), base_epoch_stack_size_
);

while (epoch_stack.size() > base_epoch_stack_size_) {
suspended_epochs_.push_back(theMsg()->getEpoch());
theMsg()->popEpoch();
Expand All @@ -105,6 +122,13 @@ void TD::resume() {
auto& epoch_stack = theMsg()->getEpochStack();
base_epoch_stack_size_ = epoch_stack.size();

vt_debug_print(
verbose, context,
"TD::resume: top={:x}, size={}, base_size={}\n",
epoch_stack.size() > 0 ? epoch_stack.top(): no_epoch,
epoch_stack.size(), base_epoch_stack_size_
);

for (auto it = suspended_epochs_.rbegin();
it != suspended_epochs_.rend();
++it) {
Expand Down

0 comments on commit c7b3a7a

Please sign in to comment.