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

#2019: add move constructor/assign to TraceScopedEvent and TraceScopedNote #2020

Conversation

nmm0
Copy link
Collaborator

@nmm0 nmm0 commented Nov 21, 2022

Fixes #2019

@github-actions
Copy link

github-actions bot commented Nov 21, 2022

Pipelines results

PR tests (gcc-5, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-6, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-3.9, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-9, ubuntu, mpich, zoltan)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-10, ubuntu, openmpi, no LB)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-5.0, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-9, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-7, ubuntu, mpich, trace runtime, LB)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-11, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-12, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-13, alpine, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-13, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-14, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (intel icpx, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (nvidia cuda 10.1, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-11, ubuntu, mpich, json schema test)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-12, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (clang-10, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (nvidia cuda 11.0, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (intel icpc, ubuntu, mpich)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


PR tests (gcc-8, ubuntu, mpich, address sanitizer)

Build for 22d105f (2022-11-21 18:36:01 UTC)

Compilation - successful

Testing - passed

Build log


@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #2020 (22d105f) into develop (1259a37) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2020      +/-   ##
===========================================
- Coverage    84.50%   84.49%   -0.02%     
===========================================
  Files          731      731              
  Lines        25860    25860              
===========================================
- Hits         21854    21850       -4     
- Misses        4006     4010       +4     
Impacted Files Coverage Δ
src/vt/trace/trace_user.h 71.42% <ø> (ø)
src/vt/phase/phase_manager.cc 89.86% <0.00%> (-2.71%) ⬇️

Copy link
Member

@PhilMiller PhilMiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know calling swap is idiomatic, but I'd be more comfortable if the moved from objects had their event fields assigned the no event value explicitly, moreso in the move assignment case.

@nmm0
Copy link
Collaborator Author

nmm0 commented Nov 21, 2022

I know calling swap is idiomatic, but I'd be more comfortable if the moved from objects had their event fields assigned the no event value explicitly, moreso in the move assignment case.

For the move constructor it is set explicitly then swapped (from the initializer on event_), but for move assignment it has to use a swap to be correct if not the old value (if it is not no_trace_event) will never be released

@PhilMiller
Copy link
Member

I feel like if that case ever arises, it represents a logic bug, which we should maybe assert against.

What's the actual use case for allowing any sort of move construction or assignment of these types? I figured it was for something like moving into a closure, where there's no existing event to be dealt with.

@nmm0
Copy link
Collaborator Author

nmm0 commented Nov 22, 2022

I feel like if that case ever arises, it represents a logic bug, which we should maybe assert against.

What's the actual use case for allowing any sort of move construction or assignment of these types? I figured it was for something like moving into a closure, where there's no existing event to be dealt with.

One I can think of off the top of my head would be an object that needs to extend the lifetime of the TraceScopedEvent/Note until it is passed a new event. When passed a new event (lets say at the end of an iteration or something), it would need to move the new event into its storage, releasing the previous scope.

@PhilMiller
Copy link
Member

Ok, I'll buy it.

Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@PhilMiller PhilMiller merged commit f5722f5 into develop Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants