-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
188 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
process { | ||
|
||
cpus = { check_max( 2 * task.attempt, 'cpus' ) } | ||
memory = { check_max( 8.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 4.h * task.attempt, 'time' ) } | ||
|
||
errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } | ||
maxRetries = 1 | ||
maxErrors = '-1' | ||
|
||
// Process-specific resource requirements | ||
// NOTE - Please try and re-use the labels below as much as possible. | ||
// These labels are used and recognised by default in DSL2 files hosted on nf-core/modules. | ||
// If possible, it would be nice to keep the same label naming convention when | ||
// adding in your local modules too. | ||
// See https://www.nextflow.io/docs/latest/config.html#config-process-selectors | ||
withLabel:process_single { | ||
cpus = { check_max( 1 , 'cpus' ) } | ||
memory = { check_max( 6.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 4.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_very_low { | ||
cpus = { check_max( 2 * task.attempt, 'cpus' ) } | ||
memory = { check_max( 6.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 3.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_low { | ||
cpus = { check_max( 4 * task.attempt, 'cpus' ) } | ||
memory = { check_max( 12.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 6.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_medium { | ||
cpus = { check_max( 8 * task.attempt, 'cpus' ) } | ||
memory = { check_max( 36.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 8.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_high { | ||
cpus = { check_max( 12 * task.attempt, 'cpus' ) } | ||
memory = { check_max( 72.GB * task.attempt, 'memory' ) } | ||
time = { check_max( 16.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_long { | ||
time = { check_max( 20.h * task.attempt, 'time' ) } | ||
} | ||
withLabel:process_high_memory { | ||
memory = { check_max( 200.GB * task.attempt, 'memory' ) } | ||
} | ||
withLabel:error_ignore { | ||
errorStrategy = 'ignore' | ||
} | ||
withLabel:error_retry { | ||
errorStrategy = 'retry' | ||
maxRetries = 2 | ||
} | ||
} | ||
|
||
params { | ||
// Defaults only, expecting to be overwritten | ||
max_memory = 128.GB | ||
max_cpus = 16 | ||
max_time = 240.h | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
|
||
params { | ||
chunksize = 1000000 | ||
output_prefix_file = "psm" | ||
file_num = 20 | ||
partitions = "" | ||
} | ||
|
||
|
||
includeConfig 'conf/base.config' | ||
|
||
profiles { | ||
docker { | ||
docker.enabled = true | ||
conda.enabled = false | ||
singularity.enabled = false | ||
podman.enabled = false | ||
shifter.enabled = false | ||
charliecloud.enabled = false | ||
apptainer.enabled = false | ||
docker.runOptions = '-u $(id -u):$(id -g)' | ||
} | ||
arm { | ||
docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' | ||
} | ||
singularity { | ||
singularity.enabled = true | ||
singularity.autoMounts = true | ||
conda.enabled = false | ||
docker.enabled = false | ||
podman.enabled = false | ||
shifter.enabled = false | ||
charliecloud.enabled = false | ||
apptainer.enabled = false | ||
} | ||
|
||
ebislurm{ | ||
conda.enable = false | ||
docker.enabled = false | ||
singularity.enabled = true | ||
executor { | ||
name = "slurm" | ||
queueSize = 1000 | ||
submitRateLimit = "10/1sec" | ||
exitReadTimeout = "30 min" | ||
jobName = { | ||
task.name // [] and " " not allowed in lsf job names | ||
.replace("[", "(") | ||
.replace("]", ")") | ||
.replace(" ", "_") | ||
} | ||
} | ||
singularity.autoMounts = false | ||
singularity.runOptions = '-B /hps/nobackup/juan/pride/reanalysis:/hps/nobackup/juan/pride/reanalysis' | ||
singularity.cacheDir = "/hps/nobackup/juan/pride/reanalysis/singularity/" | ||
} | ||
} | ||
|
||
// Function to ensure that resource requirements don't go beyond | ||
// a 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 | ||
} | ||
} | ||
} |