Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Common/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@ o2physics_add_library(AnalysisCore
FFitWeights.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base O2::DataFormatsParamTOF)

# Precompiled header shared by DPL analysis workflows. Parsing the framework
# headers dominates the cost of a workflow translation unit, and there are
# ~1500 of them; o2physics_add_dpl_workflow reuses this by default.
#
# Skipped under recc, which caches compilations remotely instead -- the two do
# not combine, as a PCH is a local artefact of one compiler invocation.
#
# The link libraries have to match what the reusing targets compile with, so
# this carries only what every workflow already links.
add_library(AnalysisPCH OBJECT analysisPCH.cxx)
target_link_libraries(AnalysisPCH PUBLIC O2::Framework O2Physics::AnalysisCore)
if(NOT DEFINED ENV{USE_RECC})
target_precompile_headers(AnalysisPCH PRIVATE
<Framework/ASoA.h>
<Framework/AnalysisTask.h>
<Framework/ConfigContext.h>
<Framework/DataProcessorSpec.h>
# NOT runDataProcessing.h. It states the contract itself: "we need to
# declare the customize method before include this file". Precompiling it
# makes it the first include in every workflow, so a source's customize() is
# never seen, its options are never registered, and the binary aborts at
# --dump-workflow with "missing option: ...". The link succeeds, so this
# surfaces as a runtime failure with no hint that a PCH caused it.

<memory>
<string>
<vector>
)
endif()

o2physics_target_root_dictionary(AnalysisCore
HEADERS TrackSelection.h
TrackSelectionDefaults.h
Expand Down
14 changes: 14 additions & 0 deletions Common/Core/analysisPCH.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Carrier for the precompiled header shared by DPL analysis workflows; see
// AnalysisPCH in this directory's CMakeLists.txt. It exists only to own the
// PCH, so it has no code of its own.
22 changes: 22 additions & 0 deletions PWGDQ/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,79 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

# tableReader_withAssoc.cxx is 5000 lines of task definitions, and seven
# workflow variants below #include it verbatim -- differing only in which
# adaptAnalysisTask<> entries they list, with identical preprocessor state and
# identical link libraries. Without this it is parsed and instantiated seven
# times, and it is the heaviest thing in the PWG: a cc1plus compiling one of
# these was OOM-killed at ~8 GB RSS.
#
# Skipped under recc, which caches compilations remotely instead.
add_library(TableReaderWithAssocPCH OBJECT tableReaderWithAssocPCH.cxx)
target_link_libraries(TableReaderWithAssocPCH PUBLIC O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore)
if(NOT DEFINED ENV{USE_RECC})
target_precompile_headers(TableReaderWithAssocPCH PRIVATE
[["PWGDQ/Tasks/tableReader_withAssoc.cxx"]])
endif()

o2physics_add_dpl_workflow(table-reader
SOURCES tableReader.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGDQCore O2Physics::MLCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc

Check failure on line 32 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc does not match its file name tableReader_withAssoc_workflowSpec.cxx. (Matches tableReaderWithAssoc.cxx.)
SOURCES tableReader_withAssoc_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-same-event-pairing-barrel-only

Check failure on line 38 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-same-event-pairing-barrel-only does not match its file name tableReader_withAssoc_SameEventPairingBarrelOnly_workflowSpec.cxx. (Matches tableReaderWithAssocSameEventPairingBarrelOnly.cxx.)
SOURCES tableReader_withAssoc_SameEventPairingBarrelOnly_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-same-event-pairing-muon-only

Check failure on line 44 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-same-event-pairing-muon-only does not match its file name tableReader_withAssoc_SameEventPairingMuonOnly_workflowSpec.cxx. (Matches tableReaderWithAssocSameEventPairingMuonOnly.cxx.)
SOURCES tableReader_withAssoc_SameEventPairingMuonOnly_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-same-event-pairing

Check failure on line 50 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-same-event-pairing does not match its file name tableReader_withAssoc_SameEventPairing_workflowSpec.cxx. (Matches tableReaderWithAssocSameEventPairing.cxx.)
SOURCES tableReader_withAssoc_SameEventPairing_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-asymmetric-pairing

Check failure on line 56 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-asymmetric-pairing does not match its file name tableReader_withAssoc_AsymmetricPairing_workflowSpec.cxx. (Matches tableReaderWithAssocAsymmetricPairing.cxx.)
SOURCES tableReader_withAssoc_AsymmetricPairing_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-dilepton-track-pairing

Check failure on line 62 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-dilepton-track-pairing does not match its file name tableReader_withAssoc_DileptonTrackPairing_workflowSpec.cxx. (Matches tableReaderWithAssocDileptonTrackPairing.cxx.)
SOURCES tableReader_withAssoc_DileptonTrackPairing_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-dilepton-track-track-pairing

Check failure on line 68 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-dilepton-track-track-pairing does not match its file name tableReader_withAssoc_DileptonTrackTrackPairing_workflowSpec.cxx. (Matches tableReaderWithAssocDileptonTrackTrackPairing.cxx.)
SOURCES tableReader_withAssoc_DileptonTrackTrackPairing_workflowSpec.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore
REUSE_FROM TableReaderWithAssocPCH
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-reader-with-assoc-direct

Check failure on line 74 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name table-reader-with-assoc-direct does not match its file name tableReader_withAssoc_direct.cxx. (Matches tableReaderWithAssocDirect.cxx.)
SOURCES tableReader_withAssoc_direct.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::MLCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2::DetectorsVertexing O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(efficiency

Check failure on line 79 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name efficiency does not match its file name dqEfficiency.cxx. (Matches efficiency.cxx.)
SOURCES dqEfficiency.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGDQCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(efficiency-with-assoc

Check failure on line 84 in PWGDQ/Tasks/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name efficiency-with-assoc does not match its file name dqEfficiency_withAssoc.cxx. (Matches efficiencyWithAssoc.cxx.)
SOURCES dqEfficiency_withAssoc.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGDQCore
COMPONENT_NAME Analysis)
Expand Down
14 changes: 14 additions & 0 deletions PWGDQ/Tasks/tableReaderWithAssocPCH.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Carrier for the precompiled header shared by the tableReader_withAssoc
// workflow variants; see TableReaderWithAssocPCH in this directory's
// CMakeLists.txt. It exists only to own the PCH.
20 changes: 18 additions & 2 deletions cmake/O2PhysicsAddWorkflow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,24 @@ function(o2physics_add_dpl_workflow baseTargetName)
set_property(TARGET ${targetExeName} PROPERTY JOB_POOL_COMPILE analysis)
set_property(TARGET ${targetExeName} PROPERTY JOB_POOL_LINK analysis)

if(A_REUSE_FROM AND NOT DEFINED ENV{USE_RECC})
target_precompile_headers(${targetExeName} REUSE_FROM ${A_REUSE_FROM})
# Reuse a precompiled header. Without an explicit REUSE_FROM, fall back to the
# shared AnalysisPCH (Common/Core): a workflow translation unit spends most of
# its time parsing the framework headers, and there are ~1500 of them, so the
# default is worth more than the handful of targets that name their own.
#
# Set O2PHYSICS_DEFAULT_PCH to an empty string to opt out globally, e.g. when
# bisecting a PCH-related build failure.
if(NOT DEFINED O2PHYSICS_DEFAULT_PCH)
set(O2PHYSICS_DEFAULT_PCH AnalysisPCH)
endif()
set(_pch "${A_REUSE_FROM}")
if(NOT _pch)
set(_pch "${O2PHYSICS_DEFAULT_PCH}")
endif()
# A target cannot reuse its own PCH, and the carrier is not built when recc
# is caching compilations remotely instead.
if(_pch AND NOT _pch STREQUAL targetExeName AND NOT DEFINED ENV{USE_RECC})
target_precompile_headers(${targetExeName} REUSE_FROM ${_pch})
endif()

set(jsonFile $<TARGET_FILE_BASE_NAME:${targetExeName}>.json)
Expand Down
Loading