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

New template one::EDAnalyzer for dealing with B ON/OFF transitions using EventSetup and PoolDBOutputService. #16248

Merged
merged 2 commits into from Oct 26, 2016

Conversation

diguida
Copy link
Contributor

@diguida diguida commented Oct 18, 2016

This code enables to automatically handle condition changes in case of magnetic field transitions using EventSetup via GlobalTag, and PoolDBOutputService. It was developed during 2015.

The new analyzer requires as template arguments:

  • the payload class
  • the associated Record

It grabs the whole information using the GlobalTag at endRun:

  1. it retrieves the value of the magnet current from the product delivered by RunInfoRcd
  2. it compares the average current with the threshold set by the user in the configuration
  3. it loads the payload from the target tag and the reference payload using the labels of the target Record: the target tag is associated to the empty (default) label, the reference tag is chosen from the label corresponding to B ON or B OFF according to the comparison of the above step
  4. it compares the current payload and the reference payload using an abstract method whose implementation is left to endusers, as they know how to assess whether or not two condition payloads are the same
  5. if the payloads are different, it writes the reference payload into the target tag using PoolDBOutputService.

A complete example is provided for the EcalADCToGeVConstant class.

@mmusich @franzoni this is something you might want to watch as well.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @diguida (Salvatore Di Guida) for CMSSW_8_1_X.

It involves the following packages:

CondCore/DBOutputService
CondTools/Ecal

@ghellwig, @cerminar, @cmsbuild, @franzoni, @ggovi, @mmusich, @davidlange6 can you please review it and eventually sign? Thanks.
@ghellwig, @apfeiffer1, @tocheng, @argiro this is something you requested to watch as well.
@slava77, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028

@mmusich
Copy link
Contributor

mmusich commented Oct 18, 2016

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 18, 2016

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 18, 2016

@diguida
Copy link
Contributor Author

diguida commented Oct 18, 2016

@smuzaffar question: what does

Additional comment: 'materialbudget'

mean in #16248 (comment)

@mmusich
Copy link
Contributor

mmusich commented Oct 18, 2016

seems it has been introduced here:
cms-sw/cms-bot@3adf702

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16248/15790/summary.html

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • 20024.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2023D1_GenSimHLBeamSpotFull+DigiFull_2023D1+RecoFullGlobal_2023D1+HARVESTFullGlobal_2023D1
  • 22424.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2023D3Timing_GenSimHLBeamSpotFull+DigiFull_2023D3Timing+RecoFullGlobal_2023D3Timing+HARVESTFullGlobal_2023D3Timing

Salvatore Di Guida added 2 commits October 18, 2016 19:10
…ntSetup and PoolDBOutputService. An example is provided for EcalADCToGeVConstant.
…ols/RunInfo: it is a tool manipulating tags based on a condition on the magnet current as seen in the RunInfo payloads.
@cmsbuild
Copy link
Contributor

Pull request #16248 was updated. @ggovi, @cmsbuild, @davidlange6 can you please check and sign again.

@diguida
Copy link
Contributor Author

diguida commented Oct 18, 2016

Small fixes:

  • rebased to latest IB
  • the analyzer is now in CondTools/RunInfo as it manipulates tags based on then magnet current as seen by the RunInfo payloads.

@mmusich
Copy link
Contributor

mmusich commented Oct 18, 2016

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 18, 2016

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

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-16248/15802/summary.html

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • 20024.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2023D1_GenSimHLBeamSpotFull+DigiFull_2023D1+RecoFullGlobal_2023D1+HARVESTFullGlobal_2023D1
  • 22424.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2023D3Timing_GenSimHLBeamSpotFull+DigiFull_2023D3Timing+RecoFullGlobal_2023D3Timing+HARVESTFullGlobal_2023D3Timing

@smuzaffar
Copy link
Contributor

@diguida, please ignore that. I was testing cms-bot reporting script.

@ggovi
Copy link
Contributor

ggovi commented Oct 25, 2016

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_8_1_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @smuzaffar

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 331b38f into cms-sw:CMSSW_8_1_X Oct 26, 2016
public:
BTransitionAnalyzer( const edm::ParameterSet& pset ):
m_currentThreshold( pset.getUntrackedParameter<double>( "currentThreshold", 18000. ) ) {
usesResource( "PoolDBOutputService" );

Choose a reason for hiding this comment

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

@diguida I have just one comment/question. You declare that you use the resource "PoolDBOutputService". As I understood, this is only needed, if the resource is not thread-safe. However, @Dr15Jones commented in this HN thread that it appears to be thread-safe.
Do you have reasons to declare it anyways, except that "appears to be thread-safe" might be a bit vague?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ghellwig sorry for late reply.
As discussed few minutes ago at the AlCaDB meeting, the code here was originally developed in 7.4.X, where PoolDBOutputService was not thread safe.
According to the API description

The system makes sure that only one module which has declared a usage of a specific resource will ever be run at a time. That is, the system will serialize all calls to all modules which declare that resource.

In the online context of the O2O, a cmsRun job will call only this module (apart from input sources), so, even if formally the performance penalty is introduced, operationally it should not be visible. Besides this, in that context you care more of the correctness of the database transactions than of the performance of job: if you have a fast job potentially writing wrong IOV, this is a big problem.

Anyhow, if also @Dr15Jones agrees that the usesResource is not needed, I can put a PR removing it.

HTH

P.S.: you were also saying another observation at the meeting, but I did not catch it. Feel free to post it here.

Choose a reason for hiding this comment

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

@diguida thanks for the clarification!
My other comment does not apply anymore, but I list it here for reference: You write usesResource("PoolDBOutputService");, but in general it is better practice to define a static const string in PoolDBOutputService and use this to avoid typos because the compiler checks the name of the variable which is not the case if you use a hard-coded string everytime the resource is used.

Copy link
Contributor Author

@diguida diguida Oct 31, 2016

Choose a reason for hiding this comment

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

@ghellwig you are absolutely right! This is common sense (as well as a software best practice):

  • adding a static data member using constant expression for labelling the framework service name:static constexpr auto serviceName = "PoolDBOutputService";
  • using it every time you refer to the service name in client code: usesResource( std::string( PoolDBOutputService::serviceName ) );

@Dr15Jones
Copy link
Contributor

I used 'appears' just to give me wiggle room in case I missed something. The code is definitely intended to be thread safe so I would therefore suggest not using a 'SharedResource' for the Service. If we later discover a thread-safety problem, we'll treat that as a bug in the Service and fix the Service.

@diguida
Copy link
Contributor Author

diguida commented Nov 2, 2016

@Dr15Jones thanks for looking into this.
I am submitting a PR with the fix.

I also owe you a reply in a private thread on a similar topic: sorry about that, will come back to you later today.

@diguida
Copy link
Contributor Author

diguida commented Nov 2, 2016

FYI: #16427

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

8 participants