Skip to content

Use std::threads instead of TBB tasks in the o2-sim hit merger - #15871

Merged
sawenzel merged 1 commit into
AliceO2Group:devfrom
sawenzel:swenzel/hitmerger-no-tbb-threads
Sep 30, 2026
Merged

sawenzel merged 1 commit into
AliceO2Group:devfrom
sawenzel:swenzel/hitmerger-no-tbb-threads

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

This fixes a crash of the o2-sim hit merger at the end of a run.

  • The concurrent flush of kinematics and detector files used a tbb::task_group and tbb::parallel_for_each.
  • It runs on a merger IO thread that is created anew for every merge batch.
  • When such a thread exits, TBB releases its thread pool and can segfault in pthread_detach.
  • The flush now uses std::threads that are joined before the function returns.

This fixes a crash of the o2-sim hit merger at the end of a run.

- The concurrent flush of kinematics and detector files used a tbb::task_group and tbb::parallel_for_each.
- It runs on a merger IO thread that is created anew for every merge batch.
- When such a thread exits, TBB releases its thread pool and can segfault in pthread_detach.
- The flush now uses std::threads that are joined before the function returns.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sawenzel
sawenzel requested a review from a team as a code owner September 30, 2026 11:23
@sawenzel

Copy link
Copy Markdown
Collaborator Author

Validated on the GRID with the QED stages of the LHC22k4_nightly workflow (20 timeframes per job, 30 jobs per arm, submitted together):

jobs with a merger segfault
release merger (daily-20260929-0000) 17 / 30
this PR 0 / 30

The crash disappears with the std::thread flush.

@sawenzel
sawenzel merged commit 5f6b5b7 into AliceO2Group:dev Sep 30, 2026
9 of 11 checks passed
@sawenzel
sawenzel deleted the swenzel/hitmerger-no-tbb-threads branch September 30, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant