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

Manage PluginFactory plugins with unique_ptr in PhysicsTools #25914

Merged
merged 3 commits into from Feb 23, 2019

Conversation

makortel
Copy link
Contributor

In addition use unique_ptr or shared_ptr constructor where needed to prepare for PluginFactory returnning std::unique_ptr. Also removed useless try-catches from CachingVariable.

Tested in CMSSW_10_5_X_2019-02-05-1100 , no changes expected.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25914/8394

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

PhysicsTools/IsolationAlgos
PhysicsTools/MVAComputer
PhysicsTools/MVATrainer
PhysicsTools/PatAlgos
PhysicsTools/SelectorUtils
PhysicsTools/UtilAlgos

@cmsbuild, @perrotta, @santocch, @slava77 can you please review it and eventually sign? Thanks.
@TaiSakuma, @gouskos, @rappoccio, @HeinerTholen, @seemasharmafnal, @mmarionncern, @imarches, @ahinzmann, @smoortga, @acaudron, @jdolen, @drkovalskyi, @ferencek, @jdamgov, @nhanvtran, @gkasieczka, @schoef, @clelange, @JyothsnaKomaragiri, @mverzett, @gpetruc, @mariadalfonso, @pvmulder this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 12, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/33093/console Started: 2019/02/12 16:59

delete TrainProcessor::PluginFactory::get()->create(
std::string("TrainProcessor/") + name);
std::unique_ptr<PhysicsTools::TrainProcessor::Dummy> tmp{TrainProcessor::PluginFactory::get()->create(
std::string("TrainProcessor/") + name)};
result = ProcessRegistry::create(name, id, trainer);
} catch(const cms::Exception &e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In principle the try-catch here is unnecessary, and the behavior could be preserved by using PluginFactory::tryToCreate(). On the other hand, the comment below says

// caller will have to deal with the null pointer
// in principle this will just give a slightly more
// descriptive error message (and will rethrow anyhow)

but there is no rethrow. So I'm not sure if this code should throw (keep the create() but remove try-catch as unnecessary) or not (change to tryToCreate()).

delete VPPluginFactory::get()->create(
std::string("VarProcessor/") + name);
std::unique_ptr<PhysicsTools::VarProcessor::Dummy> tmp {VPPluginFactory::get()->create(
std::string("VarProcessor/") + name)};
result = ProcessRegistry::create(name, calib, parent);
} catch(const cms::Exception &e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is a similar pattern as in https://github.com/cms-sw/cmssw/pull/25914/files#r256024015, except

  • the code rethrows (so should use create()
  • the code issues a LogError before rethrowing, so needs the try-catch (although I'm not so sure about the usefulness of the LogError if the exception propagates to the framework)

@cmsbuild
Copy link
Contributor

-1

Tested at: 8d1d694

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

I found follow errors while testing this PR

Failed tests: UnitTests

  • Unit Tests:

I found errors in the following unit tests:

---> test runtestRecoEgammaPhotonIdentification had ERRORS
---> test runtestRecoEgammaElectronIdentification had ERRORS
---> test runtestPhysicsToolsPatAlgos had ERRORS

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3097440
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3097242
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

@makortel
Copy link
Contributor Author

I wasn't able to reproduce any of the unit test failures in CMSSW_10_5_X_2019-02-05-1100 at LPC.

@makortel makortel changed the title Manage plugin factory plugins with unique_ptr in PhysicsTools Manage PluginFactory plugins with unique_ptr in PhysicsTools Feb 14, 2019
@perrotta
Copy link
Contributor

please test
(let try once again: in the tests run on the latest PRs those crashes seem to have disappeared...)

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 15, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/33145/console Started: 2019/02/15 09:52

@cmsbuild
Copy link
Contributor

-1

Tested at: 8d1d694

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

I found follow errors while testing this PR

Failed tests: UnitTests

  • Unit Tests:

I found errors in the following unit tests:

---> test runtestUtilAlgos had ERRORS
---> test runtestRecoEgammaPhotonIdentification had ERRORS
---> test runtestRecoEgammaElectronIdentification had ERRORS
---> test runtestPhysicsToolsPatAlgos had ERRORS

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3098286
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3098088
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

@makortel
Copy link
Contributor Author

I ran all the failing unit tests in CMSSW_10_5_ASAN_X_2019-02-15-2300, ASAN did not report anything.

@perrotta
Copy link
Contributor

+1

@fabiocos
Copy link
Contributor

@makortel @perrotta I understand that the final choice is to keep the code structure using try-catch as it is. I will merge this PR to see possible impact in the IB unit tests

@fabiocos
Copy link
Contributor

+1

to verify whether the unit test issue is related to the PR itself or to the observed problems in the test system

@fabiocos
Copy link
Contributor

merge

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

6 participants