Skip to content

Commit

Permalink
Add example of overriding cluster config defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Nov 12, 2019
1 parent 81e734e commit 530c462
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
21 changes: 18 additions & 3 deletions code/myworkflow.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@ samples, = glob_wildcards("data/sample_{sample}.txt")

rule targets:
input:
expand("results/result_{sample}.txt", sample = samples)
expand("results/sample_{sample}_sleep.txt", sample = samples)

rule copy:
input:
"data/sample_{sample}.txt"
txt="data/sample_{sample}.txt"
output:
"results/result_{sample}.txt"
txt="results/sample_{sample}_copy.txt"
shell:
"cp {input} {output}"

rule sleep:
input:
rules.copy.output.txt
output:
"results/sample_{sample}_sleep.txt"
shell:
"""
echo "Imagine that this is a job with more intensive resource requirements..."
time sleep 5s > {output}
"""

rule clean:
shell:
"rm results/*"
2 changes: 1 addition & 1 deletion code/submit-pbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#PBS -m abe ## when to send email a=abort b=job begin e=job end
#PBS -j oe ## send output and error information to the email listed above
#PBS -V ## IMPORTANT always use this. send environment setup to node job will be run on
#PBS -o logfiles/ ## write output/error logfile(s) to this dir
#PBS -o log/hpc ## write output/error logfile(s) to this dir
#
# Include the next three lines always
if [ "x${PBS_NODEFILE}" != "x" ] ; then
Expand Down
3 changes: 3 additions & 0 deletions code/submit-slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@
#SBATCH --mail-user=your_email
#SBATCH --mail-type=BEGIN,END

#### where to write log files

#SBATCH --output=log/hpc/
snakemake --profile config/slurm --latency-wait 20 -s code/myworkflow.smk
6 changes: 5 additions & 1 deletion config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
"mailon": "a",
"mail_type": "FAIL",
"jobout": "oe",
"outdir": "logfiles/hpc/"
"outdir": "log/hpc/"
}
"sleep": {
"walltime": "24:00:00",
"pmem": "2GB"
}
File renamed without changes.

0 comments on commit 530c462

Please sign in to comment.