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

Thread safe changes for HcalDcsMap, HCalElecrtonicsMap classes #909

Merged
merged 5 commits into from Oct 7, 2013
Merged

Thread safe changes for HcalDcsMap, HCalElecrtonicsMap classes #909

merged 5 commits into from Oct 7, 2013

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Sep 24, 2013

No description provided.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @vkuznet (Valentin Kuznetsov) for CMSSW_7_0_X.

Thread safe changes for HcalDcsMap, HCalElecrtonicsMap classes

It involves the following packages:

CondFormats/HcalObjects

@smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@vkuznet
Copy link
Contributor Author

vkuznet commented Sep 24, 2013

@Dr15Jones please review

}

HcalDcsMap::~HcalDcsMap(){
if (mItemsById) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In C++ it is fine to call delete on a null pointer so there is no need for the check.

@Dr15Jones
Copy link
Contributor

In reviewing information about std::atomic<> I see that for the case of a cache, we really should use the acquire/release memory ordering in order to avoid synchronization overheads.

@cmsbuild
Copy link
Contributor

Pull request #909 was updated. @smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please check and sign again.

@nclopezo
Copy link
Contributor

-1
Hi,
I ran the jenkins tests, but I got segmentation violation error in all the workflows of the short matrix tests, the tests were run on top of CMSSW_7_0_X_2013-09-25-0200. You can see the outputs here:

https://cmssdt.cern.ch/jenkins/job/Pull-Request-Integration/ARCHITECTURE=slc5_amd64_gcc481/649/consoleFull
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/649

@Dr15Jones
Copy link
Contributor

Could someone run valgrind on one of these crashing jobs so we can see what memory is being corrupted?

@nclopezo
Copy link
Contributor

Hi Chris,

I started a Jenkins job to test workflow 4.22 here:
https://cmssdt.cern.ch/jenkins/job/Pull-Request-Integration/ARCHITECTURE=slc5_amd64_gcc481/662/console

When It finishes you should find here a valgrind.xml file with the results:

https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/662/runTheMatrix-results/4.22_RunCosmics2011A+RunCosmics2011A+RECOCOSD+ALCACOSD+SKIMCOSD+HARVESTDC/

And also the jenkins valgrind plugin should parse the results and show them in jenkins.

@nclopezo
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Pull request #909 was updated. @smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please check and sign again.

@apfeiffer1
Copy link
Contributor

+1
provided it passes by Jenkins ...

@cmsbuild
Copy link
Contributor

Pull request #909 was updated. @smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please check and sign again.

@apfeiffer1
Copy link
Contributor

+1
then ! :)

@nclopezo
Copy link
Contributor

nclopezo commented Oct 2, 2013

Hi,
I ran again the usual tests and I got again segmentation violation error in the RelVals, is there still a commit pending for this pull request?

@vkuznet
Copy link
Contributor Author

vkuznet commented Oct 2, 2013

David, I've added initialization of mutable member data in default ctor, which may cause this. Please re-run the tests. Sorry I didn't spot this earlier.

On Oct 2, 2013, at ,Oct 2, 8:21 AM, David Mendez wrote:

Hi,
I ran again the usual tests and I got again segmentation violation error in the RelVals, is there still a commit pending for this pull request?


Reply to this email directly or view it on GitHub.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2013

Pull request #909 was updated. @smuzaffar, @apfeiffer1, @nclopezo, @demattia, @rcastello, @ggovi can you please check and sign again.

@nclopezo
Copy link
Contributor

nclopezo commented Oct 3, 2013

@demattia
Copy link
Contributor

demattia commented Oct 3, 2013

+1

1 similar comment
@apfeiffer1
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 4, 2013

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

ktf added a commit that referenced this pull request Oct 7, 2013
Thread safety -- Changes for HcalDcsMap, HCalElecrtonicsMap classes
@ktf ktf merged commit afa9d84 into cms-sw:CMSSW_7_0_X Oct 7, 2013

item = std::lower_bound (mPItemsById.begin(), mPItemsById.end(), &target, hcal_impl::LessById());
if (item == mPItemsById.end() || (*item)->mId != fId)
auto ptr = (*mPItemsById.load(std::memory_order_acquire));
Copy link
Contributor

Choose a reason for hiding this comment

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

as a part of testing #15321 which somewhat excessively uses the HcalElectronicsMap,
I noticed that the CPU use is dominated by memmove
https://slava77sk.web.cern.ch/slava77sk/reco/cgi-bin/igprof-navigator/CMSSW_8_1_0_pre10-sign746-ccb128f.tt35pre8.mt8.pp/947
After changing to auto const& ptr the time in hcalRawData went down from ~2s/evt to ~40 ms/evt.

@lihux25 or @igv4321 please follow up

@slava77 slava77 mentioned this pull request Aug 22, 2016
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

8 participants