Skip to content

Commit

Permalink
Update README.md with rayon and multithreading section
Browse files Browse the repository at this point in the history
  • Loading branch information
jguhlin committed Nov 26, 2024
1 parent 3f399ef commit 9615652
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ let mappings: Result<Vec<Mapping>> = aligner.map_file("query.fa", false, false);
## Multithreading
Multithreading is supported, for implementation example see [fakeminimap2](https://github.com/jguhlin/minimap2-rs/blob/main/fakeminimap2/src/main.rs). Minimap2 also supports threading itself, and will use a minimum of 3 cores for building the index. Multithreading for mapping is left to the end-user.

Adjust the number of threads used to build the index:
```rust
let mut aligner = Aligner::builder()
.map_ont()
.with_index_threads(8);
```

### Experimental Rayon support
This _appears_ to work.
This _appears_ to work. See [fakeminimap2](https://github.com/jguhlin/minimap2-rs/tree/main/fakeminimap2) for full implementation.

```rust
use rayon::prelude::*;
Expand All @@ -116,6 +117,9 @@ let results = sequences.par_iter().map(|seq| {
}).collect::<Vec<_>>();
```

### Arc cloning the Aligner
Also works. Otherwise directly cloning the aligner will Arc clone the internal index.

## Features
The following crate features are available:
* map-file - Enables the ability to map a file directly to a reference. Enabled by deafult
Expand Down

0 comments on commit 9615652

Please sign in to comment.