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

Add copy constructor to edmNew::DetSetVector #23333

Merged
merged 3 commits into from May 29, 2018

Conversation

makortel
Copy link
Contributor

@makortel makortel commented May 25, 2018

This PR adds a way to make copy of copy constructor to edmNew::DetSetVector. Such a functionality is needed in the GPU pixel tracking work. Because the change implies recompiling ~half of the universe, I submit it here already now so that we could benefit getting it to a CMSSW pre-release (thus avoiding the aforementioned private recompilation).

The "copying" is implemented as the following pattern
edmNew::DetSetVector<T> copy;
copy.replaceFrom(original);
to allow putting the the copy to an std::unique_ptr<T>, and still keeping the copy constructor and assignment operator disabled (to prevent accidental copies).

Tested in 10_2_0_pre3, no changes expected.

@fwyzard @felicepantaleo @VinInn

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

DataFormats/Common

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@rovere, @wddgit this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 25, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28192/console Started: 2018/05/25 16:23

@Dr15Jones
Copy link
Contributor

So you have essentially made a strangely named assignment operator?

@makortel
Copy link
Contributor Author

makortel commented May 25, 2018

Essentially yes. Motivation for not enabling the assignment operator (or copy constructor) is to (continue to) prevent accidental copies (e.g. forgotten & in const auto foo = *fooHandle). Real need for a copy should be rare.

@Dr15Jones
Copy link
Contributor

I'm afraid I'm not convinced by that argument. I believe if we want to do copies then we should use the standard C++ syntax for such.

@makortel
Copy link
Contributor Author

But we want to do copies only in very specific circumstances (that may go away in the mid-to-far future). Providing standard copy constructor and assignment operator would allow misuse and bugs in the "performance regression" sense.

@Dr15Jones
Copy link
Contributor

@makortel we have the same problems with ever std container we use now. Given that the standard operations are not used anywhere in the code at present, putting them in will not cause a regression in our present code base.

@fwyzard
Copy link
Contributor

fwyzard commented May 25, 2018

in fact, it might make sense to delete the std::string copy constructor, and see how many copies we could get rid of...

@fwyzard
Copy link
Contributor

fwyzard commented May 25, 2018

@Dr15Jones

Given that [these] are not used anywhere in the code at present, putting them in will not cause a regression in our present code base.

can I quote this as a justification to enable GCC's Concepts in the production architecture ?

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-23333/28192/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2901706
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2901515
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@makortel
Copy link
Contributor Author

Declared the DetSetVector copy constructor with default.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

@Dr15Jones
Copy link
Contributor

Please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 28, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28232/console Started: 2018/05/28 14:33

@Dr15Jones
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 after it passes the integration tests. This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-23333/28232/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2902474
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2902282
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 12db440 into cms-sw:master May 29, 2018
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

5 participants