Repository navigation
Read and format a whole file on threads (ramdump -@ N) - #124
Merged
Merged
Conversation
With no region, ramdump -@ N starts N threads. Each opens the file for itself, without RNTuple's cluster cache, and formats every N-th block of 10,000 records into a text of its own; the texts are written in order, at most 2N waiting. A thread never takes two consecutive blocks, so the name and quality readers decode nothing ahead that another thread needs. On chr20 of NA12878 a full read takes 4.6 s on 8 threads instead of 16.5 s on one; samtools view -@ 8 takes 3.6 s from BAM and 7.7 s from CRAM 3.1.
|
clang-tidy review says "All clean, LGTM! 👍" |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (82.65%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #124 +/- ##
===========================================
- Coverage 89.02% 88.90% -0.13%
===========================================
Files 26 26
Lines 3408 3506 +98
Branches 1155 1198 +43
===========================================
+ Hits 3034 3117 +83
- Misses 196 204 +8
- Partials 178 185 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A full dump of chr20 took 16.5 s on one thread, against 13.6 s for
samtools viewfrom BAMon one thread and 3.6 s on eight. Decoding the columns and building the text both ran on
the thread that writes; only qualities and names were decoded ahead on other threads.
ramdump -@ N, with no region, starts N threads. An RNTuple reader is not shared betweenthreads, so each opens the file for itself and formats every N-th block of records (those
of a block of names and qualities, 10,000 records) into a text of its own; the main thread
writes the texts in order, with at most 2N waiting.
nothing ahead. A first version handed the blocks out as they came, and a thread that got
two in a row started reading ahead blocks that other threads then took: -@ 2 peaked at
729 MB.
decompress the whole cluster of each block it takes.
-c,-@is ignored.NA12878 chr20 at 30x (17.7 million records) on a Xeon E5-2690 v4, pinned to one socket (14
cores), file in the page cache, medians of 5 runs in alternating order:
ramdump -h-@ 2-@ 4-@ 8On the same machine
samtools view -h -@ 8takes 3.6 s from BAM (21.6 s CPU, 94 MB) and7.7 s from CRAM 3.1 (39.4 s CPU, 964 MB). One thread of
-@does all its decoding itself,so
-@ 2gains less than half; past that the time is about the CPU time over N.The output equals the one-thread output, byte for byte, on 1, 2, 3, 4, 8 and 500 threads,
with and without FLAG filters. A new test dumps 25,000 records on three threads and compares.
All tests pass. No format change.