Skip to content

Commit 3d280fe

Browse files
committed
Add PCH to speedup PWGHF compilation
1 parent 905894d commit 3d280fe

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

‎PWGHF/D2H/Core/CMakeLists.txt‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,48 @@
1212
o2physics_add_library(HfDataCreationCharmReso
1313
SOURCES DataCreationCharmReso.cxx
1414
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore KFParticle::KFParticle)
15+
16+
# Precompiled header shared by the D2H reduced-data-model workflows. 28 of them
17+
# include ReducedDataModel.h, which alone reaches CandidateReconstructionTables.h,
18+
# RecoDecay.h, the PID/EventSelection/Centrality models and AnalysisDataModel.h,
19+
# so precompiling it covers most of what the family parses.
20+
#
21+
# Defined in Core because it is added before TableProducer and Tasks, and a
22+
# REUSE_FROM target must exist before the targets that name it.
23+
#
24+
# Skipped under recc, which caches compilations remotely instead -- the two do
25+
# not combine, as a PCH is a local artefact of one compiler invocation.
26+
add_library(D2HReducedPCH OBJECT d2hReducedPCH.cxx)
27+
target_link_libraries(D2HReducedPCH PUBLIC O2::Framework O2Physics::AnalysisCore)
28+
if(NOT DEFINED ENV{USE_RECC})
29+
target_precompile_headers(D2HReducedPCH PRIVATE
30+
[["PWGHF/D2H/DataModel/ReducedDataModel.h"]]
31+
[["PWGHF/DataModel/CandidateSelectionTables.h"]]
32+
<Framework/ASoA.h>
33+
<Framework/AnalysisHelpers.h>
34+
<Framework/AnalysisTask.h>
35+
<Framework/ConfigContext.h>
36+
<Framework/Configurable.h>
37+
<Framework/DataProcessorSpec.h>
38+
<Framework/HistogramRegistry.h>
39+
<Framework/HistogramSpec.h>
40+
<Framework/InitContext.h>
41+
<Framework/Logger.h>
42+
# NOT runDataProcessing.h, although all 28 consumers include it and
43+
# PWGJE's carriers do precompile it. It states the contract itself: the
44+
# customize() of a workflow must be declared before it is included.
45+
# Precompiling it makes it the first include in every consumer, so a
46+
# source's customize() is never seen, its options are never registered,
47+
# and the binary aborts at --dump-workflow with "missing option: ...".
48+
# The link succeeds, so this surfaces as a runtime failure with no hint
49+
# that a PCH caused it.
50+
51+
<array>
52+
<cmath>
53+
<cstdint>
54+
<memory>
55+
<numeric>
56+
<string>
57+
<vector>
58+
)
59+
endif()

‎PWGHF/D2H/TableProducer/CMakeLists.txt‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,63 @@
1313

1414
o2physics_add_dpl_workflow(candidate-creator-b-to-jpsi-reduced
1515
SOURCES candidateCreatorBToJpsiReduced.cxx
16+
REUSE_FROM D2HReducedPCH
1617
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
1718
COMPONENT_NAME Analysis)
1819

1920
o2physics_add_dpl_workflow(candidate-creator-b0-reduced
2021
SOURCES candidateCreatorB0Reduced.cxx
22+
REUSE_FROM D2HReducedPCH
2123
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
2224
COMPONENT_NAME Analysis)
2325

2426
o2physics_add_dpl_workflow(candidate-creator-bplus-reduced
2527
SOURCES candidateCreatorBplusReduced.cxx
28+
REUSE_FROM D2HReducedPCH
2629
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
2730
COMPONENT_NAME Analysis)
2831

2932
o2physics_add_dpl_workflow(candidate-creator-bs-reduced
3033
SOURCES candidateCreatorBsReduced.cxx
34+
REUSE_FROM D2HReducedPCH
3135
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
3236
COMPONENT_NAME Analysis)
3337

3438
o2physics_add_dpl_workflow(candidate-creator-charm-reso-reduced
3539
SOURCES candidateCreatorCharmResoReduced.cxx
40+
REUSE_FROM D2HReducedPCH
3641
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3742
COMPONENT_NAME Analysis)
3843

3944
o2physics_add_dpl_workflow(candidate-creator-lb-reduced
4045
SOURCES candidateCreatorLbReduced.cxx
46+
REUSE_FROM D2HReducedPCH
4147
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
4248
COMPONENT_NAME Analysis)
4349

4450
# Candidate selectors
4551

4652
o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi-reduced
4753
SOURCES candidateSelectorB0ToDPiReduced.cxx
54+
REUSE_FROM D2HReducedPCH
4855
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
4956
COMPONENT_NAME Analysis)
5057

5158
o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi-reduced
5259
SOURCES candidateSelectorBplusToD0PiReduced.cxx
60+
REUSE_FROM D2HReducedPCH
5361
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
5462
COMPONENT_NAME Analysis)
5563

5664
o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi-reduced
5765
SOURCES candidateSelectorBsToDsPiReduced.cxx
66+
REUSE_FROM D2HReducedPCH
5867
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
5968
COMPONENT_NAME Analysis)
6069

6170
o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi-reduced
6271
SOURCES candidateSelectorLbToLcPiReduced.cxx
72+
REUSE_FROM D2HReducedPCH
6373
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
6474
COMPONENT_NAME Analysis)
6575

@@ -74,43 +84,51 @@ o2physics_add_dpl_workflow(ml-based-track-selector
7484

7585
o2physics_add_dpl_workflow(data-creator-charm-had-pi-reduced
7686
SOURCES dataCreatorCharmHadPiReduced.cxx
87+
REUSE_FROM D2HReducedPCH
7788
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils
7889
COMPONENT_NAME Analysis)
7990

8091
o2physics_add_dpl_workflow(data-creator-charm-reso-to-dstar-reduced
8192
SOURCES dataCreatorCharmResoToDstarReduced.cxx
93+
REUSE_FROM D2HReducedPCH
8294
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils KFParticle::KFParticle
8395
COMPONENT_NAME Analysis)
8496

8597
o2physics_add_dpl_workflow(data-creator-charm-reso-to-dplus-reduced
8698
SOURCES dataCreatorCharmResoToDplusReduced.cxx
99+
REUSE_FROM D2HReducedPCH
87100
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils KFParticle::KFParticle
88101
COMPONENT_NAME Analysis)
89102

90103
o2physics_add_dpl_workflow(data-creator-charm-reso-to-d0-reduced
91104
SOURCES dataCreatorCharmResoToD0Reduced.cxx
105+
REUSE_FROM D2HReducedPCH
92106
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils KFParticle::KFParticle
93107
COMPONENT_NAME Analysis)
94108

95109
o2physics_add_dpl_workflow(data-creator-jpsi-had-reduced
96110
SOURCES dataCreatorJpsiHadReduced.cxx
111+
REUSE_FROM D2HReducedPCH
97112
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils
98113
COMPONENT_NAME Analysis)
99114

100115
o2physics_add_dpl_workflow(data-creator-hidden-charm-reduced
101116
SOURCES dataCreatorHiddenCharmReduced.cxx
117+
REUSE_FROM D2HReducedPCH
102118
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils
103119
COMPONENT_NAME Analysis)
104120

105121
# Converters
106122

107123
o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml
108124
SOURCES converterReduced3ProngsMl.cxx
125+
REUSE_FROM D2HReducedPCH
109126
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
110127
COMPONENT_NAME Analysis)
111128

112129
o2physics_add_dpl_workflow(converter-reduced-hadron-daus-pid
113130
SOURCES converterReducedHadronDausPid.cxx
131+
REUSE_FROM D2HReducedPCH
114132
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
115133
COMPONENT_NAME Analysis)
116134

‎PWGHF/D2H/Tasks/CMakeLists.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ o2physics_add_dpl_workflow(task-b0
1616

1717
o2physics_add_dpl_workflow(task-b0-reduced
1818
SOURCES taskB0Reduced.cxx
19+
REUSE_FROM D2HReducedPCH
1920
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
2021
COMPONENT_NAME Analysis)
2122

2223
o2physics_add_dpl_workflow(task-b0-to-jpsi-k0-star-reduced
2324
SOURCES taskB0ToJpsiK0StarReduced.cxx
25+
REUSE_FROM D2HReducedPCH
2426
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
2527
COMPONENT_NAME Analysis)
2628

@@ -31,21 +33,25 @@ o2physics_add_dpl_workflow(task-bplus
3133

3234
o2physics_add_dpl_workflow(task-bplus-reduced
3335
SOURCES taskBplusReduced.cxx
36+
REUSE_FROM D2HReducedPCH
3437
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3538
COMPONENT_NAME Analysis)
3639

3740
o2physics_add_dpl_workflow(task-bplus-to-jpsi-k-reduced
3841
SOURCES taskBplusToJpsiKReduced.cxx
42+
REUSE_FROM D2HReducedPCH
3943
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
4044
COMPONENT_NAME Analysis)
4145

4246
o2physics_add_dpl_workflow(task-bs-reduced
4347
SOURCES taskBsReduced.cxx
48+
REUSE_FROM D2HReducedPCH
4449
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
4550
COMPONENT_NAME Analysis)
4651

4752
o2physics_add_dpl_workflow(task-bs-to-jpsi-phi-reduced
4853
SOURCES taskBsToJpsiPhiReduced.cxx
54+
REUSE_FROM D2HReducedPCH
4955
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
5056
COMPONENT_NAME Analysis)
5157

@@ -66,11 +72,13 @@ o2physics_add_dpl_workflow(task-charm-polarisation
6672

6773
o2physics_add_dpl_workflow(task-charm-reso-to-d-v0-reduced
6874
SOURCES taskCharmResoToDV0Reduced.cxx
75+
REUSE_FROM D2HReducedPCH
6976
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
7077
COMPONENT_NAME Analysis)
7178

7279
o2physics_add_dpl_workflow(task-charm-reso-to-d-trk-reduced
7380
SOURCES taskCharmResoToDTrkReduced.cxx
81+
REUSE_FROM D2HReducedPCH
7482
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
7583
COMPONENT_NAME Analysis)
7684

@@ -116,6 +124,7 @@ o2physics_add_dpl_workflow(task-lb
116124

117125
o2physics_add_dpl_workflow(task-lb-reduced
118126
SOURCES taskLbReduced.cxx
127+
REUSE_FROM D2HReducedPCH
119128
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
120129
COMPONENT_NAME Analysis)
121130

@@ -181,6 +190,7 @@ o2physics_add_dpl_workflow(task-xic0-to-xi-pi
181190

182191
o2physics_add_dpl_workflow(task-hidden-charm
183192
SOURCES taskHiddenCharm.cxx
193+
REUSE_FROM D2HReducedPCH
184194
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
185195
COMPONENT_NAME Analysis)
186196

0 commit comments

Comments
 (0)