diff --git a/conf/pipeline/eager/eva.config b/conf/pipeline/eager/eva.config index d96b1306e..b9ca79489 100644 --- a/conf/pipeline/eager/eva.config +++ b/conf/pipeline/eager/eva.config @@ -1,5 +1,10 @@ // Profile config names for nf-core/configs +validation.ignoreParams = [ + 'eager_eva_check_max_func' +] + + params { // Specific nf-core/configs params config_profile_contact = 'James Fellows Yates (@jfy133)' @@ -21,44 +26,44 @@ process { clusterOptions = { "-S /bin/bash -V -j y -o output.log -l h_vmem=${task.memory.toGiga()}G" } withLabel: sc_tiny { - cpus = { check_max(1, 'cpus') } - memory = { check_max(1.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(1.GB * task.attempt, 'memory') } time = '365.d' } withLabel: sc_small { - cpus = { check_max(1, 'cpus') } - memory = { check_max(4.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(4.GB * task.attempt, 'memory') } time = '365.d' } withLabel: sc_medium { - cpus = { check_max(1, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(8.GB * task.attempt, 'memory') } time = '365.d' } withLabel: mc_small { - cpus = { check_max(2, 'cpus') } - memory = { check_max(4.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(2, 'cpus') } + memory = { params.eager_eva_check_max_func(4.GB * task.attempt, 'memory') } time = '365.d' } withLabel: mc_medium { - cpus = { check_max(4, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(4, 'cpus') } + memory = { params.eager_eva_check_max_func(8.GB * task.attempt, 'memory') } time = '365.d' } withLabel: mc_large { - cpus = { check_max(8, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(8, 'cpus') } + memory = { params.eager_eva_check_max_func(16.GB * task.attempt, 'memory') } time = '365.d' } withLabel: mc_huge { - cpus = { check_max(32, 'cpus') } - memory = { check_max(256.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(256.GB * task.attempt, 'memory') } time = '365.d' } @@ -115,7 +120,7 @@ process { withName: markduplicates { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 2)}G" } - memory = { check_max(20.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(20.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -129,7 +134,7 @@ process { withName: additional_library_merge { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 2)}G" } - memory = { check_max(4.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(4.GB * task.attempt, 'memory') } } withName: metagenomic_complexity_filter { @@ -138,8 +143,8 @@ process { withName: malt { clusterOptions = { "-S /bin/bash -V -l h_vmem=1000G" } - cpus = { check_max(32, 'cpus') } - memory = { check_max(955.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(955.GB * task.attempt, 'memory') } } withName: maltextract { @@ -169,7 +174,7 @@ process { withName: damageprofiler { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 2)}G" } - memory = { check_max(8.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(8.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -237,38 +242,38 @@ profiles { clusterOptions = { "-S /bin/bash -V -j y -o output.log -l h_vmem=${task.memory.toGiga()}G" } withLabel: sc_tiny { - cpus = { check_max(1, 'cpus') } - memory = { check_max(1.5.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(1.5.GB * task.attempt, 'memory') } } withLabel: sc_small { - cpus = { check_max(1, 'cpus') } - memory = { check_max(6.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(6.GB * task.attempt, 'memory') } } withLabel: sc_medium { - cpus = { check_max(1, 'cpus') } - memory = { check_max(12.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(12.GB * task.attempt, 'memory') } } withLabel: mc_small { - cpus = { check_max(2, 'cpus') } - memory = { check_max(6.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(2, 'cpus') } + memory = { params.eager_eva_check_max_func(6.GB * task.attempt, 'memory') } } withLabel: mc_medium { - cpus = { check_max(4, 'cpus') } - memory = { check_max(12.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(4, 'cpus') } + memory = { params.eager_eva_check_max_func(12.GB * task.attempt, 'memory') } } withLabel: mc_large { - cpus = { check_max(8, 'cpus') } - memory = { check_max(24.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(8, 'cpus') } + memory = { params.eager_eva_check_max_func(24.GB * task.attempt, 'memory') } } withLabel: mc_huge { - cpus = { check_max(32, 'cpus') } - memory = { check_max(256.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(256.GB * task.attempt, 'memory') } } // Fixes for SGE and Java incompatibility due to (and also some samtools?!) using more memory than you tell it to use @@ -308,7 +313,7 @@ profiles { withName: markduplicates { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 3)}G" } - memory = { check_max(32.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(32.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -322,7 +327,7 @@ profiles { withName: additional_library_merge { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 3)}G" } - memory = { check_max(4.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(4.GB * task.attempt, 'memory') } } withName: metagenomic_complexity_filter { @@ -331,13 +336,13 @@ profiles { withName: malt { clusterOptions = { "-S /bin/bash -V -l h_vmem=1000G" } - cpus = { check_max(32, 'cpus') } - memory = { check_max(955.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(955.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } withName: hostremoval_input_fastq { - memory = { check_max(32.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(32.GB * task.attempt, 'memory') } } withName: maltextract { @@ -367,7 +372,7 @@ profiles { withName: damageprofiler { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 3)}G" } - memory = { check_max(16.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(16.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -418,38 +423,38 @@ profiles { clusterOptions = { "-S /bin/bash -V -j y -o output.log -l h_vmem=${task.memory.toGiga()}G" } withLabel: sc_tiny { - cpus = { check_max(1, 'cpus') } - memory = { check_max(2.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(2.GB * task.attempt, 'memory') } } withLabel: sc_small { - cpus = { check_max(1, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(8.GB * task.attempt, 'memory') } } withLabel: sc_medium { - cpus = { check_max(1, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(1, 'cpus') } + memory = { params.eager_eva_check_max_func(16.GB * task.attempt, 'memory') } } withLabel: mc_small { - cpus = { check_max(2, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(2, 'cpus') } + memory = { params.eager_eva_check_max_func(8.GB * task.attempt, 'memory') } } withLabel: mc_medium { - cpus = { check_max(4, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(4, 'cpus') } + memory = { params.eager_eva_check_max_func(16.GB * task.attempt, 'memory') } } withLabel: mc_large { - cpus = { check_max(8, 'cpus') } - memory = { check_max(32.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(8, 'cpus') } + memory = { params.eager_eva_check_max_func(32.GB * task.attempt, 'memory') } } withLabel: mc_huge { - cpus = { check_max(32, 'cpus') } - memory = { check_max(512.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(512.GB * task.attempt, 'memory') } } // Fixes for SGE and Java incompatibility due to Java using more memory than you tell it to use @@ -489,13 +494,13 @@ profiles { withName: markduplicates { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 6)}G" } - memory = { check_max(48.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(48.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } withName: library_merge { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 6)}G" } - memory = { check_max(6.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(6.GB * task.attempt, 'memory') } } withName: seqtype_merge { @@ -504,11 +509,11 @@ profiles { withName: additional_library_merge { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 6)}G" } - memory = { check_max(6.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(6.GB * task.attempt, 'memory') } } withName: hostremoval_input_fastq { - memory = { check_max(32.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(32.GB * task.attempt, 'memory') } } withName: metagenomic_complexity_filter { @@ -517,8 +522,8 @@ profiles { withName: malt { clusterOptions = { "-S /bin/bash -V -l h_vmem=1000G" } - cpus = { check_max(32, 'cpus') } - memory = { check_max(955.GB * task.attempt, 'memory') } + cpus = { params.eager_eva_check_max_func(32, 'cpus') } + memory = { params.eager_eva_check_max_func(955.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -549,7 +554,7 @@ profiles { withName: damageprofiler { clusterOptions = { "-S /bin/bash -V -l h_vmem=${(task.memory.toGiga() * 6)}G" } - memory = { check_max(32.GB * task.attempt, 'memory') } + memory = { params.eager_eva_check_max_func(32.GB * task.attempt, 'memory') } errorStrategy = { task.exitStatus in [1, 143, 137, 104, 134, 139, 140] ? 'retry' : 'finish' } } @@ -627,31 +632,31 @@ profiles { // Function to ensure that resource requirements don't go beyond // a maximum limit // FOR DSL1 PIPELINE ONLY! -def check_max(obj, type) { +params.eager_eva_check_max_func = { 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 + if (obj.compareTo(params.max_memory as MemoryUnit) == 1) + return params.max_memory as MemoryUnit else return obj - } catch (all) { + } catch (_) { 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 + if (obj.compareTo(params.max_time as Duration) == 1) + return params.max_time as Duration else return obj - } catch (all) { + } catch (_) { 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) { + } catch (_) { println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj" return obj } diff --git a/conf/pipeline/eager/maestro.config b/conf/pipeline/eager/maestro.config index 3db94b099..8ffca42a6 100644 --- a/conf/pipeline/eager/maestro.config +++ b/conf/pipeline/eager/maestro.config @@ -5,6 +5,12 @@ * nextflow run nf-core/eager -profile maestro,,maestro, (where is long or normal and is nuclear, mitocondrial or unlimitedtime) */ +validation { + ignoreParams = [ + 'eager_maestro_check_max_func' + ] +} + params { config_profile_name = 'nf-core/eager nuclear/mitocondrial - human profiles' config_profile_description = "Simple profiles for assessing computational ressources that fit human nuclear dna, human mitogenomes processing. unlimitedtime is also available " @@ -32,41 +38,41 @@ profiles { maxRetries = 2 withName: makeBWAIndex { - cpus = { check_max(8 * task.attempt, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(12.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(8 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(12.h * task.attempt, 'time') } } withName: adapter_removal { - cpus = { check_max(8 * task.attempt, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } - time = { check_max(12.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(8 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(16.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(12.h * task.attempt, 'time') } } withName: bwa { - cpus = { check_max(40 * task.attempt, 'cpus') } - memory = { check_max(40.GB * task.attempt, 'memory') } + cpus = { params.eager_maestro_check_max_func(40 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(40.GB * task.attempt, 'memory') } time = 24.h cache = 'deep' } withName: markduplicates { errorStrategy = { task.exitStatus in [143, 137, 104, 134, 139] ? 'retry' : 'finish' } - cpus = { check_max(16 * task.attempt, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } - time = { check_max(12.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(16 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(16.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(12.h * task.attempt, 'time') } } withName: damageprofiler { cpus = 1 - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(6.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(6.h * task.attempt, 'time') } } withName: fastp { cpus = 8 - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(6.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(6.h * task.attempt, 'time') } } withName: fastqc { cpus = 2 - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(6.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(6.h * task.attempt, 'time') } } } } @@ -77,40 +83,40 @@ profiles { maxRetries = 2 withName: makeBWAIndex { - cpus = { check_max(8 * task.attempt, 'cpus') } - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(12.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(8 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(12.h * task.attempt, 'time') } } withName: adapter_removal { - cpus = { check_max(8 * task.attempt, 'cpus') } - memory = { check_max(16.GB * task.attempt, 'memory') } - time = { check_max(12.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(8 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(16.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(12.h * task.attempt, 'time') } } withName: bwa { - cpus = { check_max(5 * task.attempt, 'cpus') } - memory = { check_max(5.GB * task.attempt, 'memory') } + cpus = { params.eager_maestro_check_max_func(5 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(5.GB * task.attempt, 'memory') } time = 24.h } withName: markduplicates { errorStrategy = { task.exitStatus in [143, 137, 104, 134, 139] ? 'retry' : 'finish' } - cpus = { check_max(5 * task.attempt, 'cpus') } - memory = { check_max(5.GB * task.attempt, 'memory') } - time = { check_max(6.h * task.attempt, 'time') } + cpus = { params.eager_maestro_check_max_func(5 * task.attempt, 'cpus') } + memory = { params.eager_maestro_check_max_func(5.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(6.h * task.attempt, 'time') } } withName: damageprofiler { cpus = 1 - memory = { check_max(5.GB * task.attempt, 'memory') } - time = { check_max(3.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(5.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(3.h * task.attempt, 'time') } } withName: fastp { cpus = 8 - memory = { check_max(5.GB * task.attempt, 'memory') } - time = { check_max(3.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(5.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(3.h * task.attempt, 'time') } } withName: fastqc { cpus = 2 - memory = { check_max(8.GB * task.attempt, 'memory') } - time = { check_max(6.h * task.attempt, 'time') } + memory = { params.eager_maestro_check_max_func(8.GB * task.attempt, 'memory') } + time = { params.eager_maestro_check_max_func(6.h * task.attempt, 'time') } } } } @@ -128,31 +134,31 @@ profiles { // Function to ensure that resource requirements don't go beyond // a maximum limit // FOR DSL1 PIPELINE ONLY! -def check_max(obj, type) { +params.eager_maestro_check_max_func = { 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 + if (obj.compareTo(params.max_memory as MemoryUnit) == 1) + return params.max_memory as MemoryUnit else return obj - } catch (all) { + } catch (_) { 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 + if (obj.compareTo(params.max_time as Duration) == 1) + return params.max_time as Duration else return obj - } catch (all) { + } catch (_) { 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) { + } catch (_) { println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj" return obj } diff --git a/conf/pipeline/methylseq/ku_sund_danhead.config b/conf/pipeline/methylseq/ku_sund_danhead.config index 872cab827..1e1ebd95e 100644 --- a/conf/pipeline/methylseq/ku_sund_danhead.config +++ b/conf/pipeline/methylseq/ku_sund_danhead.config @@ -11,6 +11,6 @@ process { stageInMode = 'copy' } withName: 'NFCORE_METHYLSEQ:METHYLSEQ:BISMARK:BISMARK_ALIGN' { - multicore = 1 + ext.args = '--multicore 1' } } diff --git a/conf/pipeline/proteinfold/nci_gadi.config b/conf/pipeline/proteinfold/nci_gadi.config index f07999c01..b82bb4620 100644 --- a/conf/pipeline/proteinfold/nci_gadi.config +++ b/conf/pipeline/proteinfold/nci_gadi.config @@ -12,8 +12,6 @@ profiles { // Define process resource limits process { executor = 'pbspro' - project = System.getenv("PROJECT") - storage = params.storage_account?.trim() ? params.storage_account : "scratch/${params.project}+gdata/${params.project}" module = 'singularity' cache = 'lenient' stageInMode = 'symlink' @@ -22,7 +20,6 @@ profiles { withName: 'RUN_ALPHAFOLD2|RUN_ALPHAFOLD2_PRED|RUN_ALPHAFOLD2_MSA' { queue = params.use_gpu ? 'gpuvolta' : 'normal' cpus = 48 - gpus = 4 time = '4h' memory = 380.GB } @@ -31,7 +28,6 @@ profiles { container = "nf-core/proteinfold_colabfold:1.1.1" queue = params.use_gpu ? 'gpuvolta' : 'normal' cpus = 48 - gpus = 4 time = '4h' memory = 380.GB } @@ -40,18 +36,16 @@ profiles { container = "nf-core/proteinfold_esmfold:1.1.1" queue = params.use_gpu ? 'gpuvolta' : 'normal' cpus = 48 - gpus = 4 time = '4h' memory = 380.GB } } // Write custom trace file with outputs required for SU calculation - def trace_timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss') trace { enabled = true overwrite = false - file = "./gadi-nf-core-trace-${trace_timestamp}.txt" + file = "./gadi-nf-core-trace-${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.txt" fields = 'name,status,exit,duration,realtime,cpus,%cpu,memory,%mem,rss' } } diff --git a/conf/pipeline/sarek/cfc.config b/conf/pipeline/sarek/cfc.config index b7db254a5..db1c39d4e 100644 --- a/conf/pipeline/sarek/cfc.config +++ b/conf/pipeline/sarek/cfc.config @@ -1,5 +1,7 @@ // Profile config names for nf-core/configs +validation.ignoreParams = ['sarek_cfc_check_resource_func'] + params { // Specific nf-core/configs params config_profile_contact = 'Friederike Hanssen (@FriederikeHanssen)' diff --git a/conf/pipeline/sarek/icr_davros.config b/conf/pipeline/sarek/icr_davros.config index 5e5607581..4caaff472 100644 --- a/conf/pipeline/sarek/icr_davros.config +++ b/conf/pipeline/sarek/icr_davros.config @@ -6,10 +6,6 @@ process { errorStrategy = { task.exitStatus in [104, 134, 137, 139, 141, 143, 255] ? 'retry' : 'finish' } maxRetries = 5 - withName: MapReads { - memory = { check_resource(12.GB) } - time = { check_resource(48.h * task.attempt) } - } } params { diff --git a/conf/utd_juno.config b/conf/utd_juno.config index 373e5f6f1..d9588b6eb 100644 --- a/conf/utd_juno.config +++ b/conf/utd_juno.config @@ -1,3 +1,4 @@ +// Profile config names for nf-core/configs params { config_profile_description = 'University of Texas at Dallas HPC cluster profile provided by nf-core/configs' config_profile_contact = 'Anne Fu' @@ -7,54 +8,13 @@ params { } env { - SINGULARITY_CACHEDIR="/home/$USER/scratch/singularity" + SINGULARITY_CACHEDIR="/home/${System.getenv('USER')}/scratch/singularity" } - -def select_queue_and_flags = { cpus, memory, time, accelerator -> - var accelerator_count = 0; - var accelerator_ty = null; - if (accelerator != null) { - if (accelerator instanceof Number) { - accelerator_count = accelerator; - } else if (accelerator instanceof Map) { - accelerator_ty = accelerator.type; - accelerator_count = accelerator.limit; - } else { - throw new IllegalArgumentException("Invalid `accelerator` directive value: $accelerator [${accelerator.getClass().getName()}]") - } - } - - if (accelerator_count > 0) { - if (["h100", "nvidia_h100", "nvidia-h100", "nvidia_h100_80gb_hbm3"].contains(accelerator_ty)) { - // if this is a long task with a single accelarator, probably need the whole GPU - if (accelerator_count == 1 && time >= 2.h) { - return ['queue': 'h100', 'flags': "--gres=nvidia_h100_80gb_hbm3=${accelerator_count}"]; - } else { - return ['queue': 'h100-2.40gb', 'flags': "--gres=nvidia_h100_80gb_hbm3=${accelerator_count}"]; - } - } - - if (["a30", "nvidia_a30", "nvidia-a30", "nvidia_a30_2g", "nvidia_a30_4g"].contains(accelerator_ty)) { - if (accelerator_count >= 4) { - return ['queue': 'a30-4.6gb', 'flags': "--gres=nvidia_a30=${accelerator_count}"]; - } else if (accelerator_count >= 2) { - return ['queue': 'a30-2.12gb', 'flags': "--gres=nvidia_a30_2g=${accelerator_count}"]; - } else if (accelerator_count >= 1) { - return ['queue': 'a30', 'flags': "--gres=nvidia_a30_1g=${accelerator_count}"]; - } - } - } - - if (memory >= 384.GB && memory <= 512.GB) { - return ['queue': 'h100', 'flags': ""]; - } - - if (memory >= 512.GB) { - return ['queue': 'a30', 'flags': ""]; - } - - return ['queue': 'normal', 'flags': '']; +singularity { + enabled = true + autoMounts = true + cacheDir = "/home/${System.getenv('USER')}/scratch/singularity" } executor { @@ -64,19 +24,49 @@ executor { jobName = { "${task.process.split(':').last()}" } } -singularity { - enabled = true - autoMounts = true - cacheDir = "/home/$USER/scratch/singularity" -} - process { executor = 'slurm' queue = { - select_queue_and_flags(task.cpus, task.memory, task.time, task.get('accelerator')).queue + if (task.get('accelerator')?.type in ['h100', 'nvidia_h100', 'nvidia-h100', 'nvidia_h100_80gb_hbm3']) { + if (task.get('accelerator')?.limit == 1 && task.time >= 2.h) { + return 'h100' + } + return 'h100-2.40gb' + } + if (task.get('accelerator')?.type in ['a30', 'nvidia_a30', 'nvidia-a30', 'nvidia_a30_2g', 'nvidia_a30_4g']) { + if (task.get('accelerator')?.limit >= 4) { + return 'a30-4.6gb' + } + if (task.get('accelerator')?.limit >= 2) { + return 'a30-2.12gb' + } + return 'a30' + } + if (task.memory >= 384.GB && task.memory <= 512.GB) { + return 'h100' + } + if (task.memory >= 512.GB) { + return 'a30' + } + return 'normal' } clusterOptions = { - select_queue_and_flags(task.cpus, task.memory, task.time, task.get('accelerator')).flags + if (task.get('accelerator')?.type in ['h100', 'nvidia_h100', 'nvidia-h100', 'nvidia_h100_80gb_hbm3']) { + if (task.get('accelerator')?.limit == 1 && task.time >= 2.h) { + return "--gres=nvidia_h100_80gb_hbm3=${task.get('accelerator')?.limit}" + } + return "--gres=nvidia_h100_80gb_hbm3=${task.get('accelerator')?.limit}" + } + if (task.get('accelerator')?.type in ['a30', 'nvidia_a30', 'nvidia-a30', 'nvidia_a30_2g', 'nvidia_a30_4g']) { + if (task.get('accelerator')?.limit >= 4) { + return "--gres=nvidia_a30=${task.get('accelerator')?.limit}" + } + if (task.get('accelerator')?.limit >= 2) { + return "--gres=nvidia_a30_2g=${task.get('accelerator')?.limit}" + } + return "--gres=nvidia_a30_1g=${task.get('accelerator')?.limit}" + } + return '' } withLabel: gpu { containerOptions = '--nv'