generated from carpentries/workbench-template-rmd
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from carpentries-incubator/cluster_snakefiles
Cluster snakefiles
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Run a bunch of Amdahl jobs and aggregate the output. | ||
# | ||
WIDTHS=[1,2] | ||
# | ||
def getwidth(wildcards): | ||
return wildcards.sample | ||
|
||
rule plot: | ||
input: expand('{size}.out',size=WIDTHS) | ||
output: 'done.out' | ||
resources: | ||
mpi="mpirun", | ||
tasks=1 | ||
shell: 'echo "{WIDTHS}, Done!" > done.out' | ||
rule iterate: | ||
input: | ||
output: '{sample}.out' | ||
resources: | ||
mpi="mpirun", | ||
tasks=getwidth | ||
shell: | ||
"module load OpenMPI; mpirun -np {resources.tasks} amdahl > {wildcards.sample}.out" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Iterative example. | ||
# | ||
NAMES=['one','two','three'] | ||
# | ||
rule done: | ||
input: expand('{name}.out',name=NAMES) | ||
output: 'done.out' | ||
shell: 'echo "Done!" > done.out' | ||
rule iterate: | ||
input: | ||
output: '{sample}.out' | ||
shell: 'echo {output} > {output}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# snakemake -j 3 --cluster "sbatch -N 1 -n {resources.tasks} -p node" | ||
cluster: | ||
sbatch | ||
--partition=node | ||
--nodes=1 | ||
--tasks={resources.tasks} |