Skip to content
Snippets Groups Projects

Add type to PrepRawData, move implementations .icc, avoid dyn_cast

  • Add a type function to PrepRawData
  • Move a few inline to separate .icc
  • Use it to avoid a couple of dynamic_casts

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Hmm. It's fine to add the type, but is there a piece of code which you are trying to optimise? Because I don't think dynamic_cast is that slow these days.

    The one place where is might be slow is a bunch of dynamic_casts in switches. But then you should have a complete list of PRD types, no? (I added a comment about this in the code)

  • dynamic_cast is that slow these days.

    Actually not sure , @goetz was claiming the same but it turns out the above can be 2X faster or so. My understanding from dissasembing is that can stil call strcmp.

    On why, to be honest to do know why we have that many (seems like a part of the design gone wrong), for the Measurement side there is a type we can use . There is also now a rio_type specifc etc.

    Now the provenance of the calls is not obvious : https://atlaspmb.web.cern.ch/atlaspmb/arch-mon-rawtoall_tier0_reco_data17/profiling_reports/2020-06-17T2138/profile_2020-06-17T2138.pdf

    Screenshot_2020-07-22_at_12.50.05

    Screenshot_2020-07-22_at_12.49.43

    But I think @amete also pointed out that prb comes from loops inside tracking looking for a a specific type in tight loops. Basically is more like trying to figure why dynamic_cast has same cost as sincos or getCache in our profile and cut it down.

    In terms of code the things I have seem are like tracking summary or ID quantities. Basically, if you see what I changes as an example, the code just wants to count number of nSi vs nTRT and goes into a loop per track, with dynamic casts ....

    Edited by Christos Anastopoulos
  • Anyhow the kind of example is this

        if (rd && rd->type(Trk::PrepRawDataType::SiCluster)) {
            ++nclus;
            continue;
          }
    
          if (rd && rd->type(Trk::PrepRawDataType::TRT_DriftCircle)) {
            ++ntrt;
            continue;
          }
    

    instead of

      const InDet::SiCluster*     si = dynamic_cast<const InDet::SiCluster*>(rd);	       
          if(si) { ++nclus; continue;}							       
          
          const InDet::TRT_DriftCircle*  dc = dynamic_cast<const InDet::TRT_DriftCircle*>(rd); 
          if(dc) { ++ntrt; continue;}			
    

    from this MR.

    At large looking for dynamic_casts inside tight loops.

    The switch on type another issue , but that we do more on surface/Parameter type rather than on things like the above. Since certain tranformation implementation live outside the classes.

    This was another set of MRs multiple if else if .... based on dynamic cast or so to kind od switch or if else over types .

    Edited by Christos Anastopoulos
  • added 1 commit

    Compare with previous version

  • This merge request affects 5 packages:

    • InnerDetector/InDetRecEvent/InDetPrepRawData
    • InnerDetector/InDetRecTools/InDetConversionFinderTools
    • MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData
    • Simulation/ISF/ISF_Fatras/ISF_FatrasEvent
    • Tracking/TrkEvent/TrkPrepRawData

    Adding @goetz ,@jchapman ,@amorley ,@wleight ,@vpascuzz ,@sroe ,@nkoehler ,@rosati as watchers

  • Christos Anastopoulos resolved all threads

    resolved all threads

  • added 1 commit

    • 730fc304 - As many types , and as many overloads as detectorElement overloads

    Compare with previous version

  • Christos Anastopoulos resolved all threads

    resolved all threads

  • Now as many types and as many overloads of type(...) as detectorElement() overloads I could see. As I assume this is a logical way to approach it.

    Edited by Christos Anastopoulos
  • added 1 commit

    • 5a5ac385 - As many types , and as many overloads as detectorElement overloads

    Compare with previous version

  • This merge request affects 5 packages:

    • InnerDetector/InDetRecEvent/InDetPrepRawData
    • InnerDetector/InDetRecTools/InDetConversionFinderTools
    • MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData
    • Simulation/ISF/ISF_Fatras/ISF_FatrasEvent
    • Tracking/TrkEvent/TrkPrepRawData

    Adding @goetz ,@jchapman ,@amorley ,@wleight ,@vpascuzz ,@sroe ,@nkoehler ,@rosati as watchers

  • This merge request affects 5 packages:

    • InnerDetector/InDetRecEvent/InDetPrepRawData
    • InnerDetector/InDetRecTools/InDetConversionFinderTools
    • MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData
    • Simulation/ISF/ISF_Fatras/ISF_FatrasEvent
    • Tracking/TrkEvent/TrkPrepRawData

    Adding @goetz ,@jchapman ,@amorley ,@wleight ,@vpascuzz ,@sroe ,@nkoehler ,@rosati as watchers

  • :negative_squared_cross_mark: CI Result FAILURE (hash 5a5ac385)

    Athena AthSimulation AthGeneration
    externals :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :warning: :warning: :warning:
    make :white_check_mark: :white_check_mark: :white_check_mark:
    required tests :o: :o: :white_check_mark:
    optional tests :cloud: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 17613]

  • Jenkins please retry a build

  • This merge request affects 5 packages:

    • InnerDetector/InDetRecEvent/InDetPrepRawData
    • InnerDetector/InDetRecTools/InDetConversionFinderTools
    • MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData
    • Simulation/ISF/ISF_Fatras/ISF_FatrasEvent
    • Tracking/TrkEvent/TrkPrepRawData

    Adding @goetz ,@jchapman ,@amorley ,@wleight ,@vpascuzz ,@sroe ,@nkoehler ,@rosati as watchers

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading