Skip to content

Parallelize idXML writing with deterministic output - #10430

Merged
timosachsenberg merged 1 commit into
OpenMS:refactor/xmlhandler-user-param-valuefrom
timosachsenberg:extract/idxml-parallel-writer
Oct 6, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:refactor/xmlhandler-user-param-valuefrom
timosachsenberg:extract/idxml-parallel-writer

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

IdXMLFile::store() currently scans all peptide identifications for each run, copies hits to sort them, and resolves metadata names repeatedly. This extracts the parallel writer from #10403: assign peptides to runs once, cache metadata names per worker, sort hit indices, and write formatted blocks in input order with at most 16 workers. Worker failures are caught and the earliest failing block's exception is rethrown after the parallel region.

Depends on #10427. This PR targets refactor/xmlhandler-user-param-value to keep the XMLHandler helper out of the review diff. Retarget to develop after that PR merges. The extraction leaves #10403 unchanged.

Validation:

  • Local GCC 13.3.0 targeted native build: the changed IdXMLFile/XMLHandler sources compiled with Debug assertions and OpenMP; IdXMLFile_test and XMLHandler_test both passed.
  • Regression coverage includes multiple runs, omitted identifications, tied/NaN scores, all metadata types, annotations, unknown accessions and concurrent conversion failures.
  • Release baseline and candidate writer sources were compiled locally with identical flags and linked against the same remaining code from the pyOpenMS 3.6.0 bundled libOpenMS. This is targeted native validation, not a full OpenMS rebuild.
  • git diff --check and Python harness syntax checks passed.

Benchmarks against develop fe7b9cc0e5: 30,000 peptide identifications produced by repeating each repository fixture 10,000 times; 5 measured repetitions per arm/configuration after a warmup; alternating arm order. AMD EPYC 9V74, 9 visible CPUs, an 8-CPU cgroup quota, overlay filesystem. All output hashes match across arms, repetitions and thread counts.

Fixture Threads Baseline (s) Candidate (s) Speedup
ProSE_1_out: one run, 30,000 hits, 107.6 MB 1 0.6246 0.5517 1.13x
ProSE_1_out 4 0.6519 0.2659 2.45x
ProSE_1_out 16 0.6383 0.2352 2.71x
IdXMLFile_whole: two runs, 50,000 hits, 10.8 MB 1 0.1316 0.1214 1.08x
IdXMLFile_whole 4 0.1304 0.0765 1.70x
IdXMLFile_whole 16 0.1340 0.1094 1.23x

At 4 threads, process peak RSS remained approximately 133 MiB for ProSE and 70 MiB for the two-run fixture. RSS includes input loading and scaling. Timing measures store(), including stream close/flush but excluding fsync.

These are synthetic fixture repetitions, not a diverse real-data benchmark. Sixteen threads oversubscribe the CPU quota and are slower than four on the two-run fixture. Tiny files show no reliable gain; the one-thread unscaled ProSE case took 0.557 ms versus 0.452 ms. Benchmark code and raw result files are kept outside the PR; only the production change, regression tests and changelog are committed.

Assign peptides to runs once, cache metadata names per worker, and
format ordered blocks in parallel. Preserve hit order and propagate
the earliest worker failure. Include regression tests and changelog.

Depends on the XMLHandler serialization helper in OpenMS#10427.
Local native IdXMLFile_test and XMLHandler_test passed.
Paired benchmark measurements are documented in the PR description.
@timosachsenberg
timosachsenberg force-pushed the extract/idxml-parallel-writer branch from f69dfb3 to de4087b Compare October 6, 2026 09:13
@timosachsenberg
timosachsenberg merged commit 8e9b258 into OpenMS:refactor/xmlhandler-user-param-value Oct 6, 2026
1 check passed
timosachsenberg added a commit that referenced this pull request Oct 6, 2026
* [INTERNAL] Extract XMLHandler user parameter value writer

* [INTERNAL,TEST] Extract parallel idXML writer from #10403 (#10430)

Assign peptides to runs once, cache metadata names per worker, and
format ordered blocks in parallel. Preserve hit order and propagate
the earliest worker failure. Include regression tests and changelog.

Depends on the XMLHandler serialization helper in #10427.
Local native IdXMLFile_test and XMLHandler_test passed.
Paired benchmark measurements are documented in the PR description.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant