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] Allow Use of Namespace in SpecPar Comparison #31579
Comments
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 |
assign geometry |
New categories assigned: geometry @Dr15Jones,@cvuosalo,@mdhildreth,@makortel,@ianna,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks |
urgent |
Who is working on this issue? |
@ghugo83 How would you suggest the namespace be handled in the Filtered View with respect to the SpecPars? Sometimes we want to namespace excluded, and sometimes we want it included. How should that be specified? |
I'm about to submit a PR to provide an additional getter from the spec pars that does not strip off the namespace. It would mean that all the volumes should be crated with the namespace of interest. That needs to be checked, also if there is an extra cost of it. |
Yep I think the behavior of the DD4hep Filtered view interface should be the same as old DD:
|
It should be the same for copy number: when copy number is explicitly specified in the SpecPars in XMLs, it should be taken into account, and if not, it should not. |
yes, that's there already :-) |
In reco XMLs for example, there are paths like this: A DD4hep path is: |
@ghugo83 - this conversion may cost as much as its comparison, e.g. what is already done now (but without a namespaces). Namespace in DD4hep is a
It's an extra check per
Anyway, I have an interim solution in my local area that is not too costly and will PR it soon. :-) |
@ianna Great! Yes am not working on this front anyway (exploring the others points of the to-do list), I trust you for finding sth which works with an acceptable perf :) |
By the way I think I have found a way to fasten the DD4hep Tracker workflow (off-topic from this issue though). |
fixed in #31614 |
+1 |
This issue is fully signed and ready to be closed. |
@ianna
Comparison: |
By the way, 90% of all the time used to create the full Tracker geometry and numbering, is used by the calls of (already there before my PR): If you comment these 10 lines out, you get a x10 speedup with DD4hep.
|
Hmm yes the fix in (b) (no-namespace) does not seem to work yet. |
@ghugo83 - thanks, now that the PRs are merged I should try to reproduce it with your branch. |
|
@ghugo83 - this PR #31614 should address some performance issues. Thought it may still be a premature optimisation ( "the root of all evil (or at least most of it)" ) :-) |
Ok will re-test that |
@ghugo83 - FYI testing your PR #31573 + PR #31621 with the following change shows no differences: $ git diff
diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml
index 92ca1793acf..6ce3f568fec 100644
--- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml
+++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml
@@ -206,7 +206,7 @@
<Include ref='Geometry/TrackerCommonData/data/trackertec.xml'/>
<Include ref='Geometry/TrackerCommonData/data/v2/trackerbulkhead.xml'/>
<Include ref='Geometry/TrackerCommonData/data/trackerother.xml'/>
- <Include ref='Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml'/>
+ <Include ref='Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml'/>
<Include ref='Geometry/TrackerSimData/data/PhaseI/trackersens.xml'/>
<Include ref='Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml'/>
<Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseI.xml'/> 11183c11183
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CheckGeometry() 30-Sep-2020 11:22:49 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CheckGeometry() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11186c11186
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:22:49 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11189c11189
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::Voxelize() 30-Sep-2020 11:22:49 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::Voxelize() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11192c11192
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:22:49 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11195c11195
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CountLevels() 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CountLevels() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11198c11198
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11201c11201
< %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i Root_Information: ModuleNumbering:prod TGeoManager::CloseGeometry() 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11206c11206
< %MSG-i TrackerGeom: ModuleNumbering:prod 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i TrackerGeom: ModuleNumbering:prod 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11209c11209
< %MSG-i TrackerTopologyEP: ModuleNumbering:prod 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i TrackerTopologyEP: ModuleNumbering:prod 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
11212c11212
< %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:22:50 CEST Run: 1 Event: 1
---
> %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:37:31 CEST Run: 1 Event: 1
55604,55605c55604,55605
< %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:34:40 CEST Run: 1 Event: 1
< Top node is 0x7ff3a3fc34c0 Tracker
---
> %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:49:20 CEST Run: 1 Event: 1
> Top node is 0x7fcb6ed824c0 Tracker
55607c55607
< %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:34:40 CEST Run: 1 Event: 1
---
> %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:49:20 CEST Run: 1 Event: 1
55618c55618
< %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:34:40 CEST Run: 1 Event: 1
---
> %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:49:20 CEST Run: 1 Event: 1
55621c55621
< %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:34:40 CEST Run: 1 Event: 1
---
> %MSG-i ModuleNumbering: ModuleNumbering:prod 30-Sep-2020 11:49:20 CEST Run: 1 Event: 1
55624,55627c55624,55627
< TimeModule> 1 1 prod ModuleNumbering 711.719
< TimeModule> 1 1 p1 PathStatusInserter 0.000180006
< TimeModule> 1 1 TriggerResults TriggerResultInserter 5.6982e-05
< ----- Begin Fatal Exception 30-Sep-2020 11:34:40 CEST-----------------------
---
> TimeModule> 1 1 prod ModuleNumbering 710.345
> TimeModule> 1 1 p1 PathStatusInserter 0.000760078
> TimeModule> 1 1 TriggerResults TriggerResultInserter 0.000238895
> ----- Begin Fatal Exception 30-Sep-2020 11:49:20 CEST-----------------------
55636c55636
< TimeEvent> 1 1 711.722
---
> TimeEvent> 1 1 710.352
55641c55641
< [1] run: 1 lumi: 1 event: 1 vsize = 811.008 deltaVsize = 0 rss = 251.285 delta = 0
---
> [1] run: 1 lumi: 1 event: 1 vsize = 811.008 deltaVsize = 0 rss = 156.164 delta = 0
55646,55647c55646,55647
< [1] run: 1 lumi: 1 event: 1 vsize = 811.008 deltaVsize = 0 rss = 251.285 delta = 0
< TimeReport> Time report complete in 716.342 seconds
---
> [1] run: 1 lumi: 1 event: 1 vsize = 811.008 deltaVsize = 0 rss = 156.164 delta = 0
> TimeReport> Time report complete in 715.492 seconds
55649,55654c55649,55654
< - Min event: 711.722
< - Max event: 711.722
< - Avg event: 711.722
< - Total loop: 711.723
< - Total init: 4.61527
< - Total job: 716.342
---
> - Min event: 710.352
> - Max event: 710.352
> - Avg event: 710.352
> - Total loop: 710.354
> - Total init: 5.13328
> - Total job: 715.492
55657c55657
< Event Throughput: 0.00140504 ev/s
---
> Event Throughput: 0.00140775 ev/s
55659,55660c55659,55660
< - Total loop: 711.334
< - Total init: 2.43249
---
> - Total loop: 709.745
> - Total init: 2.65475
55662c55662
< - Total job: 713.769
---
> - Total job: 712.403 |
Hmm yes With help of valgrind I got sth much faster by removing the call of Implementation of split: There is no need to have this vector to compare strings, one can just 'move along' the path we already have, until a difference is spotted. There is also an over-use of regex: in I have sth on my local which makes the run really fast, will push a PR when ready. I think in general there is an overall use of regex in DDFilteredView: probably should not, by default, convert each word of each path to regex, when not a regex anyway (keep that for the small fraction which are actually regex). |
Ok cool. Was in FilteredView speed, will switch back to that branch. Need to compare what is stored in GeometricDet etc, but sounds good :) |
@ghugo83 - also the last merged PR #31614 gives a 3x speedup: < - Min event: 220.235
< - Max event: 220.235
< - Avg event: 220.235
< - Total loop: 220.237
< - Total init: 4.07409
< - Total job: 224.312
---
> - Min event: 711.722
> - Max event: 711.722
> - Avg event: 711.722
> - Total loop: 711.723
> - Total init: 4.61527
> - Total job: 716.342 |
@ghugo83 - using < - Min event: 199.23
< - Max event: 199.23
< - Avg event: 199.23
< - Total loop: 199.231
< - Total init: 4.13025
< - Total job: 203.363
---
> - Min event: 711.722
> - Max event: 711.722
> - Avg event: 711.722
> - Total loop: 711.723
> - Total init: 4.61527
> - Total job: 716.342
|
@ianna yes with x3 and x3 we might hopepfully eventually join sth similar as old DD FilteredView (there was a x10 discrepancy if I recall properly, really painful for tests cycles and so on) :) |
Also this is useful cause will be needed for the other subdetectors as well anyway. |
Indeed, I've got 10x improvement on your PR test #31630 A break for the |
Haaa I see at #31630 you pushed it already haha Maybe then also worth it to minimize regex usage + avoid dd4hep::dd::split whenever possible in the rest of the FilteredView |
The text was updated successfully, but these errors were encountered: