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

Const correct Principal #12836

Merged
merged 5 commits into from Dec 22, 2015
Merged

Conversation

Dr15Jones
Copy link
Contributor

Improved the const correctness of the internal classes used by Principal. This should help reason about the thread-safety of those classes.

Added our own version of propagate_const which is under consideration for C++17 as is in the experimental namespace for gcc and clang. This allows one force pointer like objects to only give const access to their pointed to object when using a const pointer.

propagate_const is an C++17 experimental class used to make pointers and pointer like classes have 'deep const' semantics. This is very useful for reasoning about const thread-safety.
This is a partial implementation of the proposed standard. We will replace this class once the actual one is in the C++ standard.
The moduleDescription() method should have always been a const member function. This error was found by the use of propagate_const on the code that holds Workers.
Converted all pointer like member data to only point to const objects.
Only allow const access to internal data via const member functions.
Removed the need for productProvenanceValid_ and instead just use productPRovenancePtr_. This allowed the code to only need one mutable to handle the caching.
Reduced the number of mutable data members used.
Switched to using propagate_const<> to make pointer like data members have deep const behavior.
Changes the API of a number of internal classes to be properly const or non-const.
These changes are meant to make it easier to reason about the thread-safety of the classes.
@cmsbuild
Copy link
Contributor

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

It involves the following packages:

DataFormats/Common
DataFormats/Provenance
FWCore/Framework
FWCore/Modules
FWCore/Utilities

@cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please review it and eventually sign? Thanks.
@makortel, @Martin-Grunewald, @wddgit, @wmtan this is something you requested to watch as well.
@slava77, @Degano, @smuzaffar you are the release manager for this.

Following commands in first line of a comment are recognized

  • +1|approve[d]|sign[ed]: L1/L2's to approve it
  • -1|reject[ed]: L1/L2's to reject it
  • assign <category>[,<category>[,...]]: L1/L2's to request signatures from other categories
  • unassign <category>[,<category>[,...]]: L1/L2's to remove signatures from other categories
  • hold: L1/all L2's/release manager to mark it as on hold
  • unhold: L1/user who put this PR on hold
  • merge: L1/release managers to merge this request
  • [@cmsbuild,] please test: L1/L2 and selected users to start jenkins tests
  • [@cmsbuild,] please test with cms-sw/cmsdist#<PR>: L1/L2 and selected users to start jenkins tests using externals from cmsdist

@Dr15Jones
Copy link
Contributor Author

please test

@Dr15Jones
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/10366/console

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_8_0_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

-1
Tested at: 288c91c
I found an error when building:

>> Compiling edm plugin /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/JetMET/src/JetMETDQMPostProcessor.cc 
>> Compiling edm plugin /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/JetMET/src/SealModule.cc 
Entering library rule at MuonAnalysis/MuonAssociators
>> Compiling  /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/L1Trigger/CSCTrackFinder/src/CSCSectorReceiverLUT.cc 
In file included from /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/src/EmDQMReco.cc:4:0:
/tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/interface/EmDQMReco.h:211:10: error: 'scoped_ptr' in namespace 'boost' does not name a template type
   boost::scoped_ptr histReco;
          ^
/tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2015-12-19-1100/src/HLTriggerOffline/Egamma/interface/EmDQMReco.h:216:10: error: 'scoped_ptr' in namespace 'boost' does not name a template type
   boost::scoped_ptr histRecoMonpath;
          ^


you can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-12836/10366/summary.html

A boost include was coming indirectly from a different header file.
@cmsbuild
Copy link
Contributor

Pull request #12836 was updated. @smuzaffar, @Dr15Jones, @cmsbuild, @deguio, @vanbesien, @davidlange6 can you please check and sign again.

@Dr15Jones
Copy link
Contributor Author

please test

@Dr15Jones
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/10372/console

@Dr15Jones
Copy link
Contributor Author

@deguio @vanbesien the DQM signature is only because I had to add a #include for boost which was previously obtained indirectly through a framework header. That framework header no longer provides that include.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

davidlange6 added a commit that referenced this pull request Dec 22, 2015
@davidlange6 davidlange6 merged commit 171a742 into cms-sw:CMSSW_8_0_X Dec 22, 2015
@Dr15Jones Dr15Jones deleted the constCorrectPrincipal branch January 6, 2016 15:50
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

3 participants