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

Fix thread safety of SteppingHelixPropagator #3160

Conversation

Dr15Jones
Copy link
Contributor

Removed mutables in SteppingHelixPropagator and instead put those data items on the stack when doing the operations.

Removed mutables in SteppingHelixPropagator and instead put those
data items on the stack when doing the operations.
This change avoids returning a copy and instead taking the value by
argument. This only affects the methods new to SteppingHelixPropagator.
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2014

A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_1_X.

Fix thread safety of SteppingHelixPropagator

It involves the following packages:

Calibration/HcalAlCaRecoProducers
FastSimulation/MuonSimHitProducer
TrackPropagation/SteppingHelixPropagator
TrackingTools/TrackAssociator

@diguida, @lveldere, @cmsbuild, @anton-a, @thspeer, @rcastello, @giamman, @slava77, @Degano, @nclopezo can you please review it and eventually sign? Thanks.
@gpetruc, @cerati, @GiacomoSguazzoni, @rovere, @venturia this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2014

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2014

@lveldere
Copy link
Contributor

lveldere commented Apr 3, 2014

+1

@@ -80,7 +80,7 @@ void CachedTrajectory::propagate(SteppingHelixStateInfo& state, const Plane& pla
if( const SteppingHelixPropagator* shp = dynamic_cast<const SteppingHelixPropagator*>(propagator_) )
{
try {
state = shp->propagate(state, plane);
shp->propagate(state, plane, state);
Copy link
Contributor

Choose a reason for hiding this comment

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

both "state" are refs and the second one is modified, while the first one is just read for info .. the result is not very predictable.
Need to define stateLast and stateNext to decouple these and then stateLast=stateNext after the call (or smth like that).
This place is most likely the reason for the regressions that I observe.
Chris, would you like to try to fix this or should I take over this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with you taking over the pull, especially since you have ways of testing :). Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One note, the first argument I thought was copied to a temporary area as the first step of the propagate call so the state shouldn't have interfered with itself. That's why I left it that way. However, it would have been easy for me to miss a corner case where the state initial value was used directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed, the state is copied. Something else is wrong then :(

@slava77
Copy link
Contributor

slava77 commented Apr 3, 2014

some regressions are visible, most likely due to the way the TrackingTools/TrackAssociator/src/CachedTrajectory.cc was modified.
I don't see any timing increase. So, overall the strategy of changes is right, just the change in the CachedTrajectory is a bug

@slava77
Copy link
Contributor

slava77 commented Apr 3, 2014

-1

superseded by #3196

@ktf ktf closed this Apr 4, 2014
ktf added a commit that referenced this pull request Apr 14, 2014
…readSafe

Multithreading -- Fix thread safety in steppingHelixPropagator (supersede #3160)
@Dr15Jones Dr15Jones deleted the fixThreadSafetyOfSteppingHelixPropagator branch April 14, 2014 19:52
shervin86 pushed a commit to shervin86/cmssw that referenced this pull request May 11, 2015
…-shpThreadSafe

Multithreading -- Fix thread safety in steppingHelixPropagator (supersede cms-sw#3160)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants