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

Reduce boost use in EventFilter/Utilities #30181

Merged

Conversation

camolezi
Copy link
Contributor

PR description:

Replaced boost library use for C++ STL alternatives. A shared_ptr to a std::vector should have similar behavior as a boost::shared_vector.

PR validation:

Passed on basic runTheMatrix test.

if this PR is a backport please specify the original PR and why you need to backport that PR:

@vgvassilev @davidlange6

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@camolezi camolezi changed the title replaced boost::shared_vector for std alternatives Replaced boost::shared_vector for std alternatives in EventFilter/Utilities Jun 10, 2020
@camolezi camolezi changed the title Replaced boost::shared_vector for std alternatives in EventFilter/Utilities Reduce boost use in EventFilter/Utilities Jun 10, 2020
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30181/16000

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @camolezi (Lucas Camolezi) for master.

It involves the following packages:

EventFilter/Utilities

@perrotta, @mommsen, @cmsbuild, @emeschi, @slava77 can you please review it and eventually sign? Thanks.
@Martin-Grunewald this is something you requested to watch as well.
@silviodonato, @dpiparo you are the release manager for this.

cms-bot commands are listed here

@@ -22,7 +24,7 @@ class RawEventFileWriterForBU {
~RawEventFileWriterForBU();

void doOutputEvent(FRDEventMsgView const& msg);
void doOutputEvent(boost::shared_array<unsigned char>& msg){};
void doOutputEvent(std::shared_ptr<std::vector<unsigned char>>& msg){};
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this method is not used anywhere. @smorovic, can it be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it looks obsolete (same also for doOutputEventFragment).

Copy link
Contributor

Choose a reason for hiding this comment

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

  if (templateConsumer_->sharedMode())
    templateConsumer_->doOutputEvent(workBuffer);
  else

this should also go away if definition is gone (it's safe, because shared mode is always false)

@@ -107,8 +108,8 @@ void RawEventOutputModuleForBU<Consumer>::write(edm::EventForOutput const& e) {

totsize += expectedSize;
// build the FRDEvent into a temporary buffer
boost::shared_array<unsigned char> workBuffer(new unsigned char[expectedSize + 256]);
uint32* bufPtr = (uint32*)workBuffer.get();
std::shared_ptr<std::vector<unsigned char>> workBuffer(new std::vector<unsigned char>(expectedSize + 256));
Copy link
Contributor

Choose a reason for hiding this comment

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

A unique ptr should be enough here, isn't it? How about using std::make_unique instead of the 'new'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that you mentioned, I agree, a unique_ptr should probably be enough here.

@camolezi camolezi force-pushed the reduce-boost-shared_array-EventFilter2 branch from 67f8d8f to 7ed8acf Compare June 10, 2020 19:37
@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30181/16001

@cmsbuild
Copy link
Contributor

Pull request #30181 was updated. @perrotta, @mommsen, @cmsbuild, @emeschi, @slava77 can you please check and sign again.

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 11, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/6948/console Started: 2020/06/11 09:06

@cmsbuild
Copy link
Contributor

+1
Tested at: 7ed8acf
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-40d2ea/6948/summary.html
CMSSW: CMSSW_11_2_X_2020-06-10-2300
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@mommsen
Copy link
Contributor

mommsen commented Jun 11, 2020

+1

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 36
  • DQMHistoTests: Total histograms compared: 2780497
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2780443
  • DQMHistoTests: Total skipped: 50
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 35 files compared)
  • Checked 152 log files, 16 edm output root files, 36 DQM output files

@perrotta
Copy link
Contributor

+1

  • Technical
  • Jenkins tests pass

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

@silviodonato
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.

None yet

6 participants