diff --git a/conf/base.config b/conf/base.config index ac6fa2a0..5fe07f17 100644 --- a/conf/base.config +++ b/conf/base.config @@ -120,7 +120,7 @@ process { } //MEGAHIT returns exit code 250 when running out of memory withName: MEGAHIT { - cpus = { params.megahit_fix_cpu_1 ? 1 : 8 * task.attempt } + cpus = { params.megahit_fix_cpu_1 ? 1 : check_max(8 * task.attempt, 'cpus') } memory = { check_max(40.GB * task.attempt, 'memory') } time = { check_max(16.h * task.attempt, 'time') } errorStrategy = { task.exitStatus in ((130..145) + 104 + 250) ? 'retry' : 'finish' } @@ -128,14 +128,14 @@ process { //SPAdes returns error(1) if it runs out of memory (and for other reasons as well...)! //exponential increase of memory and time with attempts, keep number of threads to enable reproducibility withName: METASPADES { - cpus = { params.spades_fix_cpus != -1 ? params.spades_fix_cpus : 10 * task.attempt } + cpus = { params.spades_fix_cpus != -1 ? params.spades_fix_cpus : check_max(10 * task.attempt, 'cpus') } memory = { check_max(64.GB * (2 ** (task.attempt - 1)), 'memory') } time = { check_max(24.h * (2 ** (task.attempt - 1)), 'time') } errorStrategy = { task.exitStatus in ((130..145) + 104 + 21 + 12 + 1) ? 'retry' : 'finish' } maxRetries = 5 } withName: METASPADESHYBRID { - cpus = { params.spadeshybrid_fix_cpus != -1 ? params.spadeshybrid_fix_cpus : 10 * task.attempt } + cpus = { params.spadeshybrid_fix_cpus != -1 ? params.spadeshybrid_fix_cpus : check_max(10 * task.attempt, 'cpus') } memory = { check_max(64.GB * (2 ** (task.attempt - 1)), 'memory') } time = { check_max(24.h * (2 ** (task.attempt - 1)), 'time') } errorStrategy = { task.exitStatus in [143, 137, 21, 1] ? 'retry' : 'finish' }