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

Navigation #3547

Closed
wants to merge 13 commits into from
Closed

Navigation #3547

wants to merge 13 commits into from

Conversation

VinInn
Copy link
Contributor

@VinInn VinInn commented Apr 28, 2014

On Friday Chris reported that
Trackings use of DetLayer is inherently thread unsafe. The NavigationSchool is in the EventSetup but it gives non-const access to its internal DetLayers:
https://cmssdt.cern.ch/SDT/lxr/source/TrackingTools/DetLayers/interface/NavigationSchool.h?v=CMSSW_7_1_X_2014-04-25-0200#028
and those DetLayers are constantly being modified by other code:
https://cmssdt.cern.ch/SDT/lxr/source/TrackingTools/DetLayers/src/NavigationSetter.cc?v=CMSSW_7_1_X_2014-04-25-0200#059
In addition, the DetLayers have internally a NavigableLayer* which they give non-const access to and call non-const methods on in its own const functions:
https://cmssdt.cern.ch/SDT/lxr/source/TrackingTools/DetLayers/interface/DetLayer.h?v=CMSSW_7_1_X_2014-04-25-0200#050
and to top it off, some types inheriting from NavigableLayer use mutables
https://cmssdt.cern.ch/SDT/lxr/source/RecoTracker/TkNavigation/interface/SimpleNavigableLayer.h?v=CMSSW_7_1_X_2014-04-25-0200#042
The only way to deal with this now is to mark all modules which interact with DetLayers as thread-unsafe.

After a week-end long of code analysis I come to the conclusion that the best solution will be:
to create a vector of NavigableLayer const * in the NavigationSchool (or equivalent)
using DetLayer::seqNum as index.
One should them to manage to get the NavigationSchool everywhere
nextLayers and compatibleLayers are invoked a trivial indirection will do the trick…

This is
a) easy to find all calls to nextLayers and compatibleLayers.
Labour intensive to percolate the navigation school. NOT error-prone
b) quite logical, it will reassign the responsibility of navigation to the Navigation!
c) No changes to configation (unless percolation fails)

Plan there're is

  1. The infrastructure for both tracker and muon is trivial to build.
    I wil do it togehter with a couple of use case.

  2. at that point the Labour intensive part can be split in many pieces: it it just to find the way to percolate navigation scool and modify the calling sequence to
    nextLayers and compatibleLayers by few characters (litterally!)

  3. remove all “mutable” including the Navigation Setter.
    add const here and there (maybe a couple of cost_cast in the NavigationSchool itself)

DONE…


status : this PR

done for Base class, Simple, Cosmic and Muon
all three tested with properly modified already existing unit tests

done in CkfTrajectoryBuilder and Maker (+ partial in Conversion f/w/c TrBuilder)
one NavigationSetter gone!

at this point we ca go in Parallel.
This PR is therefore requested to be integrated to allow other developers to modify various bits of code
that require NavigationSchool to be percolated

No regression expected
No regression observed

@VinInn
Copy link
Contributor Author

VinInn commented Apr 28, 2014

It breaks BeamHalo (wmf 8.0)
I should have known...
I will fix BeamHalo Nav school to make Relval working...

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @VinInn (Vincenzo Innocente) for CMSSW_7_1_X.

Navigation

It involves the following packages:

RecoEgamma/EgammaPhotonProducers
RecoMuon/DetLayers
RecoMuon/Navigation
RecoTracker/CkfPattern
RecoTracker/TkNavigation
TrackingTools/DetLayers

@nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please review it and eventually sign? Thanks.
@ghellwig, @GiacomoSguazzoni, @rovere, @lgray, @gpetruc, @cerati, @bachtis, @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

Pull request #3547 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include <iostream>
#include <iomanip>
using namespace std;

MuonNavigationPrinter::MuonNavigationPrinter(const MuonDetLayerGeometry * muonLayout, bool enableRPC) {
#define VI_DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

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

No bueno

@slava77
Copy link
Contributor

slava77 commented Apr 29, 2014

-1

please remove couts

@VinInn
Copy link
Contributor Author

VinInn commented Apr 29, 2014

cout went out and in again due to a bad sync on my area sorry...

@VinInn
Copy link
Contributor Author

VinInn commented Apr 29, 2014

@davidlange6 @Dr15Jones
please note that as long as this PR is not fully reviewed, signed, accepted and integrated in an IB all work on making Tracking Geometry ThreadSafe is blocked

@VinInn
Copy link
Contributor Author

VinInn commented Apr 29, 2014

oops, needs a rebase...

@cmsbuild
Copy link
Contributor

Pull request #3547 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@VinInn
Copy link
Contributor Author

VinInn commented Apr 30, 2014

obsoleted by #3590

@VinInn VinInn mentioned this pull request Apr 30, 2014
@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

4 participants