Skip to content

Commit

Permalink
#900 pmpi- even Wtime bypassed in TraceScopedEvent
Browse files Browse the repository at this point in the history
- Passing 'no event' is used to create a NO-OP call to this type.
  Ensure that it truly is a NO-OP in this case.
  • Loading branch information
pnstickne committed Jul 21, 2020
1 parent c1b8f38 commit 4def551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vt/trace/trace_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ struct TraceScopedEvent final {
* \c registerEventCollective )
*/
explicit TraceScopedEvent(UserEventIDType event)
: begin_(Trace::getCurrentTime()),
: begin_(event != no_user_event_id ? Trace::getCurrentTime() : 0),
event_(event)
{ }

Expand Down Expand Up @@ -259,7 +259,7 @@ struct TraceScopedNote final {
*/
TraceScopedNote(
std::string const& in_note, TraceEventIDType const in_event = no_trace_event
) : begin_(Trace::getCurrentTime()),
) : begin_(in_event != no_trace_event ? Trace::getCurrentTime() : 0),
event_(in_event),
note_(in_note)
{ }
Expand Down

0 comments on commit 4def551

Please sign in to comment.