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] Filtered View Performance - Step 2 #31641

Merged
merged 7 commits into from
Oct 2, 2020

Conversation

ianna
Copy link
Contributor

@ianna ianna commented Oct 1, 2020

PR description:

Allow caching of a SpecPar selected by an attribute for the current Node. The assumption is that multiple parameters are associated with the same SpecPar. The first get<double> call would do an expensive search and the subsequent getNextValue will piggyback on it, fetching a value selected by another attribute from the same SpecPar.

This works as follows (see the unit test):

double radLength = fview.get<double>("TrackerRadLength");
double xi = fview.getNextValue("TrackerXi");

The assumption is that both TrackerRadLength and TrackerXi should be part of one SpecPar:

   <SpecPar eval="true" name="TrackerRecMaterialTOBLayer1_Z0">
      <PartSelector path="//Tracker/TOB/TOBLayer1/TOBRod1/TOBRod1L/TOBRodCentral1L/TOBModule0[6]/TOBWaferRphi0/TOBActiveRphi0" />
      <PartSelector path="//Tracker/TOB/TOBLayer1/TOBRod1/TOBRod1L/TOBRodCentral1L/TOBModule0[6]/TOBWaferSter0/TOBActiveSter0" />
      <PartSelector path="//Tracker/TOB/TOBLayer1/TOBRod1/TOBRod1H/TOBRodCentral1H/TOBModule0[1]/TOBWaferRphi0/TOBActiveRphi0" />
      <PartSelector path="//Tracker/TOB/TOBLayer1/TOBRod1/TOBRod1H/TOBRodCentral1H/TOBModule0[1]/TOBWaferSter0/TOBActiveSter0" />
      <Parameter name="TrackerRadLength" value="0.023298" />
      <Parameter name="TrackerXi" value="4.98908e-05" />
    </SpecPar>

The assumption seems to be reasonable, but of cause, there are exceptions:
https://cmssdt.cern.ch/lxr/source/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml#0321

   <SpecPar name="PixelROCRowsPar_D1">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>
  <SpecPar name="PixelROCRowsPar_D2">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>
  <SpecPar name="PixelROCRowsPar_D3">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>

@ghugo83 and @vargasa - any idea what should happen here? Is it assumed that PixelROCRows is a vector?

PR validation:

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

Before submitting your pull requests, make sure you followed this checklist:

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

The code-checks are being triggered in jenkins.

@ianna
Copy link
Contributor Author

ianna commented Oct 1, 2020

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31641/18726

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

A new Pull Request was created by @ianna (Ianna Osborne) for master.

It involves the following packages:

DetectorDescription/DDCMS

@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild can you please review it and eventually sign? Thanks.
@fabiocos, @slomeo, @vargasa this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@ghugo83
Copy link
Contributor

ghugo83 commented Oct 1, 2020

   <SpecPar name="PixelROCRowsPar_D1">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>
  <SpecPar name="PixelROCRowsPar_D2">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>
  <SpecPar name="PixelROCRowsPar_D3">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>

I dont think a vector is needed, just an int.
If you go on looping inside the FilteredView, you will just get a vector full of 80.

This represents the number of rows PER ROC, for pixel sensors.
In this file, one group is all sensors belonging to D1, another group is all sensors belonging to D2, etc.

Here in the XML, there is no point having several blocks, because there are the same path anyway.
This is just done for clarity for the reader, I would say.
The SpecPar name does not change anything.

This is exactly equivalent to:

   <SpecPar name="PixelROCRowsPar_AllDisks">
      <PartSelector path="//.*:PixelForwardSensor" />
      <Parameter name="PixelROCRows" value="80"/>
  </SpecPar>

So the behavior of the FilteredView should be: if ever the node path is matching //.*:PixelForwardSensor, I take
<Parameter name="PixelROCRows" value="80"/>
and I can safely stop.

When one wants to assign different values to a specific layer / disk, the paths must be different anyway (that difference sometimes lies only in the namespace, by the way).
And in that case, the FilteredView will not stop until she finds a node matching the path anyway, to get the value specific to that path.

@ianna
Copy link
Contributor Author

ianna commented Oct 1, 2020

@ghugo83 - Thanks! I did not find anywhere a reference to the SpecPar name: for example, PixelROCRowsPar_D1 Is it used somewhere? If not, perhaps the SpecPars could be merged eventually? ;-)

@ghugo83
Copy link
Contributor

ghugo83 commented Oct 1, 2020

@ghugo83 - Thanks! I did not find anywhere a reference to the SpecPar name: for example, PixelROCRowsPar_D1 Is it used somewhere? If not, perhaps the SpecPars could be merged eventually? ;-)

I remember seeing the use of SpecPar name somewhere in the DD4hep filtered view.
From what I had read, it was used to make a lookup up faster (it was used as a parameter to directly look at the specified SpecPar block).
This function does not affect the results though, and am not sure this function is even called.
But that's what I remember, not looking into the code, so can't be sure.

In general, in my opinion, only SpecPar path really matters (and parameter name/value obviously).

It does make some sense to have blocks per disk / ring. There actually are trackers where the sensor topology is different per ring (I also did some exotic Trackers, but in tkLayout only, where the topology was disk-specific).

Though, my guess is that you would like to have a warning when several blocks define the same parameter for the same path, right?
If so, the duplication in the XMLs could be removed.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

+1
Tested at: cc4ef4c
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b03384/9686/summary.html
CMSSW: CMSSW_11_2_X_2020-10-01-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2020

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

Comparison Summary:

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

@ianna
Copy link
Contributor Author

ianna commented Oct 2, 2020

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2020

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

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 7e92b80 into cms-sw:master Oct 2, 2020
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

4 participants