cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.09k stars 4.33k forks source link

Avoid allocations in ParentageID #46729

Open Dr15Jones opened 3 days ago

Dr15Jones commented 3 days ago

PR description:

We were cycling memory each time a module put a data product into the event. This now has the ParentageID hold the 16 bytes directly instead of indirectly via a std::string.

PR validation:

All framework unit tests pass.

cmsbuild commented 3 days ago

cms-bot internal usage

Dr15Jones commented 3 days ago

please test

cmsbuild commented 3 days ago

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46729/42699

cmsbuild commented 3 days ago

A new Pull Request was created by @Dr15Jones for master.

It involves the following packages:

@Dr15Jones, @makortel, @smuzaffar can you please review it and eventually sign? Thanks. @makortel, @missirol, @mmusich, @rovere, @wddgit this is something you requested to watch as well. @antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

cmsbuild commented 3 days ago

+1

Size: This PR adds an extra 28KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e78c2f/42939/summary.html COMMIT: 159a737baffe3128200aee44fc6ff61ba1f7cba2 CMSSW: CMSSW_14_2_X_2024-11-18-1100/el8_amd64_gcc12 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/46729/42939/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e78c2f/42939/git-recent-commits.json https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e78c2f/42939/git-merge-result

Comparison Summary

Summary:

Dr15Jones commented 2 days ago

One question is should https://github.com/cms-sw/cmssw/blob/f47281314cbae103289999806846b692264a09a4/DataFormats/Provenance/src/ProductProvenanceLookup.cc#L42-L57

be changed to deal with the fact that we do not need to do a move anymore?

makortel commented 2 days ago

One question is should ... be changed to deal with the fact that we do not need to do a move anymore?

We agreed that it should be changed.

makortel commented 2 days ago

The full build log shows

>> Building shared library tmp/el8_amd64_gcc12/src/DataFormats/Provenance/src/DataFormatsProvenance/libDataFormatsProvenance.so
...
In member function 'deallocate',
    inlined from 'deallocate' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/allocator.h:200:35,
    inlined from 'deallocate' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/alloc_traits.h:496:23,
    inlined from '_M_destroy' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:300:34,
    inlined from '_M_dispose' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:294:14,
    inlined from '_M_dispose' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:291:7,
    inlined from '__dt_base ' at /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:803:19,
    inlined from 'compactForm_' at src/DataFormats/Provenance/src/Hash.cc:25:5:
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02864/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/new_allocator.h:158:33: warning: 'operator delete' called on unallocated object 'temp' [-Wfree-nonheap-object]
  158 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                 ^
src/DataFormats/Provenance/src/Hash.cc: In function 'compactForm_':
src/DataFormats/Provenance/src/Hash.cc:22:18: note: declared here
   22 |       value_type temp(hash);
      |                  ^

which seems to be coming from LTO, but from code not touched by this PR. With @Dr15Jones we have no clue what could be causing the warning.

@smuzaffar Is this warning not being flagged in the PR test summary because the Hash.cc was not touched by this PR?

I also noticed this warning was shown a second time later in the build log for the same shared library (including the same Building shared library line). @smuzaffar Do you know why that happens?

Dr15Jones commented 2 days ago

please test

smuzaffar commented 2 days ago

@makortel , we only report warnings which comes directory from cmssw files e.g. warnings which match cmssw/file/path:[0-9]+:[0-9]+: warning: .... . As this warning is coming from compiler header that is why bot is not going to report it. Also warning coming from cmssw files which are not directly or indirectly touched by PR are not reported by bot

cmsbuild commented 2 days ago

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46729/42705

cmsbuild commented 2 days ago

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

cmsbuild commented 2 days ago

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46729/42711

cmsbuild commented 2 days ago

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

Dr15Jones commented 2 days ago

please test

Dr15Jones commented 2 days ago

please test

cmsbuild commented 2 days ago

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46729/42712

cmsbuild commented 2 days ago

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

cmsbuild commented 2 days ago

+1

Size: This PR adds an extra 36KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e78c2f/42962/summary.html COMMIT: 3b53b20f6e96f71d6cc2613c133655fb0ac37ae6 CMSSW: CMSSW_14_2_X_2024-11-19-1100/el8_amd64_gcc12 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/46729/42962/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

makortel commented 1 day ago

Comparison differences are related to https://github.com/cms-sw/cmssw/issues/39803 and https://github.com/cms-sw/cmssw/issues/46416.

makortel commented 1 day ago

Number of allocations in workflow 12834.0 step 3 decreased by 72115, or ~7200/event.

makortel commented 14 hours ago

test parameters:

makortel commented 14 hours ago

@cmsbuild, please test

Just to check what happens in the "HLT in 12_4_X / 13_0_X" tests (while waiting for 15_0_X to open)

cmsbuild commented 7 hours ago

+1

Size: This PR adds an extra 12KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e78c2f/42994/summary.html COMMIT: 3b53b20f6e96f71d6cc2613c133655fb0ac37ae6 CMSSW: CMSSW_14_2_X_2024-11-21-1100/el8_amd64_gcc12 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/46729/42994/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary: