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

[DD4hep] Navigation Performance #31594

Closed
ianna opened this issue Sep 27, 2020 · 17 comments
Closed

[DD4hep] Navigation Performance #31594

ianna opened this issue Sep 27, 2020 · 17 comments

Comments

@ianna
Copy link
Contributor

ianna commented Sep 27, 2020

Study by how much it can be improved before the following issue is resolved:
https://sft.its.cern.ch/jira/browse/ROOT-9742

@ianna
Copy link
Contributor Author

ianna commented Sep 27, 2020

assign geometry

@cmsbuild
Copy link
Contributor

New categories assigned: geometry

@Dr15Jones,@cvuosalo,@mdhildreth,@makortel,@ianna,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

A new Issue was created by @ianna Ianna Osborne.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@ianna
Copy link
Contributor Author

ianna commented Sep 27, 2020

@dpiparo - perhaps, CMS could ping ROOT team and discuss their priorities at an appropriate forum? Thanks.

@davidlange6
Copy link
Contributor

davidlange6 commented Sep 27, 2020 via email

@ianna
Copy link
Contributor Author

ianna commented Sep 27, 2020

@davidlange6 - it looks like only no 1 was addressed.

Quote:

Some geometry tasks were identified during initial discussions with LHCb and CMS, related to integration of DD4HEP in their DD software.

  1. Support for reading/writing optical surface properties from/to GDML in a similar way as in Geant4. This will complete the conversion circle TGeo <->Geant4 via GDML
  2. Support for building geometry in parallel. This requires introduction in a first phase of thread-local geometry managers and accessors to those used internally by TGeo instead of the global gGeoManager pointer
  3. Support for wildcard queries on top of the geometry tree, providing callbacks to user code for filtering geometry information
  4. Long term evolution to having more stateless geometry information, allowing to decouple creation of objects with their central bookkeeping (no need for geometry singleton)

@makortel
Copy link
Contributor

@ianna For my education, about point 2, would that be about running internals of a single geometry ESProducer concurrently, or running multiple (different) geometry ESProducers concurrently?

@ianna
Copy link
Contributor Author

ianna commented Sep 30, 2020

@ianna For my education, about point 2, would that be about running internals of a single geometry ESProducer concurrently, or running multiple (different) geometry ESProducers concurrently?

@makortel - We would use the former to processes multiple XML files or fragments with a tbb task per file, for example. We would use the latter to run the Reco geometry builders concurrently.

@makortel
Copy link
Contributor

For my education, about point 2, would that be about running internals of a single geometry ESProducer concurrently, or running multiple (different) geometry ESProducers concurrently?

We would use the former to processes multiple XML files or fragments with a tbb task per file, for example. We would use the latter to run the Reco geometry builders concurrently.

Right. I can imagine the point 2 to be required for the former, but is it needed for the latter as well?

@ianna
Copy link
Contributor Author

ianna commented Sep 30, 2020

For my education, about point 2, would that be about running internals of a single geometry ESProducer concurrently, or running multiple (different) geometry ESProducers concurrently?

We would use the former to processes multiple XML files or fragments with a tbb task per file, for example. We would use the latter to run the Reco geometry builders concurrently.

Right. I can imagine the point 2 to be required for the former, but is it needed for the latter as well?

Not yet, so fare we use the TGeo as read-only.

@makortel
Copy link
Contributor

For my education, about point 2, would that be about running internals of a single geometry ESProducer concurrently, or running multiple (different) geometry ESProducers concurrently?

We would use the former to processes multiple XML files or fragments with a tbb task per file, for example. We would use the latter to run the Reco geometry builders concurrently.

Right. I can imagine the point 2 to be required for the former, but is it needed for the latter as well?

Not yet, so fare we use the TGeo as read-only.

Thanks. I was asking because "soon" we will be doing the latter (#31061). There is a way to declare that an ESProducer uses a "shared, non-thread-safe resource" in which case the framework will run only one ESProducer using such a resource at a time. If it happens in the future that some ESProducer would need a write access to the TGeo (or whatever else non-thread-safe in DD4hep), we need to look into that.

@civanch
Copy link
Contributor

civanch commented Sep 30, 2020

@ianna , the requirement to read xml files in parallel should not be an urgent requirement, because old DDD is not parallel as well. In a long term, it may be a valid requirement but for today we need the minimum: DD4Hep should provide the same results as old DDD. If we will face the situation, that DD4Hep is several times slower than DDD we may accept this if geometry is built correctly for Run-3. There is enough time after 11_2 to improve performance.

@davidlange6
Copy link
Contributor

I added a generic comment in the AF meeting today.

@ianna
Copy link
Contributor Author

ianna commented Oct 1, 2020

I added a generic comment in the AF meeting today.

@davidlange6 - Thanks! It would be good if they replied to the Jira issue and commented on what is a timescale for implementing thread-local geometry managers? If they are planning to provide a wildcard query and if singleton is going away any time soon? Thanks again!

@ianna
Copy link
Contributor Author

ianna commented Oct 7, 2020

TrackerModuleNumbering test from DD reference number is 5 sec in total

DD4hep XML parsing and a DDCompactView producer is around 10 sec
This is included in the TrackerModuleNumbering test numbers that show improvement from:

  • Current CMSSW_11_2_X_2020-10-06-2300 IB:
%MSG-i ModuleNumbering:  ModuleNumbering:prod 07-Oct-2020 10:27:30 CEST Run: 1 Event: 1
 And Contains  Daughters: 17004
%MSG
TimeModule> 1 1 prod ModuleNumbering 128.871
  • avoiding double search for the attributes that are defined in the same specpar by prefetching it:
radLength_ = fv->get<double>("TrackerRadLength");
xi_ = fv->getNextValue("TrackerXi");
%MSG-i ModuleNumbering:  ModuleNumbering:prod 07-Oct-2020 10:47:03 CEST Run: 1 Event: 1
 And Contains  Daughters: 17004
%MSG
TimeModule> 1 1 prod ModuleNumbering 94.9412
  • avoiding regexp comparison where possible:
%MSG-i ModuleNumbering:  ModuleNumbering:prod 07-Oct-2020 16:11:18 CEST Run: 1 Event: 1
 And Contains  Daughters: 17004
%MSG
TimeModule> 1 1 prod ModuleNumbering 43.474
  • replacing the rest of tbb containers with regular std containers

@ianna
Copy link
Contributor Author

ianna commented Dec 8, 2020

+1

bottlenecks are understood, the units migration should happen first

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 8, 2020

This issue is fully signed and ready to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants