-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[LLVM Analyzer][DQM] Fix dead assignments #46247
base: master
Are you sure you want to change the base?
Conversation
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46247/42071 |
A new Pull Request was created by @iarspider for master. It involves the following packages:
@antoniovagnerini, @atpathak, @cmsbuild, @consuegs, @francescobrivio, @nothingface0, @perrotta, @rvenditti, @syuvivida, @tjavaid can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@@ -340,7 +340,6 @@ void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) { | |||
float photon_eta = -9.0; | |||
float photon_phi = -9.0; | |||
bool photon_passPhotonID = false; | |||
bool found_lead_pho = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1138,6 +1138,7 @@ void SiPixelDigiSource::buildStructure(const edm::EventSetup& iSetup) { | |||
uint32_t id = detId(); | |||
SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows); | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
MonitorElement* NumberOfMatches; | ||
MonitorElement* NumberOfEvents; | ||
|
||
//dummy = iBooker.bookFloat("dummy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, bookFloat
doesn't have any side-effects, so the result of all these calls is unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iarspider , looks like bookFloat
calls bookME which has some side-effects on the store. So may be we need these bookFloat
calls ... @cms-sw/dqm-l2 should know better though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iarspider , looks like
bookFloat
calls bookME which has some side-effects on the store. So may be we need thesebookFloat
calls ... @cms-sw/dqm-l2 should know better though
Not in this case, I think. The onbooking
function defaults to NOOP
("functor to be passed as a default argument that does not do anything."), and the makeobject
function that is passed to bookME explicitly returns nullptr. But I agree that DQM L2s should know better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello. From my limited understanding, all the bookX
methods create instances of MonitorElements
inside the DQMStore
, and do indeed update the store's state (by updating globalMEs_
, localMEs_
).
I can see, also, that those MonitorElement
pointers are being overwritten later in the code (e.g. here, for RECO_deltaPhi_DiJet
), but this is not a guarantee (I think) that those specific MEs which have been booked won't be used later.
If those specific MEs (e.g., RECO_deltaEta_DiJet
, RECO_deltaPhi_DiJet
) are indeed unused later in this module, booking them doesn't make any sense in the first place, right? In this case, I think it would be safe to remove the bookFloat
calls, else, I would expect something to probably break later in the module.
Take this with a grain of salt, as I've by no means looked at the DQM code extensively, yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would help if we had an example python config that uses this module, so that we can test its output and verify that those MonitorElement
s are, indeed, booked and left empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one, but it's outdated
@@ -62,25 +62,25 @@ class DQMStoreStatsSubfolder { | |||
++totalHistos_; | |||
totalBins_ += nBins; | |||
totalEmptyBins_ += nEmptyBins; | |||
totalMemory_ += (nBins *= sizeof(float)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nBins is passed by value, makes no sense to modify it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
please test |
-1 Failed Tests: Build ClangBuild BuildI found compilation warning when building: See details on the summary page. Clang BuildI found compilation warning while trying to compile with clang. Command used:
See details on the summary page. |
0f39692
to
06746e0
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46247/42319
|
Pull request #46247 was updated. @antoniovagnerini, @atpathak, @consuegs, @francescobrivio, @nothingface0, @perrotta, @rvenditti, @syuvivida, @tjavaid can you please check and sign again. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46247/42321
|
Pull request #46247 was updated. @antoniovagnerini, @atpathak, @cmsbuild, @consuegs, @francescobrivio, @nothingface0, @perrotta, @rvenditti, @syuvivida, @tjavaid can you please check and sign again. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46247/42324
|
Pull request #46247 was updated. @antoniovagnerini, @atpathak, @cmsbuild, @consuegs, @francescobrivio, @nothingface0, @perrotta, @rvenditti, @syuvivida, @tjavaid can you please check and sign again. |
Milestone for this pull request has been moved to CMSSW_15_0_X. Please open a backport if it should also go in to CMSSW_14_2_X. |
PR description:
This fixes clang-analyzer warnings https://cmssdt.cern.ch/SDT/jenkins-artifacts/ib-static-analysis/CMSSW_14_2_X_2024-09-29-0000/el8_amd64_gcc12/llvm-analysis/index.html
PR validation:
Bot tests