@@ -10,19 +10,19 @@ USAGE:
1010 -b SINGULARITY_BIND_PATHS \\
1111 -t TMP_DIR
1212SYNOPSIS:
13- This script creates/submits the pipeline's master job to the
14- cluster. The master job acts as the pipeline's main controller or
15- its main process. This main job dictates how subsequent jobs are
13+ This script creates/submits the pipeline's master job to the
14+ cluster. The master job acts as the pipeline's main controller or
15+ its main process. This main job dictates how subsequent jobs are
1616submitted to the cluster via the job scheduler, SLURM. Support for
1717additional job schedulers (i.e. PBS, SGE, LSF, Tibanna) may be added
1818in the future.
19- The main entry point of the pipeline calls this job submission
20- wrapper script. As so, this script can be used to by-pass a previously
21- failed run; meaning, it can be used to re-run the pipeline to pick back
19+ The main entry point of the pipeline calls this job submission
20+ wrapper script. As so, this script can be used to by-pass a previously
21+ failed run; meaning, it can be used to re-run the pipeline to pick back
2222off where the last failure occurred or re-start the pipeline.
2323 Please Note: it is highly recommended to use the main entry point of
2424the pipeline instead of directly invoking this script. As so, please use
25- main entry point of the pipeline. If you are experiencing an error, it
25+ main entry point of the pipeline. If you are experiencing an error, it
2626maybe due to improperly mounting singularity bind paths which the main
2727entry point will internally handle. Only advanced users should directly
2828invoke this script.
@@ -31,39 +31,39 @@ Required Positional Argument:
3131 Valid mode options include: <slurm, ...>
3232 slurm: uses slurm and singularity/snakemake
3333 backend. This EXECUTOR will submit child
34- jobs to the cluster. It is recommended
35- running the pipeline in this mode, as most
34+ jobs to the cluster. It is recommended
35+ running the pipeline in this mode, as most
3636 of the steps are computationally intensive.
3737Required Arguments:
3838 -o, --outdir [Type: Path] Path to output directory of the pipeline.
3939 This is the pipeline's working directory
4040 where all output files will be generated.
4141 -j, --job-name [Type: Str] Name of pipeline's master job.
4242 -b, --bind-paths [Type:Path] Singularity bind paths. The pipeline uses
43- singularity images for exection. Bind
44- paths are used to mount the host file
45- system to the container's file system.
46- Multiple bind paths can be provided as
47- a comma seperated list. The main entry
43+ singularity images for exection. Bind
44+ paths are used to mount the host file
45+ system to the container's file system.
46+ Multiple bind paths can be provided as
47+ a comma seperated list. The main entry
4848 point of the pipeline internally collects
4949 and aggregates bind paths to mount to the
50- container's filesystem.
50+ container's filesystem.
5151 If you are manually running this script
52- or by-passing the main entry point, you
53- will need to provide the bind paths of
54- the rawdata directory(s) along with the
52+ or by-passing the main entry point, you
53+ will need to provide the bind paths of
54+ the rawdata directory(s) along with the
5555 pipeline's output directory and any other
56- directories for reference files. Please see
56+ directories for reference files. Please see
5757 example usage below.
5858 -t, --tmp-dir [Type:Path] Temporary directory. The pipeline generates
59- intermediate, temporary output files. Any
59+ intermediate, temporary output files. Any
6060 temporary output files will be written to
61- this location. On Biowulf, it should be
61+ this location. On Biowulf, it should be
6262 set to '/lscratch/\$ SLURM_JOBID/'. On FRCE,
63- this value should be set to the following:
64- '/scratch/cluster_scratch/\$ USER/'.
63+ this value should be set to the following:
64+ '/scratch/cluster_scratch/\$ USER/'.
6565OPTIONS:
66- -c, --cache [Type: Path] Path to singularity cache. If not provided,
66+ -c, --cache [Type: Path] Path to singularity cache. If not provided,
6767 the path will default to the current working
6868 directory of this script.
6969 [Default: $( dirname " $0 " ) /.singularity/]
@@ -172,6 +172,7 @@ function submit(){
172172 # Create a local singularity cache in output directory
173173 # cache can be re-used instead of re-pulling from DockerHub everytime
174174 cd " $3 " && export SINGULARITY_CACHEDIR=" ${5} "
175+ ts=$( date +%Y%m%d-%H%M%S)
175176
176177 # unsetting XDG_RUNTIME_DIR to avoid some unsighly but harmless warnings
177178 unset XDG_RUNTIME_DIR
@@ -182,43 +183,43 @@ function submit(){
182183 # Create directory for logfiles
183184 mkdir -p " $3 " /logfiles/slurmfiles/
184185 # Submit the master job to the cluster
185- # sbatch --parsable -J {jobname} --time=5-00:00:00 --mail-type=BEGIN,END,FAIL
186- # --cpus-per-task=24 --mem=96g --gres=lscratch:500
187- # --output os.path.join({outdir}, 'logfiles', 'snakemake.log') --error os.path.join({outdir}, 'logfiles', 'snakemake.log')
188- # snakemake -pr --latency-wait 120 -d {outdir} --configfile=config.json
189- # --cluster-config os.path.join({outdir}, 'config', 'cluster.json')
190- # --cluster {CLUSTER_OPTS} --stats os.path.join({outdir}, 'logfiles', 'runtime_statistics.json')
191- # --printshellcmds --keep-going --rerun-incomplete
192- # --keep-remote --restart-times 3 -j 500 --use-singularity
186+ # sbatch --parsable -J {jobname} --time=5-00:00:00 --mail-type=BEGIN,END,FAIL
187+ # --cpus-per-task=24 --mem=96g --gres=lscratch:500
188+ # --output os.path.join({outdir}, 'logfiles', 'snakemake.log') --error os.path.join({outdir}, 'logfiles', 'snakemake.log')
189+ # snakemake -pr --latency-wait 120 -d {outdir} --configfile=config.json
190+ # --cluster-config os.path.join({outdir}, 'config', 'cluster.json')
191+ # --cluster {CLUSTER_OPTS} --stats os.path.join({outdir}, 'logfiles', 'runtime_statistics.json')
192+ # --printshellcmds --keep-going --rerun-incomplete
193+ # --keep-remote --restart-times 3 -j 500 --use-singularity
193194 # --singularity-args -B {}.format({bindpaths}) --local-cores 24
194195 SLURM_DIR=" $3 /logfiles/slurmfiles"
195196 CLUSTER_OPTS=" sbatch --gres {cluster.gres} --cpus-per-task {cluster.threads} -p {cluster.partition} -t {cluster.time} --mem {cluster.mem} --job-name={params.rname} -e $SLURM_DIR /slurm-%j_{params.rname}.out -o $SLURM_DIR /slurm-%j_{params.rname}.out {cluster.ntasks} {cluster.ntasks_per_core} {cluster.exclusive}"
196197 # Check if NOT running on Biowulf
197- # Assumes other clusters do NOT
198+ # Assumes other clusters do NOT
198199 # have GRES for local node disk,
199- # long term it might be worth
200- # adding a new option to allow
201- # a user to decide whether to
200+ # long term it might be worth
201+ # adding a new option to allow
202+ # a user to decide whether to
202203 # use GRES at job submission,
203204 # trying to infer this because
204205 # most users will not even know
205206 # what GRES is and how or why
206207 # it should be used and by default
207- # SLURM is not configured to use
208+ # SLURM is not configured to use
208209 # GRES, remove prefix single quote
209210 if [[ ${6# \' } != /lscratch* ]]; then
210211 CLUSTER_OPTS=" sbatch --cpus-per-task {cluster.threads} -p {cluster.partition} -t {cluster.time} --mem {cluster.mem} --job-name={params.rname} -e $SLURM_DIR /slurm-%j_{params.rname}.out -o $SLURM_DIR /slurm-%j_{params.rname}.out {cluster.ntasks} {cluster.ntasks_per_core} {cluster.exclusive}"
211212 fi
212213 cat << EOF > kickoff.sh
213214#!/usr/bin/env bash
214- #SBATCH --cpus-per-task=16
215- #SBATCH --mem=96g
215+ #SBATCH --cpus-per-task=16
216+ #SBATCH --mem=64g
216217#SBATCH --time=5-00:00:00
217218#SBATCH --parsable
218219#SBATCH -J "$2 "
219220#SBATCH --mail-type=BEGIN,END,FAIL
220- #SBATCH --output "$3 /logfiles/snakemake .log"
221- #SBATCH --error "$3 /logfiles/snakemake .log"
221+ #SBATCH --output "$3 /logfiles/snakemake_ ${ts} .log"
222+ #SBATCH --error "$3 /logfiles/snakemake_ ${ts} .log"
222223set -euo pipefail
223224# Main process of pipeline
224225snakemake --latency-wait 120 -s "$3 /workflow/Snakefile" -d "$3 " \\
0 commit comments