Skip to content

[TriggerMenuMT] Replace RecoFragmentsPool internal implementation with AccumulatorCache

Replace the whole RecoFragmentsPool custom cache implementation with new one based on the AccumulatorCache, which is a new central solution for ATLAS configuration code. It comes with many useful features for debugging, as well as profits from any new features, bug fixes and improvements to be implemented in the central code.

The new solution is stricter than the old one. It requires config flags to be always passed and practically eliminates non-cacheable calls with unhashable arguments. With the implementation of arguments parsing provided here, the hashability is enforced while keeping the arguments intact in all known and tested cases.

Since this MR replaces one cache with another, it doesn't really improve the configuration timing. It does, however, improve the correctness of the configuration and eliminates some previously unnoticed bad patterns. It also makes debugging cache misses much easier and using these features, I already improved some functions in the TriggerMenuMT to limit unnecessary cache misses (commit 0adb4efe).

Fixes include:

  • pass keyword arguments consistently in all calls to the same functions
  • avoid functions local to an object of a class - make them static or move out of the class

The latter in two cases fixes actual caching bugs:

  • In MinBiasChainConfiguration.py the two temporary lambdas had the same memory address and signature, so the same hash, even though they were separate functions. Result of one may have been cached and returned as a result of the other function.
  • Similar situation in BjetChainConfiguration.py made chain configuration of the first jet collection type be returned for all subsequent calls regardless of the collection type passed. Fixing this uncovered a series of downstream bugs in b-jet chain configuration, so the affected 5 b-jet EMTopo chains are commented out. The issue is followed up in ATR-24730

A nice feature of the AccumulatorCache is its summary print-out which is now added in runHLT_standalone.py and shows for LS2_v1 menu:

----------------------------------------------------------------------------------------------------------
AccumulatorCache                                                       |    Hits (time) |  Misses (time) |
----------------------------------------------------------------------------------------------------------
TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents.retrieve_cacheable     |  10017 ( 1.5s) |    493 (78.0s) |
...ndAlg.AtlasTrackingGeometryCondAlgConfig.TrackingGeometryCondAlgCfg |     19 ( 0.0s) |      1 ( 0.4s) |
IOVDbSvc.IOVDbSvcConfig.IOVDbSvcCfg                                    |    111 ( 0.0s) |      1 ( 0.0s) |
...Config.MinBias.MinBiasMenuSequences.MinBiasZVertexFinderSequenceCfg |      0 ( 0.0s) |      1 ( 0.0s) |
...nuMT.HLTMenuConfig.MinBias.MinBiasMenuSequences.SPCounterRecoAlgCfg |      0 ( 0.0s) |      1 ( 0.0s) |
TrigConfigSvc.TrigConfigSvcCfg.L1ConfigSvcCfg                          |      1 ( 0.0s) |      1 ( 0.0s) |
TrigConfigSvc.TrigConfigSvcCfg.HLTConfigSvcCfg                         |      1 ( 0.0s) |      1 ( 0.0s) |
----------------------------------------------------------------------------------------------------------

The chain removals + the code improvements in this MR dropped the number of cache misses from >600 to <500.

cc @tbold, @ktopolni, @khoo

Edited by Rafal Bielski

Merge request reports