Skip to content

Commit 52922c5

Browse files
authored
[PWGUD] Add PCH for PWGUD (#18310)
1 parent dcafedc commit 52922c5

5 files changed

Lines changed: 114 additions & 1 deletion

File tree

‎PWGUD/Core/CMakeLists.txt‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,40 @@ o2physics_add_library(FITCutParHolder
7171

7272
o2physics_target_root_dictionary(FITCutParHolder
7373
HEADERS FITCutParHolder.h
74-
LINKDEF FITCutParHolderLinkDef.h)
74+
LINKDEF FITCutParHolderLinkDef.h)
75+
# Precompiled header shared across PWGUD. Percentages are the share of the
76+
# group's workflow translation units that include the header, measured over the tree.
77+
# UDTables.h is the group's single shared data model.
78+
#
79+
# runDataProcessing.h is deliberately NOT precompiled: it requires each workflow's
80+
# customize() to be declared before it is included, so precompiling it silently
81+
# unregisters every option (the binary aborts at --dump-workflow, but links fine).
82+
#
83+
# Skipped under recc, which caches compilations remotely instead.
84+
add_library(UDTablesPCH OBJECT udTablesPCH.cxx)
85+
# The PCH compile is one of the heaviest translation units in the tree -- it
86+
# instantiates the whole data model up front -- but add_library() does not put
87+
# it in the 'analysis' job pool that o2physics_add_dpl_workflow() uses for the
88+
# workflows. Left out, it runs unthrottled alongside the pooled compilations
89+
# and defeats the per-job memory budget the pool exists to enforce.
90+
set_property(TARGET UDTablesPCH PROPERTY JOB_POOL_COMPILE analysis)
91+
target_link_libraries(UDTablesPCH PUBLIC O2::Framework O2Physics::AnalysisCore)
92+
if(NOT DEFINED ENV{USE_RECC})
93+
target_precompile_headers(UDTablesPCH PRIVATE
94+
# Framework baseline — same set AnalysisPCH precompiles. A target with
95+
# REUSE_FROM uses ONLY this PCH, so anything left out here is parsed from
96+
# scratch by every consumer: without this block these workflows were
97+
# precompiling LESS than the default carrier they opted out of.
98+
<Framework/ASoA.h>
99+
<Framework/AnalysisDataModel.h>
100+
<Framework/AnalysisHelpers.h>
101+
<Framework/AnalysisTask.h>
102+
<Framework/ConfigContext.h>
103+
<Framework/Configurable.h>
104+
<Framework/DataProcessorSpec.h>
105+
<Framework/HistogramRegistry.h>
106+
<Framework/HistogramSpec.h>
107+
<Framework/InitContext.h>
108+
[["PWGUD/DataModel/UDTables.h"]] # 79%, ~650 lines
109+
)
110+
endif()

‎PWGUD/Core/udTablesPCH.cxx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
// Carrier for the UDTablesPCH precompiled header; see this directory's
13+
// CMakeLists.txt. It exists only to own the PCH, so it has no code of its own.

‎PWGUD/TableProducer/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ add_subdirectory(Converters)
1313

1414
o2physics_add_dpl_workflow(dg-cand-producer
1515
SOURCES dgCandProducer.cxx
16+
REUSE_FROM UDTablesPCH
1617
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder O2Physics::AnalysisCCDB O2Physics::EventFilteringUtils
1718
COMPONENT_NAME Analysis)
1819

@@ -33,21 +34,25 @@ o2physics_add_dpl_workflow(upccand-producer # o2-linter: disable=name/o2-workflo
3334

3435
o2physics_add_dpl_workflow(tau-event-table-producer
3536
SOURCES tauEventTableProducer.cxx
37+
REUSE_FROM UDTablesPCH
3638
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3739
COMPONENT_NAME Analysis)
3840

3941
o2physics_add_dpl_workflow(two-tracks-event-table-producer
4042
SOURCES twoTracksEventTableProducer.cxx
43+
REUSE_FROM UDTablesPCH
4144
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4245
COMPONENT_NAME Analysis)
4346

4447
o2physics_add_dpl_workflow(two-fwd-tracks-event-table-producer
4548
SOURCES twoFwdTracksEventTableProducer.cxx
49+
REUSE_FROM UDTablesPCH
4650
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4751
COMPONENT_NAME Analysis)
4852

4953
o2physics_add_dpl_workflow(fwd-track-propagation
5054
SOURCES fwdTrackPropagation.cxx
55+
REUSE_FROM UDTablesPCH
5156
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking
5257
COMPONENT_NAME Analysis)
5358

@@ -63,26 +68,31 @@ o2physics_add_dpl_workflow(udmccollisions-to-udcollisions # o2-linter: disable=n
6368

6469
o2physics_add_dpl_workflow(tau-three-prong-event-table-producer
6570
SOURCES tauThreeProngEventTableProducer.cxx
71+
REUSE_FROM UDTablesPCH
6672
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
6773
COMPONENT_NAME Analysis)
6874

6975
o2physics_add_dpl_workflow(upc-cand-producer-muon
7076
SOURCES upcCandProducerMuon.cxx
77+
REUSE_FROM UDTablesPCH
7178
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::UPCCutparHolder O2::GlobalTracking
7279
COMPONENT_NAME Analysis)
7380

7481
o2physics_add_dpl_workflow(true-gap-producer
7582
SOURCES trueGapProducer.cxx
83+
REUSE_FROM UDTablesPCH
7684
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
7785
COMPONENT_NAME Analysis)
7886

7987
o2physics_add_dpl_workflow(upc-cand-producer-global-muon
8088
SOURCES upcCandProducerGlobalMuon.cxx
89+
REUSE_FROM UDTablesPCH
8190
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::UPCCutparHolder O2::GlobalTracking
8291
COMPONENT_NAME Analysis)
8392

8493
o2physics_add_dpl_workflow(upc-cand-producer-semi-fwd
8594
SOURCES upcCandProducerSemiFwd.cxx
95+
REUSE_FROM UDTablesPCH
8696
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::UPCCutparHolder O2::GlobalTracking
8797
COMPONENT_NAME Analysis)
8898

‎PWGUD/TableProducer/Converters/CMakeLists.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,36 @@
1111

1212
o2physics_add_dpl_workflow(fwd-tracks-extra-converter
1313
SOURCES UDFwdTracksExtraConverter.cxx
14+
REUSE_FROM UDTablesPCH
1415
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
1516
COMPONENT_NAME Analysis)
1617

1718

1819
o2physics_add_dpl_workflow(collisions-converter
1920
SOURCES UDCollisionsConverter.cxx
21+
REUSE_FROM UDTablesPCH
2022
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
2123
COMPONENT_NAME Analysis)
2224
o2physics_add_dpl_workflow(collision-fit-bits-converter
2325
SOURCES UDCollisionFITBitsConverter.cxx
26+
REUSE_FROM UDTablesPCH
2427
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
2528
COMPONENT_NAME Analysis)
2629

2730
o2physics_add_dpl_workflow(collisionselextras-converter
2831
SOURCES UDCollisionSelExtrasConverter.cxx
32+
REUSE_FROM UDTablesPCH
2933
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3034
COMPONENT_NAME Analysis)
3135

3236
o2physics_add_dpl_workflow(collisionselextras-converter-v002
3337
SOURCES UDCollisionSelExtrasV002Converter.cxx
38+
REUSE_FROM UDTablesPCH
3439
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
3540
COMPONENT_NAME Analysis)
3641

3742
o2physics_add_dpl_workflow(collisionselextras-converter-v003
3843
SOURCES UDCollisionSelExtrasV003Converter.cxx
44+
REUSE_FROM UDTablesPCH
3945
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4046
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)