cancerit / PCAP-core

NGS reference implementations and helper code for mapping (originally part of ICGC-TCGA-PanCancer)
GNU General Public License v2.0
9 stars 10 forks source link

Is it worth breaking up bwa_mem.pl into more steps? #61

Closed jsmedmar closed 4 years ago

jsmedmar commented 4 years ago

This is the CPU utilization profile of bwa_mem.pl aligning a 180 coverage genome from a BAM file using -bm2 on a 64 cpus machine, using -threads 64 for all steps.

My questions are:

I'm now running bwa_mem.pl using the -process and -index flags which facilitates requesting the right amount of compute resources per step, but wanted to check on these two points.


The actual running stats:

 Split                              Bwamem                        
    Count |    Time* |   Memory        Count |    Time* |   Memory
        n |    total |    total            n |    total |    total
        1 | 3h22m38s |    45.8G            1 | 10h9m23s |   141.0G

 Mark                               Stats
    Count |    Time* |   Memory        Count |    Time* |   Memory
        n |    total |    total            n |    total |    total
        1 |  4h1m43s |     6.4G            1 |       0s |    65.5M
keiranmraine commented 4 years ago

If you look at the underlying commands you will find that the trailing ends are reading from a pipe. Yes, they could be split further, however you'd add a round trip of the data to disk.

stats is a no-op step (other than some cleanup) since a recent switch around, but is left in place for backwards-compat.

jsmedmar commented 4 years ago

Ok Keiran, thanks so much for the clarification. Any clue why the mark step seems to use exactly half of the -threads passed?

keiranmraine commented 4 years ago

The marking step (many items in samtools) will only use threads for compression. We don't run single lanes with more than 8-10 threads for any step, and when bwa-mem2 is finally stable we'll probably drop to 6.