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

Code-cleanup of RPC-DQM #33854

Merged
merged 10 commits into from May 31, 2021
Merged

Code-cleanup of RPC-DQM #33854

merged 10 commits into from May 31, 2021

Conversation

jhgoh
Copy link
Contributor

@jhgoh jhgoh commented May 26, 2021

PR description:

This PR updates current RPC DQM codes to have better code structure and modernize C++ syntax.
We'd like to have some advantage for the possible new developments.
The amount of code change in this PR is big, but they are technical ones - we don't expect any change in the output.

1. Better helper class design for the chamber naming, histogram decoration.
There is a class 'RPCGeomServ' which is widely used to map RPCDetId to the RPC nomenclature such as RB#in/out_W#_S##_B/F/M etc. This class stores flags as private member variables during some function calls, therefore developers could not declare it as const object.
There is another object rpcdqm::utils mainly used to set the axis labels. (and the name of the class is too generic).

We add a lightweight interface, RPCNameHelper, RPCSummaryMapHisto and RPCRollMapHisto, hopefully replace RPCGeomServ and rpcdqm::utils.
For the smooth and transparent migration (+ there are some items still to go), existing classes are kept for now.

2. Migration to fmt::format()
std::stringstream have been massively used in the RPC DQM modules.
Existing code works without any problem, but fmt::format gives better readability (and known to have a better performance).

3. Separating library and plugins
Some classes are used across the DQM/RPCMonitorDigi and DQM/RPCMonitorClient plugin modules.
In addition, RPC DPG analyzers uses features in the rpcdqm::utils (which hopefully to be replaced by RPCRollMapHisto class) in their modules.
These common features are factored out and moved to the DQM/RPCMonitorClient/src. The plugin modules are moved to the plugins directory.

4. Code cleanup
Cleaned up unnecessary includes, simplify for-loops, etc.

5. Fix potential memory allocation problem in the RPCDqmClient module
This module registers 'client modules' by appending pointer to the dynamically allocated objects but it is not deleted anywhere. We use smart pointers to be properly cleaned up at the termination.

We haven't observe any serious memory leak before this fix, because the new allocations happens only for the initialization step.

PR validation:

Tested runTheMatrix.py command and passes the tests.

Related presentation in 2020 Oct: slide

  • There are other items such as plot removal or unused modules, they will be followed after this PR for the technical updates.
  • The code in this PR is not identical to the one shown in the presentation slide.

Related issue #33761 : please consider this PR as the first step to cleanup of unused modules, although any modules are not removed (yet).

@mileva @andresib

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33854/22878

  • This PR adds an extra 116KB to repository

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

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33854/22879

  • This PR adds an extra 124KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @jhgoh (Junghwan John Goh) for master.

It involves the following packages:

DQM/RPCMonitorClient
DQM/RPCMonitorDigi

@andrius-k, @kmaeshima, @ErnestaP, @ahmad3213, @cmsbuild, @jfernan2, @rvenditti can you please review it and eventually sign? Thanks.
@acimmino this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@jfernan2
Copy link
Contributor

please test

@jfernan2
Copy link
Contributor

Thanks @jhgoh !!

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-59d35f/15336/summary.html
COMMIT: dcab5a3
CMSSW: CMSSW_12_0_X_2021-05-26-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33854/15336/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation warning when building: See details on the summary page.

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.

@jhgoh
Copy link
Contributor Author

jhgoh commented May 29, 2021

@jfernan2 thank you for checks.
There was bug in histogram naming, but also in the bin labelling. Fix done.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33854/22935

  • This PR adds an extra 164KB to repository

@cmsbuild
Copy link
Contributor

Pull request #33854 was updated. @andrius-k, @kmaeshima, @ErnestaP, @ahmad3213, @cmsbuild, @jfernan2, @rvenditti can you please check and sign again.

@jfernan2
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-59d35f/15405/summary.html
COMMIT: 5c436a7
CMSSW: CMSSW_12_0_X_2021-05-28-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33854/15405/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: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2650486
  • DQMHistoTests: Total failures: 40
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2650424
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 30.375 KiB( 36 files compared)
  • DQMHistoSizes: changed ( 1000.0,... ): 0.562 KiB RPC/Muon
  • DQMHistoSizes: changed ( 1000.0,... ): 0.562 KiB RPC/AllHits
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: no differences found

@jfernan2
Copy link
Contributor

+1

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

@qliphy
Copy link
Contributor

qliphy commented May 31, 2021

+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.

None yet

4 participants