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

Use fp_traits_non_native directly in eos-portable-archive #40057

Merged
merged 1 commit into from Nov 28, 2022

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Nov 14, 2022

In the eos-portable-archive sources that were copy-pasted into CondFormats/Serialization, the boost implementation detail fp_traits<T>::value is used, which is expected to resolve to fp_traits_non_native that has the bits and set_bits attributes, which are used in the code.

But depending on the compiler flags, fp_traits<T>::value can also resolve to fp_traits_native, which doesn't have bits and set_bits. It only works when BOOST_MATH_DISABLE_STD_FPCLASSIFY is set.

To make the CMSSW code compile independent of the boost flags, this commit suggests to directly use fp_traits_non_native in exactly the same way as it is used inside fp_traits in the
boost/math/special_functions/detail/fp_traits.hpp header file from boost:

https://github.com/boostorg/math/blob/master/include/boost/math/special_functions/detail/fp_traits.hpp#L570

This PR is part of my ongoing effort of making CMSSW compile on other platforms more easily.

See also:
daldegam/eos-portable-archive#5

In the eos-portable-archive sources that were copy-pasted into
`CondFormats/Serialization`, the boost implementation detail
`fp_traits<T>::value` is used, which is expected to resolve to
`fp_traits_non_native` that has the `bits` and `set_bits` attributes,
which are used in the code.

But depending on the compiler flags, `fp_traits<T>::value` can also
resolve to `fp_traits_native`, which doesn't have `bits` and `set_bits`.
It only works when `BOOST_MATH_DISABLE_STD_FPCLASSIFY` is set.

To make the CMSSW code compile independent of the boost flags, this
commit suggests to directly use `fp_traits_non_native` in exactly the
same way as it is used inside `fp_traits` in the
`boost/math/special_functions/detail/fp_traits.hpp` header file from
boost.

See also:
daldegam/eos-portable-archive#5
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40057/33032

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @guitargeek (Jonas Rembser) for master.

It involves the following packages:

  • CondFormats/Serialization (db)

@malbouis, @cmsbuild, @saumyaphor4252, @ggovi, @francescobrivio, @tvami can you please review it and eventually sign? Thanks.
@mmusich, @seemasharmafnal this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

* integral type that was stored in the stream. Francois Mauger provided
* standardized behaviour for special values like inf and NaN, that need to
* be serialized in his application.
*
* \note by Johan Rade (author of the floating point utilities library):
* Be warned that the math::detail::fp_traits<T>::type::get_bits() function
* Be warned that the math::detail::fp_traits_non_native<T,U>::get_bits() function
Copy link
Contributor

Choose a reason for hiding this comment

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

hi @guitargeek is this comment still true with fp_traits_non_native ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, yes, because before fp_traits<T> was resolving to fp_traits_non_native::type anyway, so is must come from there (fp_traits_non_native is the only fp_traits implementation that has a get_bits member, fp_traits_native doesn't have it)

@tvami
Copy link
Contributor

tvami commented Nov 15, 2022

@cmsbuild , please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a474d1/29021/summary.html
COMMIT: 8c9d152
CMSSW: CMSSW_12_6_X_2022-11-15-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/40057/29021/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3417074
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3417052
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 206 log files, 48 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@tvami
Copy link
Contributor

tvami commented Nov 16, 2022

OK, if I understand correctly the unit tests
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a474d1/29021/unitTests/success.html
did test this change. Is that right @ggovi ?

@guitargeek
Copy link
Contributor Author

Good question, I'm not sure which tests cover this change. I just did whatever was necessary to make the code compile without the BOOST_MATH_DISABLE_STD_FPCLASSIFY flag.

@guitargeek
Copy link
Contributor Author

Hi @ggovi! Can you please make a statement? It would be nice to merge this PR at some point to make the CMSSW code more portable.

@cmsbuild cmsbuild modified the milestones: CMSSW_12_6_X, CMSSW_13_0_X Nov 24, 2022
@tvami
Copy link
Contributor

tvami commented Nov 28, 2022

+db

  • it's been two weeks since this PR got opened, would have been nice to have @ggovi 's comment but we should also converge

@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, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@rappoccio
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 992df75 into cms-sw:master Nov 28, 2022
@ggovi
Copy link
Contributor

ggovi commented Dec 2, 2022

Hello, my understanding is that the unit tests listed above should involve the change, in particular

https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a474d1/29021/unitTests/src/CondCore/CondDB/test/condTestRegression/testing.log

So, it looks ok with me.

@guitargeek guitargeek deleted the serialization_1 branch December 2, 2022 07:49
@guitargeek
Copy link
Contributor Author

Thank you!

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