2022-09-13 16:02:44 +00:00
|
|
|
/*
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Sheffield Bioinformatics Core Configuration Profile - ShARC
|
|
|
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Custom Pipeline Resource Config for nf-core/atacseq
|
|
|
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2022-09-13 16:08:56 +00:00
|
|
|
// process-specific resource requirements - reduced specification from those in atacseq/conf/base.config
|
2022-09-13 16:02:44 +00:00
|
|
|
|
|
|
|
process {
|
|
|
|
|
2022-09-16 16:29:08 +00:00
|
|
|
// error and retry handling
|
|
|
|
|
|
|
|
errorStrategy = { task.exitStatus in [143,137,104,134,139,140] ? 'retry' : 'finish' }
|
|
|
|
maxRetries = 2
|
|
|
|
|
|
|
|
|
|
|
|
// process labels
|
|
|
|
|
2022-09-13 16:02:44 +00:00
|
|
|
withLabel:process_low {
|
|
|
|
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
|
|
|
|
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
|
|
|
|
time = { check_max( 4.h * task.attempt, 'time' ) }
|
|
|
|
}
|
|
|
|
|
|
|
|
withLabel:process_medium {
|
|
|
|
cpus = { check_max( 4 * task.attempt, 'cpus' ) }
|
|
|
|
memory = { check_max( 8.GB * task.attempt, 'memory' ) }
|
|
|
|
time = { check_max( 6.h * task.attempt, 'time' ) }
|
|
|
|
}
|
|
|
|
|
|
|
|
withLabel:process_high {
|
|
|
|
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
|
2022-09-23 10:08:39 +00:00
|
|
|
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
|
2022-09-13 16:02:44 +00:00
|
|
|
time = { check_max( 8.h * task.attempt, 'time' ) }
|
|
|
|
}
|
|
|
|
|
|
|
|
withLabel:process_long {
|
|
|
|
time = { check_max( 12.h * task.attempt, 'time' ) }
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// function 'check_max()' to ensure that resource requirements don't go beyond maximum limit
|
|
|
|
|
|
|
|
def check_max(obj, type) {
|
|
|
|
if (type == 'memory') {
|
|
|
|
try {
|
|
|
|
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
|
|
|
|
return params.max_memory as nextflow.util.MemoryUnit
|
|
|
|
else
|
|
|
|
return obj
|
|
|
|
} catch (all) {
|
|
|
|
println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj"
|
|
|
|
return obj
|
|
|
|
}
|
|
|
|
} else if (type == 'time') {
|
|
|
|
try {
|
|
|
|
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
|
|
|
|
return params.max_time as nextflow.util.Duration
|
|
|
|
else
|
|
|
|
return obj
|
|
|
|
} catch (all) {
|
|
|
|
println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj"
|
|
|
|
return obj
|
|
|
|
}
|
|
|
|
} else if (type == 'cpus') {
|
|
|
|
try {
|
|
|
|
return Math.min(obj, params.max_cpus as int)
|
|
|
|
} catch (all) {
|
|
|
|
println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj"
|
|
|
|
return obj
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-16 16:29:08 +00:00
|
|
|
|