Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: use manifest CSVs with MultiCollection etc. #11

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
714 changes: 357 additions & 357 deletions 01.basic-benchmarks.ipynb

Large diffs are not rendered by default.

878 changes: 439 additions & 439 deletions 02.basic-benchmarks-seaborn.ipynb

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
## command to get file sizes
# Benchmarks for branchwater paper

This repo contains the benchmarking code for

[Sourmash Branchwater Enables Lightweight Petabyte-Scale Sequence Search](https://dib-lab.github.io/2022-paper-branchwater-software/) ([github repo](https://github.com/dib-lab/2022-paper-branchwater-software/)), Irber et al., 2022.

[doi: 10.1101/2022.11.02.514947](https://www.biorxiv.org/content/10.1101/2022.11.02.514947v1.full)

## Running

Allocate 64 threads and 64 GB:
```!
srun -p high2 --time=72:00:00 --nodes=1 --cpus-per-task 64 --mem 80GB --pty bash
```

then run the snakemake workflow:
```
snakemake -c 64 -p -s benchmarking.snakefile --resources only_one_job=1 -k
```

## appendix

### command to get file sizes

```
find . -type f -printf "%k %p\n" | tee ~/scratch/magsearch/ls-wort.txt
Expand Down
102 changes: 57 additions & 45 deletions benchmarking.snakefile
Original file line number Diff line number Diff line change
@@ -1,172 +1,184 @@
sra_search_bin="/home/ctbrown/scratch/magsearch/bin/searcher"
#sra_search_bin="/home/ctbrown/scratch/magsearch/bin/searcher"
manysearch_cmd = "sourmash scripts manysearch "
#manysearch_cmd = "sourmash scripts manysearch --ignore-abundance"

rule all:
input:
expand("benchmarks/{x}_vs_{y}.txt", x=['a'],
y=['a', 'b', 'c', 'd', 'e']),
expand("outputs/output_{x}_vs_{y}.csv", x=['a'],
y=['a', 'b', 'c', 'd', 'e']),

rule big:
input:
expand("benchmarks/a_vs_a_1000_t{t}.txt", t=[4,8,16]),
"outputs/output_a_vs_largest_10k.csv",
expand("benchmarks/a_vs_catalog.txt"),
expand("benchmarks/a_{n}_vs_a.txt", n=range(100, 1000, 100)),
expand("benchmarks/a_vs_a_{n}.txt", n=range(1000, 10000, 1000)),
expand("benchmarks/a_vs_a_1000_t{t}.txt", t=[4,8,16]),
expand("benchmarks/a_vs_catalog.txt"),

rule threads:
input:
expand("benchmarks/a_vs_a_1000_t{t}.txt", t=[4,8,16,24,32,40,48,56,64]),


rule a_vs_a:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-a.txt",
output:
csv="outputs/output_a_vs_a.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_a.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_sub_vs_a:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a-{n}.sigs.txt",
against="data/wort-list-a.txt",
output:
csv="outputs/output_a_{n}_vs_a.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_{n}_vs_a.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_a_sub:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-a-{n}.txt",
output:
csv="outputs/output_a_vs_a_{n}.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_a_{n}.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_b:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-b.txt",
output:
csv="outputs/output_a_vs_b.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_b.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_c:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-c.txt",
output:
csv="outputs/output_a_vs_c.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_c.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_d:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-d.txt",
against="wort-list.d.mf.csv",
output:
csv="outputs/output_a_vs_d.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_d.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_e:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-e.txt",
output:
csv="outputs/output_a_vs_e.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_e.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_largest:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-largest-10k.txt",
output:
csv="outputs/output_a_vs_largest_10k.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_largest_10k.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads}
"""

rule a_vs_a_sub_threads:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/wort-list-a-{n}.txt",
output:
csv="outputs/output_a_vs_a_{n}_t{thr}.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_a_{n}_t{thr}.txt"
threads: 64
threads: 64 # max out threads so nothing else running
shell: """
export RAYON_NUM_THREADS={wildcards.thr}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against}
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {wildcards.thr}
"""


rule a_vs_catalog:
input:
bin=sra_search_bin,
queries="data/gtdb-list-a.sigs.txt",
against="data/metagenomes-catalog.txt",
output:
csv="outputs/output_a_vs_catalog.csv",
resources:
only_one_job=1,
benchmark:
"benchmarks/a_vs_catalog.txt"
threads: 32
shell: """
export RAYON_NUM_THREADS={threads}
{input.bin} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} || true
{manysearch_cmd} -k 31 --scaled=1000 -o {output.csv} \
{input.queries} {input.against} -c {threads} || true
"""
2 changes: 0 additions & 2 deletions benchmarks/a_100_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_200_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_300_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_400_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_500_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_600_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_700_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_800_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_900_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t16.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t36.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t4.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t40.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t44.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t48.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t52.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t56.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t60.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t64.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_1000_t8.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_2000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_3000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_4000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_5000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_6000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_7000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_8000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_a_9000.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_b.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_c.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_catalog.txt

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/a_vs_d.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
s h:m:s max_rss max_vms max_uss max_pss io_in io_out mean_load cpu_time
1505.0091 0:25:05 16107.48 19187.17 16137.28 16137.32 93738.74 1.02 2605.24 39209.39
559.7348 0:09:19 38303.28 110077.33 38193.48 38200.80 34302.56 160.97 2433.26 13623.33
2 changes: 0 additions & 2 deletions benchmarks/a_vs_e.txt

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/a_vs_largest_10k.txt

This file was deleted.

13 changes: 13 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: branchwater-bench
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- sourmash>=4.8.3,<5
- snakemake-minimal>=7,<8
- pip
- rust
- maturin>=1,<2
- pip:
- pyo3_branchwater==0.7.0
Loading