wdecoster / chopper

MIT License
135 stars 11 forks source link

Give minimap more threads when available. #18

Closed Ge0rges closed 5 months ago

Ge0rges commented 10 months ago

Hello,

I noticed that here minimap is only given 8 threads. It would be nice if the threads flag was passed on to minimap.

wdecoster commented 10 months ago

That number only affects the building of the index, not the alignment itself. So changing this will not have too much effect. That said, it shouldn't be hardcoded to '8'. Chopper will, at the moment, when a contaminant is being filtered out, not use multithreading. The reason behind this is because it does not support using rayon. This may change in the future, and pull requests are appreciated.

Ge0rges commented 10 months ago

I'd be happy to give it a crack though I've never worked with rust. I see rayon is the parallelism library. Any tips before I attempt this?

wdecoster commented 10 months ago

Well it shouldn't be done with rayon in this case, as that is not supported for minimap2-rs alignment. There are other options for parallelization, but none that I am sufficiently comfortable with.

jelber2 commented 10 months ago

Here is an example for parallelization

https://github.com/jguhlin/minimap2-rs/blob/main/fakeminimap2/src/main.rs