From cbe4a6cecc96b6f02adf3fdb069d445205143770 Mon Sep 17 00:00:00 2001 From: "W. David Dagenhart" Date: Fri, 19 Jun 2015 23:57:17 +0200 Subject: [PATCH 1/4] Replace getProcessParameterSet in PrescaleService This is part of a small migration to remove the function getProcessParameterSet from CMSSW. It relies on a static global that causes multithreading issues. And it does not work correctly with SubProcesses. I replaced the function with an alternative that should behave in exactly the same way. --- .../PrescaleService/interface/PrescaleService.h | 6 ++++++ FWCore/PrescaleService/src/PrescaleService.cc | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/FWCore/PrescaleService/interface/PrescaleService.h b/FWCore/PrescaleService/interface/PrescaleService.h index ced4a683e7a5d..96d6dfd736de3 100644 --- a/FWCore/PrescaleService/interface/PrescaleService.h +++ b/FWCore/PrescaleService/interface/PrescaleService.h @@ -1,6 +1,7 @@ #ifndef FWCore_PrescaleService_PrescaleService_h #define FWCore_PrescaleService_PrescaleService_h +#include "DataFormats/Provenance/interface/ParameterSetID.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/SaveConfiguration.h" @@ -12,6 +13,8 @@ namespace edm { class ActivityRegistry; class ConfigurationDescriptions; + class PathsAndConsumesOfModulesBase; + class ProcessContext; namespace service { @@ -47,6 +50,7 @@ namespace edm { // // private member functions // + void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); void postBeginJob(); // @@ -57,8 +61,10 @@ namespace edm { const unsigned int lvl1Default_; const std::vector vpsetPrescales_; PrescaleTable_t prescaleTable_; + ParameterSetID processParameterSetID_; }; } } #endif + diff --git a/FWCore/PrescaleService/src/PrescaleService.cc b/FWCore/PrescaleService/src/PrescaleService.cc index 49c58b411ce0f..ac9541b337e6a 100644 --- a/FWCore/PrescaleService/src/PrescaleService.cc +++ b/FWCore/PrescaleService/src/PrescaleService.cc @@ -8,9 +8,9 @@ #include "FWCore/PrescaleService/interface/PrescaleService.h" #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" -#include "FWCore/ParameterSet/interface/Registry.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ServiceRegistry/interface/ProcessContext.h" #include "FWCore/Utilities/interface/Exception.h" #include @@ -29,6 +29,7 @@ namespace edm { , vpsetPrescales_(iPS.getParameterSetVector("prescaleTable")) , prescaleTable_() { + iReg.watchPreBeginJob(this, &PrescaleService::preBeginJob); iReg.watchPostBeginJob(this, &PrescaleService::postBeginJob); // Sanity check @@ -61,11 +62,17 @@ namespace edm { // member functions + void PrescaleService::preBeginJob(PathsAndConsumesOfModulesBase const&, + ProcessContext const& processContext) { + if(!processParameterSetID_.isValid()) { + processParameterSetID_ = processContext.parameterSetID(); + } + } + void PrescaleService::postBeginJob() { - // Acesss to Process ParameterSet needed - can't be done in c'tor - const ParameterSet prcPS = getProcessParameterSet(); - + // Acess to Process ParameterSet needed - can't be done in c'tor + ParameterSet const& prcPS = edm::getParameterSet(processParameterSetID_); // Label of HLTPrescaler on each path, keyed on pathName std::map path2module; // Name of path for each HLTPrescaler, keyed on moduleLabel From b5c2915ecb57c1ca27414b2c83f3bae71002cbfc Mon Sep 17 00:00:00 2001 From: "W. David Dagenhart" Date: Mon, 22 Jun 2015 17:46:36 +0200 Subject: [PATCH 2/4] Bug fix so will compile -O0 -g Fix so that TrackingLayer will compile with -O0 0g flags. --- FastSimulation/Tracking/src/TrackingLayer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FastSimulation/Tracking/src/TrackingLayer.cc b/FastSimulation/Tracking/src/TrackingLayer.cc index bea7dc01630cf..e6e4d4742ba03 100644 --- a/FastSimulation/Tracking/src/TrackingLayer.cc +++ b/FastSimulation/Tracking/src/TrackingLayer.cc @@ -1,6 +1,7 @@ #include "FastSimulation/Tracking/interface/TrackingLayer.h" - +const TrackingLayer::eqfct TrackingLayer::_eqfct; + TrackingLayer::TrackingLayer(): _subDet(Det::UNKNOWN), _side(Side::BARREL), From eb4539cd14bf14763054c93009e581333aec9d10 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Mon, 22 Jun 2015 14:18:00 -0500 Subject: [PATCH 3/4] the canonical type of std::atomic in template edm::AtomicPtrCache is atomic --- Utilities/StaticAnalyzers/src/ClassChecker.cpp | 2 +- Utilities/StaticAnalyzers/src/CmsSupport.cpp | 5 +++-- Utilities/StaticAnalyzers/src/MutableMemberChecker.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Utilities/StaticAnalyzers/src/ClassChecker.cpp b/Utilities/StaticAnalyzers/src/ClassChecker.cpp index 55002a49da55d..ab8b1f3203399 100644 --- a/Utilities/StaticAnalyzers/src/ClassChecker.cpp +++ b/Utilities/StaticAnalyzers/src/ClassChecker.cpp @@ -671,7 +671,7 @@ void ClassChecker::checkASTDecl(const clang::CXXRecordDecl *RD, clang::ento::Ana WalkAST walker(this,BR, mgr.getAnalysisDeclContext(RD), (*(RD->ctor_begin()))->getMostRecentDecl() ) ; std::string buf; llvm::raw_string_ostream os(buf); - os << "Mutable member '" < names = { - "std::atomic", - "struct std::atomic", + "atomic<", + "std::atomic<", + "struct std::atomic<", "std::__atomic_", "std::mutex", "std::recursive_mutex", diff --git a/Utilities/StaticAnalyzers/src/MutableMemberChecker.cpp b/Utilities/StaticAnalyzers/src/MutableMemberChecker.cpp index 3e3f3c44dad94..96d30faf7f3c8 100644 --- a/Utilities/StaticAnalyzers/src/MutableMemberChecker.cpp +++ b/Utilities/StaticAnalyzers/src/MutableMemberChecker.cpp @@ -29,7 +29,7 @@ void MutableMemberChecker::checkASTDecl(const clang::FieldDecl *D, if ( ! support::isDataClass( D->getParent()->getQualifiedNameAsString() ) ) return; std::string buf; llvm::raw_string_ostream os(buf); - os << "Mutable member'" <getParent()->getQualifiedNameAsString()<<"', might be thread-unsafe when accessing via a const handle."; + os << "Mutable member'" <getParent()->getQualifiedNameAsString()<<"', might be thread-unsafe when accessing via a const handle."; BR.EmitBasicReport(D, this, "mutable member", "ThreadSafety", os.str(), DLoc); return; From da4320f98a7847d1f6f11dc45a09ce750c095252 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Tue, 23 Jun 2015 09:47:59 -0500 Subject: [PATCH 4/4] this got messed up somehow --- Utilities/StaticAnalyzers/scripts/data-class-funcs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Utilities/StaticAnalyzers/scripts/data-class-funcs.py b/Utilities/StaticAnalyzers/scripts/data-class-funcs.py index db63d1cb216ac..c1bb3bbafb0ae 100755 --- a/Utilities/StaticAnalyzers/scripts/data-class-funcs.py +++ b/Utilities/StaticAnalyzers/scripts/data-class-funcs.py @@ -173,7 +173,6 @@ exact= r"^" + re.escape(flaggedclass) + r"$" exactmatch=re.match(exact,dataclass) if exactmatch: - if re.match(flaggedclass,dataclass): print "Flagged event setup data class '"+dataclass+"' is accessed in call stack '", path = nx.shortest_path(G,tfunc,dataclassfunc) for p in path: