Skip to content

Move MultiVectorManager to DataFormats/Common and address discussion from #48826 and rename it to MultiSpan#48857

Merged
cmsbuild merged 11 commits intocms-sw:masterfrom
Electricks94:MultiVectorManager
Sep 30, 2025
Merged

Move MultiVectorManager to DataFormats/Common and address discussion from #48826 and rename it to MultiSpan#48857
cmsbuild merged 11 commits intocms-sw:masterfrom
Electricks94:MultiVectorManager

Conversation

@Electricks94
Copy link
Copy Markdown
Contributor

This PR moves the MultiVectorManager to DataFormats/Common and addresses the following issues that come from a discussion in #48826

  1. Rename to MultiSpan and move to edm namespace
  2. Rename addVector method to add
  3. Ensure const-correctness
  4. Implementation of Random Access Iterator that respects const-correctness
  5. Apply cms naming convention
  6. Implementation of a test case
  7. Add documentation

FYI @felicepantaleo @waredjeb

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 5, 2025

cms-bot internal usage

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 5, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46005

ERROR: Build errors found during clang-tidy run.

src/RecoLocalCalo/HGCalRecProducers/plugins/RecHitMapProducer.cc:81:14: error: no member named 'addV' in 'edm::MultiSpan<HGCRecHit>'; did you mean 'add'? [clang-diagnostic-error]
   81 |   rechitSpan.addV(*bh_hits);
      |              ^~~~
      |              add
--
src/DataFormats/Common/interface/MultiSpan.h:113:10: error: no template named 'vector' in namespace 'std' [clang-diagnostic-error]
  113 |     std::vector<std::span<const T>> spans_;
      |     ~~~~~^
src/DataFormats/Common/interface/MultiSpan.h:114:10: error: no template named 'vector' in namespace 'std' [clang-diagnostic-error]
  114 |     std::vector<std::size_t> offsets_;
      |     ~~~~~^
Suppressed 2094 warnings (2087 in non-user code, 7 NOLINT).
--
src/DataFormats/Common/interface/MultiSpan.h:113:10: error: no template named 'vector' in namespace 'std' [clang-diagnostic-error]
  113 |     std::vector<std::span<const T>> spans_;
      |     ~~~~~^
src/DataFormats/Common/interface/MultiSpan.h:114:10: error: no template named 'vector' in namespace 'std' [clang-diagnostic-error]
  114 |     std::vector<std::size_t> offsets_;
      |     ~~~~~^
Suppressed 2352 warnings (2345 in non-user code, 7 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 6, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46006

ERROR: Build errors found during clang-tidy run.

src/RecoHGCal/TICL/plugins/TICLCandidateProducer.cc:281:52: error: no member named 'getGlobalIndex' in 'edm::MultiSpan<ticl::Trackster>'; did you mean 'globalIndex'? [clang-diagnostic-error]
  281 |         links_vector[k] = generalTrackstersManager.getGlobalIndex(i, (*general_tracksterlinks_h[i])[j][k]);
      |                                                    ^~~~~~~~~~~~~~
      |                                                    globalIndex
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 6, 2025

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46007

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 6, 2025

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

It involves the following packages:

  • DataFormats/Common (core)
  • DataFormats/HGCalReco (reconstruction, upgrade)
  • RecoHGCal/TICL (reconstruction, upgrade)
  • RecoLocalCalo/HGCalRecAlgos (reconstruction, upgrade)
  • RecoLocalCalo/HGCalRecProducers (reconstruction, upgrade)
  • SimCalorimetry/HGCalAssociatorProducers (upgrade, simulation)
  • Validation/HGCalValidation (dqm)

@Dr15Jones, @Moanwar, @antoniovagnerini, @civanch, @cmsbuild, @ctarricone, @jfernan2, @kpedro88, @makortel, @mandrenguyen, @mdhildreth, @rseidita, @smuzaffar, @srimanob, @subirsarkar can you please review it and eventually sign? Thanks.
@IzaakWN, @ReyerBand, @apsallid, @argiro, @bsunanda, @cseez, @denizsun, @edjtscott, @felicepantaleo, @forthommel, @hatakeyamak, @lecriste, @lgray, @makortel, @missirol, @mmusich, @pfs, @rchatter, @rovere, @salimcerci, @sameasy, @sethzenz, @sobhatta, @thomreis, @vandreev11, @wang0jin, @wddgit, @youyingli this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@jfernan2
Copy link
Copy Markdown
Contributor

jfernan2 commented Sep 7, 2025

please test

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented Sep 7, 2025

-1

Failed Tests: Build
Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-908d44/47997/summary.html
COMMIT: 740ac52
CMSSW: CMSSW_15_1_X_2025-09-07-0000/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48857/47997/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation error when building:

/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/bin/../lib/gcc/x86_64-redhat-linux-gnu/12.3.1/../../../../x86_64-redhat-linux-gnu/bin/ld.bfd: tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testDataFormatsCommonCatch2/test_catch2_MultiSpan.cpp.o (symbol from plugin): in function `Catch::NonCopyable::~NonCopyable()':
(.text+0x0): multiple definition of `non-virtual thunk to Catch::Matchers::StdString::RegexMatcher::match(std::__cxx11::basic_string, std::allocator > const&) const'; tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testDataFormatsCommonCatch2/test_catch2_DetSetVector.cpp.o (symbol from plugin):(.text+0x0): first defined here
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_vector.h:423:11: note: type 'struct vector' defined in anonymous namespace cannot match across the translation unit boundary
  423 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^
collect2: error: ld returned 1 exit status
>> Deleted: tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testDataFormatsCommonCatch2/testDataFormatsCommonCatch2
gmake: *** [tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testDataFormatsCommonCatch2/testDataFormatsCommonCatch2] Error 1
>> Compiling  src/DataFormats/Common/test/testMultiAssociation.cc
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/bin/c++ -c -DCMS_MICRO_ARCH='x86-64-v3' -DGNU_GCC -D_GNU_SOURCE -DTBB_USE_GLIBCXX_VERSION=120301 -DTBB_SUPPRESS_DEPRECATED_MESSAGES -DTBB_PREVIEW_RESUMABLE_TASKS=1 -DTBB_PREVIEW_TASK_GROUP_EXTENSIONS=1 -DBOOST_SPIRIT_THREADSAFE -DPHOENIX_THREADSAFE -DBOOST_MATH_DISABLE_STD_FPCLASSIFY -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX -DBOOST_MPL_IGNORE_PARENTHESES_WARNING -DCMSSW_GIT_HASH='CMSSW_15_1_X_2025-09-07-0000' -DPROJECT_NAME='CMSSW' -DPROJECT_VERSION='CMSSW_15_1_X_2025-09-07-0000' -Isrc -Ipoison -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/cms/cmssw/CMSSW_15_1_X_2025-09-07-0000/src -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/pcre/8.43-2d141998cfe5424b8f7aff48035cc2da/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/boost/1.80.0-8c971e6145f39749ff76f283f7f28020/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/bz2lib/1.0.6-d065ccd79984efc6d4660f410e4c81de/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/cppunit/1.15.x-25a760f1303b0fca73df75b14e1358bc/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/libuuid/2.34-27ce4c3579b5b1de2808ea9c4cd8ed29/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/lcg/root/6.32.13-bf6487172b8cd8241efe6f282e9a52bd/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/tbb/v2022.0.0-f3c1735318cc8b1e5832af7351f53f14/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/xz/5.2.5-6f3f49b07db84e10c9be594a1176c114/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/zlib/1.2.13-d217cdbdd8d586e845e05946de2796be/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/fmt/10.2.1-e35fd1db5eb3abc8ac0452e8ee427196/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/md5/1.0.0-5b594b264e04ae51e893b1d69a797ec6/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02906/el8_amd64_gcc12/external/tinyxml2/6.2.0-a0ad3950415fa3138d99b7da42eb4c9f/include -O3 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++20 -ftree-vectorize -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -march=x86-64-v3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-unused-parameter -Wunused -Wparentheses -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto=auto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -fPIC -MMD -MF tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testMultiAssociation/testMultiAssociation.cc.d src/DataFormats/Common/test/testMultiAssociation.cc -o tmp/el8_amd64_gcc12/src/DataFormats/Common/test/testMultiAssociation/testMultiAssociation.cc.o
>> Compiling  src/DataFormats/Common/test/testRunner.cpp


@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46210

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46211

@cmsbuild
Copy link
Copy Markdown
Contributor

Pull request #48857 was updated. @Dr15Jones, @civanch, @cmsbuild, @kpedro88, @makortel, @mdhildreth, @smuzaffar can you please check and sign again.

@makortel
Copy link
Copy Markdown
Contributor

@cmsbuild, please test

@makortel
Copy link
Copy Markdown
Contributor

(the empty spans could probably be ignored in MultiSpan::add() after which they wouldn't impact the binary search time complexity)

@Electricks94
Copy link
Copy Markdown
Contributor Author

Good point, I excluded empty spans from the add function now

@cmsbuild
Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48857/46228

@cmsbuild
Copy link
Copy Markdown
Contributor

Pull request #48857 was updated. @Dr15Jones, @civanch, @cmsbuild, @kpedro88, @makortel, @mdhildreth, @smuzaffar can you please check and sign again.

@makortel
Copy link
Copy Markdown
Contributor

@cmsbuild, please test

@cmsbuild
Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 28KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-908d44/48349/summary.html
COMMIT: 8ad3881
CMSSW: CMSSW_16_0_X_2025-09-29-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48857/48349/install.sh to create a dev area with all the needed externals and cmssw changes.

  • DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • You potentially removed 2 lines from the logs
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3922620
  • DQMHistoTests: Total failures: 44
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3922556
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 218 log files, 188 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Copy Markdown
Contributor

Comparison differences are related to #47071

@civanch
Copy link
Copy Markdown
Contributor

civanch commented Sep 29, 2025

+1

@makortel
Copy link
Copy Markdown
Contributor

+core

@cmsbuild
Copy link
Copy Markdown
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. @mandrenguyen, @sextonkennedy, @ftenchini (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Copy Markdown
Contributor

+1

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.

8 participants