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

Enable multithreading to avoid 6hr time-out during github action #45

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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
3 changes: 3 additions & 0 deletions ingest/profiles/default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cores: all
printshellcmds: true
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not asking for a change

In case it's not clear, these configs are not necessary when running the builds with the Nextstrain CLI via nextstrain build.

  1. CLI will use all cores if the --cpus option is not provided (ref).
  2. The --printshellcmds flag is passed to snakemake by default (ref)

rerun-incomplete: true
2 changes: 2 additions & 0 deletions ingest/rules/nextclade.smk
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ rule nextclade_classify:
dataset=config["nextclade"]["nextclade_dataset_path"],
output:
nextclade_tsv="data/nextclade_results/nextclade.tsv",
threads: workflow.cores,
shell:
"""
nextclade3 run \
--input-dataset {input.dataset} \
--output-tsv {output.nextclade_tsv} \
--jobs {threads:q} \
--silent \
{input.sequences}
"""
Expand Down
3 changes: 3 additions & 0 deletions phylogenetic/profiles/default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cores: all
printshellcmds: true
rerun-incomplete: true
5 changes: 2 additions & 3 deletions phylogenetic/rules/construct_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ rule tree:
"logs/tree.txt",
benchmark:
"benchmarks/tree.txt"
params:
threads = workflow.cores,
threads: workflow.cores
shell:
"""
augur tree \
--alignment {input.alignment} \
--output {output.tree} \
--method raxml \
--nthreads {threads} 2>&1 | tee {log}
--nthreads {threads:q} 2>&1 | tee {log}
"""

rule refine:
Expand Down
5 changes: 2 additions & 3 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ rule align:
"logs/align.txt",
benchmark:
"benchmarks/align.txt"
params:
threads = workflow.cores
threads: workflow.cores
shell:
"""
augur align \
--sequences {input.sequences} \
--output {output.alignment} \
--fill-gaps \
--reference-sequence {input.reference} \
--nthreads {threads} 2>&1 | tee {log}
--nthreads {threads:q} 2>&1 | tee {log}
"""