Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2390: getRecentTime() should not be used when tracing is enabled #2394

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/vt/runnable/runnable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,20 @@ void RunnableNew::run() {
{
needs_time = contexts_.lb.needsTime();
}
TimeType start_time = needs_time ? theSched()->getRecentTime() : TimeType{NAN};

auto getTime = [&]() {
#if vt_check_enabled(trace_enabled)
if (theTrace()) {
return timing::getCurrentTime();
}
else
#endif
{
return theSched()->getRecentTime();
}
};

TimeType start_time = needs_time ? getTime() : TimeType{NAN};

#if vt_check_enabled(fcontext)
if (suspended_) {
Expand Down Expand Up @@ -175,7 +188,7 @@ void RunnableNew::run() {
#endif
}
theSched()->setRecentTimeToStale();
TimeType end_time = needs_time ? theSched()->getRecentTime() : TimeType{NAN};
TimeType end_time = needs_time ? getTime() : TimeType{NAN};



Expand Down
Loading