Skip to content

Commit ea5069e

Browse files
committed
More explicit cpu-hour handling
1 parent aa247b6 commit ea5069e

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

main.nf

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ if (!bamindex) {
4848
module 'bioinfo-tools'
4949
module "$params.modules.samtools"
5050

51-
// We only need one core for this part
5251
executor choose_executor()
5352
queue 'core'
54-
time params.short_job
53+
time params.runtime.simple
5554

5655
when: 'indexbam' in workflowSteps
5756

@@ -79,7 +78,7 @@ process manta {
7978
module "$params.modules.manta"
8079

8180
errorStrategy { task.exitStatus == 143 ? 'retry' : 'terminate' }
82-
time { params.long_job * 2**(task.attempt-1) }
81+
time { params.runtime.caller * 2**(task.attempt-1) }
8382
maxRetries 3
8483
queue 'core'
8584
cpus 4
@@ -116,10 +115,9 @@ if (!params.fastq) {
116115
module 'bioinfo-tools'
117116
module "$params.modules.samtools"
118117

119-
// We only need one core for this part
120118
executor choose_executor()
121119
queue 'core'
122-
time params.short_job
120+
time params.runtime.simple
123121

124122
when: 'fastq' in workflowSteps
125123

@@ -142,6 +140,11 @@ process fermikit {
142140

143141
publishDir params.outdir, mode: 'copy'
144142

143+
errorStrategy { task.exitStatus == 143 ? 'retry' : 'terminate' }
144+
time { params.runtime.fermikit * 2**( task.attempt - 1 ) }
145+
maxRetries 3
146+
queue 'node'
147+
145148
module 'bioinfo-tools'
146149
module "$params.modules.fermikit"
147150
module "$params.modules.samtools"
@@ -184,10 +187,9 @@ process mask_beds {
184187

185188
publishDir params.outdir, mode: 'copy'
186189

187-
// Does not use many resources, run it locally
188190
executor choose_executor()
189191
queue 'core'
190-
time params.short_job
192+
time params.runtime.simple
191193

192194
module 'bioinfo-tools'
193195
module "$params.modules.bedtools"
@@ -220,10 +222,9 @@ process intersect_files {
220222

221223
publishDir params.outdir, mode: 'copy'
222224

223-
// Does not use many resources, run it locally
224225
executor choose_executor()
225226
queue 'core'
226-
time params.short_job
227+
time params.runtime.simple
227228

228229
module 'bioinfo-tools'
229230
module "$params.modules.bedtools"
@@ -261,7 +262,7 @@ process variant_effect_predictor {
261262

262263
executor choose_executor()
263264
queue 'core'
264-
time params.short_job
265+
time params.runtime.simple
265266

266267
module 'bioinfo-tools'
267268
module "$params.modules.vep"
@@ -322,10 +323,9 @@ process snpEff {
322323
module 'bioinfo-tools'
323324
module "$params.modules.snpeff"
324325

325-
// Does not use many resources, run it locally
326326
executor choose_executor()
327327
queue 'core'
328-
time params.short_job
328+
time params.runtime.simple
329329

330330
when: 'snpeff' in workflowSteps
331331

@@ -371,8 +371,6 @@ def usage_message() {
371371
log.info ' --steps Specify what steps to run, comma separated:'
372372
log.info ' Callers: manta, fermikit, cnvnator (choose one or many)'
373373
log.info ' Annotation: vep OR snpeff'
374-
log.info ' --long_job Running time for long job (callers, fermi and manta)'
375-
log.info ' --short_job Running time for short jobs (bam indexing and bam2fq)'
376374
log.info ' --outdir Directory where resultfiles are stored'
377375
log.info ''
378376
}
@@ -439,6 +437,8 @@ def nextflow_running_as_slurmjob() {
439437
return false
440438
}
441439

440+
/* If the nextflow deamon is running as a slurm job, we can use the local CPU
441+
* for a lot of our work */
442442
def choose_executor() {
443443
return nextflow_running_as_slurmjob() ? 'local' : 'slurm'
444444
}

nextflow.config

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ params {
2525
assembly = "GRCh37"
2626
}
2727

28-
long_job = '10h' // used for the callers (fermikit & manta)
29-
short_job = '30m' // used for bam indexing and bam2fq
28+
runtime {
29+
simple = '30m' // Short simple shell jobs
30+
fermikit = '24h' // Fermikit is the longest running of them all
31+
caller = '10h' // The rest are a lot quicker
32+
}
3033
}
3134

3235
process {
3336
executor = 'slurm'
34-
time = params.long_job
35-
queue = "node"
3637
clusterOptions = {
3738
"-A $params.project"
3839
}

0 commit comments

Comments
 (0)