mirror of
https://github.com/MillironX/nf-configs.git
synced 2024-12-22 02:38:16 +00:00
Complete check_max()
move to global config
This commit is contained in:
parent
a19d79f6ff
commit
6f0d9e6c43
6 changed files with 2 additions and 47 deletions
|
@ -202,7 +202,6 @@ Currently documentation is available for the following pipelines within specific
|
|||
- [MUNIN](docs/pipeline/rnavar/munin.md)
|
||||
- sarek
|
||||
- [MUNIN](docs/pipeline/sarek/munin.md)
|
||||
- [SAGE BIONETWORKS](docs/pipeline/sarek/sage.md)
|
||||
- [UPPMAX](docs/pipeline/sarek/uppmax.md)
|
||||
- taxprofiler
|
||||
- [EVA](docs/pipeline/taxprofiler/eva.md)
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
params {
|
||||
config_profile_description = 'The Sage Bionetworks profile'
|
||||
config_profile_contact = 'Bruno Grande (@BrunoGrandePhD)'
|
||||
config_profile_url = 'https://github.com/Sage-Bionetworks-Workflows'
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -67,7 +67,7 @@ def slow(attempt, factor = 2) {
|
|||
|
||||
|
||||
// Function to ensure that resource requirements don't go
|
||||
// beyond a maximum limit
|
||||
// beyond a maximum limit (copied here for Sarek v2)
|
||||
def check_max(obj, type) {
|
||||
if (type == 'memory') {
|
||||
try {
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# nf-core/configs: Sage Bionetworks Sarek-Specific Configuration
|
||||
|
||||
To use this custom configuration, run the pipeline with `-profile sage`. This will download and load the [`sage.config`](../conf/sage.config), which contains a number of optimizations relevant to Sage employees running workflows on AWS (_e.g._ using Nextflow Tower). This profile will also load any applicable pipeline-specific configuration.
|
||||
|
||||
In addition to the global configuration described [here](../../sage.md), this Sarek-specific configuration includes the following tweaks:
|
||||
|
||||
- Define the `check_max()` function, which is missing in Sarek v2.
|
|
@ -9,6 +9,7 @@ This global configuration includes the following tweaks:
|
|||
- Enable retries by default when exit codes relate to insufficient memory
|
||||
- Allow pending jobs to finish if the number of retries are exhausted
|
||||
- Slow the increase in the number of allocated CPU cores on retries
|
||||
- Define the `check_max()` function, which is missing in Sarek v2
|
||||
|
||||
## Additional information about iGenomes
|
||||
|
||||
|
|
|
@ -15,5 +15,4 @@ profiles {
|
|||
cfc { includeConfig "${params.custom_config_base}/conf/pipeline/sarek/cfc.config" }
|
||||
cfc_dev { includeConfig "${params.custom_config_base}/conf/pipeline/sarek/cfc.config" }
|
||||
eddie { includeConfig "${params.custom_config_base}/conf/pipeline/sarek/eddie.config" }
|
||||
sage { includeConfig "${params.custom_config_base}/conf/pipeline/sarek/sage.config" }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue