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

[RECONSTRUCTION] [CLANG] Fix warnings reported by clang-16 #41616

Merged
merged 3 commits into from
May 26, 2023

Conversation

aandvalenzuela
Copy link
Contributor

Hello,

This PR fixes set but unused warnings, unqualified calls and floating point comparisons from clang-16 in CLANG IBs.

Some reconstruction modules are also reporting warnings on loop not vectorized. For example, for RecoTracker/MkFitCore:

>> Compiling  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/radix_sort.cc
/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/llvm/16.0.3-5d1904f3c7b5c53b7522ba0858baec44/bin/clang++ -c -DGNU_GCC -D_GNU_SOURCE -DTBB_USE_GLIBCXX_VERSION=110201 -DTBB_SUPPRESS_DEPRECATED_MESSAGES -DTBB_PREVIEW_RESUMABLE_TASKS=1 -DTBB_PREVIEW_TASK_GROUP_EXTENSIONS=1 -DCMSSW_GIT_HASH='CMSSW_13_2_CLANG_X_2023-05-09-2300' -DPROJECT_NAME='CMSSW' -DPROJECT_VERSION='CMSSW_13_2_CLANG_X_2023-05-09-2300' -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/pcre/8.43-5dcc901acc02f624b22dd9840b2357e8/include -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/bz2lib/1.0.6-2c1f18484cb66c30aba7929f2be5e7d4/include -isystem/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/lcg/root/6.26.11-9720c7273eac1c892ddadde973cf1965/include -isystem/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/tbb/v2021.8.0-4e779f195a25a0aba119b27519937ba0/include -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/xz/5.2.5-83d0a00b575efd1701e07bedf7977343/include -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/zlib/1.2.11-3dfb2715f3608466b74431b80eb9d788/include -I/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/json/3.10.2-a6d86565b09ec3d0e02bf7b52c31bbfc/include -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++17 -ftree-vectorize -Werror=array-bounds -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -fuse-ld=bfd -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -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=reorder -Werror=unused-variable -Werror=conversion-null -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-c99-extensions -Wno-c++11-narrowing -D__STRICT_ANSI__ -Wno-unused-private-field -Wno-unknown-pragmas -Wno-unused-command-line-argument -Wno-unknown-warning-option -ftemplate-depth=512 -Wno-error=potentially-evaluated-expression -Wno-tautological-type-limit-compare -fsized-deallocation --gcc-toolchain=/pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/el8_amd64_gcc11/external/gcc/11.2.1-f9b9dfdd886f71cd63f5538223d8f161 -Ofast -fno-reciprocal-math -mrecip=none -DBOOST_DISABLE_ASSERTS -fopenmp-simd  -fPIC    -MMD -MF tmp/el8_amd64_gcc11/src/RecoTracker/MkFitCore/src/RecoTrackerMkFitCore/radix_sort.cc.d /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/radix_sort.cc -o tmp/el8_amd64_gcc11/src/RecoTracker/MkFitCore/src/RecoTrackerMkFitCore/radix_sort.cc.o
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/PropagationMPlex.cc:290:8: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   void helixAtRFromIterativeCCSFullJac(const MPlexLV& inPar,
       ^
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:248:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   void MkFinder::selectHitIndices(const LayerOfHits &layer_of_hits, const int N_proc) {
                 ^
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:248:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:693:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   void MkFinder::addBestHit(const LayerOfHits &layer_of_hits, const int N_proc, const FindingFoos &fnd_foos) {
                 ^
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:905:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   void MkFinder::findCandidates(const LayerOfHits &layer_of_hits,
                 ^
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:1151:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
   void MkFinder::findCandidatesCloneEngine(const LayerOfHits &layer_of_hits,
                 ^
  /pool/condor/dir_43945/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/189e8911dd83c5e66aafe1fe240371ea/opt/cmssw/el8_amd64_gcc11/cms/cmssw/CMSSW_13_2_CLANG_X_2023-05-09-2300/src/RecoTracker/MkFitCore/src/MkFinder.cc:1151:18: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
 1 warning generated.
6 warnings generated.

I have seen in older PRs that sometimes this has been fixed by using a pragma statement, others inlining the function (which I believe it won't work here, but correct me if I am wrong) and in other cases the original authors took care of rearranging the code. Any hints on what can we do in those cases?

Many thanks! :)
Andrea.

@aandvalenzuela
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41616/35506

  • This PR adds an extra 76KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @aandvalenzuela (Andrea Valenzuela) for master.

It involves the following packages:

  • MagneticField/Interpolation (reconstruction)
  • RecoEcal/EgammaClusterProducers (reconstruction)
  • RecoEgamma/EgammaElectronAlgos (reconstruction)
  • RecoEgamma/PhotonIdentification (reconstruction)
  • RecoLocalTracker/SiPixelClusterizer (reconstruction)
  • RecoMuon/MuonIdentification (reconstruction)
  • RecoTracker/DisplacedRegionalTracking (reconstruction)

@mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks.
@VourMa, @felicepantaleo, @jainshilpi, @abbiendi, @CeliaFernandez, @argiro, @a-kapoor, @thomreis, @Prasant1993, @threus, @varuns23, @cericeci, @andrea21z, @JanFSchulte, @jhgoh, @lgray, @missirol, @sobhatta, @ferencek, @trocino, @rociovilar, @Sam-Harper, @wang0jin, @GiacomoSguazzoni, @rovere, @VinInn, @mroguljic, @bellan, @mmusich, @ram1123, @mtosi, @dgulhan, @namapane, @HuguesBrun, @rchatter, @valsdav, @Fedespring, @dkotlins, @afiqaize, @gpetruc, @wrtabb, @sameasy, @tvami 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

@cmsbuild
Copy link
Contributor

-1

Failed Tests: ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-348aff/32543/summary.html
COMMIT: 2893e98
CMSSW: CMSSW_13_2_X_2023-05-10-1200/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/41616/32543/install.sh to create a dev area with all the needed externals and cmssw changes.

Clang Build

I found compilation warning while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' scram build -k -j 32 COMPILER='llvm compile'

See details on the summary page.

@aandvalenzuela
Copy link
Contributor Author

please test

@slava77
Copy link
Contributor

slava77 commented May 10, 2023

about (lack of) vectorization warnings in mkfit
@osschar @dan131riley @gartung @srlantz

@slava77
Copy link
Contributor

slava77 commented May 10, 2023

Some reconstruction modules are also reporting warnings on loop not vectorized. For example, for RecoTracker/MkFitCore:

can this be moved to a separate issue? This PR doesn't touch mkFit.

@aandvalenzuela
Copy link
Contributor Author

Yes @slava77, sure! It was just to gather some prior feedback, I will open a separate issue

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41616/35507

  • This PR adds an extra 76KB to repository

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41616/35610

  • This PR adds an extra 76KB to repository

@aandvalenzuela
Copy link
Contributor Author

please test

  • Thanks @perrotta, I have removed the comment on line 300 as suggested and commented out the definitions of muonRefVtx and cosmicRefVtx. I have not removed the definitions since they are used in the commented-out code that you also mentioned. I will wait for @cms-sw/muon-pog-l2 to remove the definitions so that the comments make sense if we finally leave them as they are :)

@cmsbuild
Copy link
Contributor

Pull request #41616 was updated. @mandrenguyen, @clacaputo can you please check and sign again.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-348aff/32746/summary.html
COMMIT: 008f3f8
CMSSW: CMSSW_13_2_X_2023-05-22-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/41616/32746/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 15 lines from the logs
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3221591
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3221566
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@smuzaffar
Copy link
Contributor

@cms-sw/reconstruction-l2 , can you please review this?

@perrotta
Copy link
Contributor

@cms-sw/reconstruction-l2 , since nothing was removed and everything commented out I think that a formal approval from muon POG is not required any more. If they want to clean up their code further, it can be done in a follow up PR

@mandrenguyen
Copy link
Contributor

+1
resign

@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)

@perrotta
Copy link
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.

7 participants