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

Remove boost lexical_cast dependency in FWCore #34976

Merged
merged 2 commits into from Aug 24, 2021

Conversation

Purva-Chaudhari
Copy link
Contributor

PR description:

Remove boost lexical cast dependency in FWCore with corresponding stl alternatives

PR validation:

Passed on scram -b runtests (FWCore)

if this PR is a backport please specify the original PR and why you need to backport that PR:

@davidlange6 @vgvassilev

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34976/24818

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Purva-Chaudhari for master.

It involves the following packages:

  • FWCore/Modules (core)
  • FWCore/ParameterSet (core)
  • FWCore/Services (core)
  • FWCore/Utilities (core)

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @wddgit this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor

please test

Copy link
Contributor

@makortel makortel left a comment

Choose a reason for hiding this comment

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

Thanks!

// std::cerr << "to:" << to << std::endl;
} catch (boost::bad_lexical_cast&) {
} catch (const std::invalid_argument&) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be useful to catch also std::out_of_range. The both appear to inherit from std::logic_error, so I'd suggest to catch either that or the std::exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replacing with a catch for std::exception in both the files.

@@ -210,7 +209,7 @@ namespace edm {
pinfo.num_threads >> pinfo.itrealvalue >> pinfo.starttime >> pinfo.vsize >> pinfo.rss >> pinfo.rlim >>
pinfo.startcode >> pinfo.endcode >> pinfo.startstack >> pinfo.kstkesp >> pinfo.kstkeip >> pinfo.signal >>
pinfo.blocked >> pinfo.sigignore >> pinfo.sigcatch >> pinfo.wchan;
} catch (boost::bad_lexical_cast& iE) {
} catch (const std::invalid_argument& iE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

std::out_of_range should be caught also here.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-df0944/17967/summary.html
COMMIT: 95b936c
CMSSW: CMSSW_12_1_X_2021-08-22-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/34976/17967/install.sh to create a dev area with all the needed externals and cmssw changes.

CMS StaticAnalyzer warnings: There are 1 inherits from legacy modules warnings. See https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-df0944/17967/llvm-analysis/legacy-mod-sa.txt for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 39
  • DQMHistoTests: Total histograms compared: 3000352
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3000324
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 38 files compared)
  • Checked 165 log files, 37 edm output root files, 39 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34976/24831

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

Pull request #34976 was updated. @makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please check and sign again.

@makortel
Copy link
Contributor

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-df0944/17977/summary.html
COMMIT: 37da860
CMSSW: CMSSW_12_1_X_2021-08-23-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/34976/17977/install.sh to create a dev area with all the needed externals and cmssw changes.

CMS StaticAnalyzer warnings: There are 1 inherits from legacy modules warnings. See https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-df0944/17977/llvm-analysis/legacy-mod-sa.txt for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 39
  • DQMHistoTests: Total histograms compared: 3000352
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3000324
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 38 files compared)
  • Checked 165 log files, 37 edm output root files, 39 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Aug 24, 2021

+1

@Dr15Jones
Copy link
Contributor

It looks like this broke one of the unit tests: test TestIntegrationParameterSet had ERRORS

cmsRun runAutoGeneratedCfi_cfg.py ------------------------------------------------------------
----- Begin Fatal Exception 24-Aug-2021 17:16:37 CEST-----------------------
An exception of category 'ConfigFileReadError' occurred while
   [0] Processing the python configuration file named /data/cmsbld/jenkins/workspace/ib-run-qa/CMSSW_12_1_X_2021-08-24-0900/src/FWCore/Integration/test/runAutoGeneratedCfi_cfg.py
Exception Message:
 unknown python problem occurred.
RuntimeError: An exception of category 'Configuration' occurred.
Exception Message:
EntryError can not convert representation of doublev1: 2.225073858507201e-308 to value of type double 


At:
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Types.py(285): insertInto
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Mixins.py(377): insertContentsInto
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Mixins.py(512): insertInto
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Modules.py(161): insertInto
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Config.py(1104): _insertManyInto
  /cvmfs/cms-ib.cern.ch/nweek-02695/slc7_amd64_gcc900/cms/cmssw/CMSSW_12_1_X_2021-08-24-0900/python/FWCore/ParameterSet/Config.py(1319): fillProcessDesc
  <string>(2): <module>

----- End Fatal Exception -------------------------------------------------
Failure cmsRun runAutoGeneratedCfi_cfg.py: status 90

@makortel
Copy link
Contributor

makortel commented Aug 24, 2021

The value 2.225073858507201e-308 is tiny bit less than the smallest positive normal double 2.2250738585072014e-308 (from Wikipedia), and apparently std::stod makes that an error, while boost::lexical_cast happily results denormals or rounds to zero for numbers smaller than the smallest denormal.

Appears like a known annoyance with std::stod, see e.g. https://stackoverflow.com/questions/19626246/parse-and-convert-denorm-numbers.

I'd be inclined to revert back to boost::lexical_cast for that one, but am open for better suggestions. (gcc appears to implement std::from_chars() only in 11)

@makortel
Copy link
Contributor

@Purva-Chaudhari Would you be able to change FWCore/ParameterSet/src/types.cc back?

@Dr15Jones
Copy link
Contributor

@makortel I'm in the process of trying to see if I can find a better solution.

@Dr15Jones
Copy link
Contributor

see ##34999

@Purva-Chaudhari
Copy link
Contributor Author

Purva-Chaudhari commented Aug 25, 2021

Thanks @Dr15Jones for the improvements

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

5 participants