-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_slurm.sh
executable file
·40 lines (35 loc) · 1.58 KB
/
run_slurm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Helper to run snakemake workflow
# if no parameter passed to script, run all
if [[ $# -eq 0 ]] ; then
target='all'
else
target="$@"
fi
echo "Targets: $target"
# make sure output folder for log files exists
if [ ! -d snakelogs ]; then
mkdir snakelogs
fi
if [ ! -d slurmlogs ]; then
mkdir slurmlogs
fi
snakemake \
--rerun-triggers mtime \
--use-singularity \
--use-conda \
--jobs 999 `# limit on jobs in parallel` \
--scheduler greedy `# circumvent stuck on 'select jobs' bug` \
--keep-going `# Go on with independent jobs if a job fails.` \
--latency-wait 60 \
--cluster-config "config/slurm.yaml" \
`# command to send to batch with dependencies` \
--cluster "sbatch --partition={cluster.partition} \
--job-name={cluster.job-name} \
--ntasks=1 \
--cpus-per-task={cluster.cpus} \
--mem={cluster.mem} \
--time={cluster.time} \
--output={cluster.output} \
--error={cluster.error}" \
$target