Skip to content

Conversation

@Dr15Jones
Copy link
Contributor

@Dr15Jones Dr15Jones commented Jan 14, 2026

PR description:

  • switched to std::ranges::iota for loops needing indicies
  • use std::view for case where makes simpler
    Not a comprehensive change, just an experiment.

PR validation:

Purely technical change. Framework unit tests pass.

resolves cms-sw/framework-team#1788

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 14, 2026

cms-bot internal usage

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49841/47492

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

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • FWCore/Framework (core)

@Dr15Jones, @cmsbuild, @makortel, @smuzaffar can you please review it and eventually sign? Thanks.
@makortel, @wddgit 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

@Dr15Jones
Copy link
Contributor Author

please test

auto guard = makeGuard([this]() { actReg_->postPrincipalsCreationSignal_.emit(); });
principalCache_.setNumberOfConcurrentPrincipals(preallocations_);
for (unsigned int index = 0; index < preallocations_.numberOfStreams(); ++index) {
for (auto index : std::views::iota(0UL, preallocations_.numberOfStreams())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numberOfStreams returns unsigned int, so how about

Suggested change
for (auto index : std::views::iota(0UL, preallocations_.numberOfStreams())) {
for (auto index : std::views::iota(0U, preallocations_.numberOfStreams())) {

?

Comment on lines +113 to +114
for (auto const& modLabel : tmp) {
modulesOnPaths.insert(modLabel);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would

Suggested change
for (auto const& modLabel : tmp) {
modulesOnPaths.insert(modLabel);
modulesOnPaths.insert(std::ranges::begin(tmp), std::ranges::end(tmp));

work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't compile. the types returned by std::ranges::begin and std::ranges::end do not identical.

- switched to std::ranges::iota for loops needing indicies
- use std::view for case where makes simpler
@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 52KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cf3657/50638/summary.html
COMMIT: b595bc7
CMSSW: CMSSW_16_1_X_2026-01-14-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/49841/50638/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-cf3657/50638/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cf3657/50638/git-merge-result

Comparison Summary

Summary:

  • You potentially added 5 lines to the logs
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 52
  • DQMHistoTests: Total histograms compared: 4025536
  • DQMHistoTests: Total failures: 12
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4025504
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 51 files compared)
  • Checked 222 log files, 193 edm output root files, 52 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor

+core

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

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 0fd6cf8 into cms-sw:master Jan 15, 2026
10 checks passed
@Dr15Jones Dr15Jones deleted the rangesFramework branch January 15, 2026 20:46
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.

Experimented with using std::range in FWCore/Framework

4 participants