annotate 0.2.0/conf/modules.config @ 17:b571995ddb51

planemo upload
author kkonganti
date Mon, 15 Jul 2024 19:01:29 -0400
parents a5f31c44f8c9
children
rev   line source
kkonganti@11 1 process {
kkonganti@11 2 publishDir = [
kkonganti@11 3 path: {
kkonganti@11 4 "${task.process.tokenize(':')[-1].toLowerCase()}" == "multiqc" ?
kkonganti@11 5 "${params.output}${params.fs}${params.pipeline.toLowerCase()}-${task.process.tokenize(':')[-1].toLowerCase()}" :
kkonganti@11 6 "${params.output}${params.fs}${task.process.tokenize(':')[-1].toLowerCase()}"
kkonganti@11 7 },
kkonganti@11 8 mode: params.publish_dir_mode,
kkonganti@11 9 overwrite: params.publish_dir_overwrite,
kkonganti@11 10 saveAs: { filename -> filename =~ /^versions.yml|.+?_mqc.*/ ? null : filename }
kkonganti@11 11 ]
kkonganti@11 12
kkonganti@11 13 errorStrategy = {
kkonganti@11 14 ![0].contains(task.exitStatus) ? dynamic_retry(task.attempt, 10) : 'finish'
kkonganti@11 15 }
kkonganti@11 16
kkonganti@11 17 maxRetries = 0
kkonganti@11 18 resourceLabels = {[
kkonganti@11 19 process: task.process,
kkonganti@11 20 memoryRequested: task.memory.toString(),
kkonganti@11 21 cpusRequested: task.cpus.toString()
kkonganti@11 22 ]}
kkonganti@11 23
kkonganti@11 24 withLabel: 'process_femto' {
kkonganti@11 25 cpus = { 1 * task.attempt }
kkonganti@11 26 memory = { 1.GB * task.attempt }
kkonganti@11 27 time = { 1.h * task.attempt }
kkonganti@11 28 }
kkonganti@11 29
kkonganti@11 30 withLabel: 'process_pico' {
kkonganti@11 31 cpus = { min_cpus(2) * task.attempt }
kkonganti@11 32 memory = { 4.GB * task.attempt }
kkonganti@11 33 time = { 2.h * task.attempt }
kkonganti@11 34 }
kkonganti@11 35
kkonganti@11 36 withLabel: 'process_nano' {
kkonganti@11 37 cpus = { min_cpus(4) * task.attempt }
kkonganti@11 38 memory = { 8.GB * task.attempt }
kkonganti@11 39 time = { 4.h * task.attempt }
kkonganti@11 40 }
kkonganti@11 41
kkonganti@11 42 withLabel: 'process_micro' {
kkonganti@11 43 cpus = { min_cpus(8) * task.attempt }
kkonganti@11 44 memory = { 16.GB * task.attempt }
kkonganti@11 45 time = { 8.h * task.attempt }
kkonganti@11 46 }
kkonganti@11 47
kkonganti@11 48 withLabel: 'process_only_mem_low' {
kkonganti@11 49 cpus = { 1 * task.attempt }
kkonganti@11 50 memory = { 60.GB * task.attempt }
kkonganti@11 51 time = { 20.h * task.attempt }
kkonganti@11 52 }
kkonganti@11 53
kkonganti@11 54 withLabel: 'process_only_mem_medium' {
kkonganti@11 55 cpus = { 1 * task.attempt }
kkonganti@11 56 memory = { 100.GB * task.attempt }
kkonganti@11 57 time = { 30.h * task.attempt }
kkonganti@11 58 }
kkonganti@11 59
kkonganti@11 60 withLabel: 'process_only_mem_high' {
kkonganti@11 61 cpus = { 1 * task.attempt }
kkonganti@11 62 memory = { 120.GB * task.attempt }
kkonganti@11 63 time = { 60.h * task.attempt }
kkonganti@11 64 }
kkonganti@11 65
kkonganti@11 66 withLabel: 'process_low' {
kkonganti@11 67 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 68 memory = { 60.GB * task.attempt }
kkonganti@11 69 time = { 20.h * task.attempt }
kkonganti@11 70 }
kkonganti@11 71
kkonganti@11 72 withLabel: 'process_medium' {
kkonganti@11 73 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 74 memory = { 100.GB * task.attempt }
kkonganti@11 75 time = { 30.h * task.attempt }
kkonganti@11 76 }
kkonganti@11 77
kkonganti@11 78 withLabel: 'process_high' {
kkonganti@11 79 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 80 memory = { 120.GB * task.attempt }
kkonganti@11 81 time = { 60.h * task.attempt }
kkonganti@11 82 }
kkonganti@11 83
kkonganti@11 84 withLabel: 'process_higher' {
kkonganti@11 85 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 86 memory = { 225.GB * task.attempt }
kkonganti@11 87 time = { 60.h * task.attempt }
kkonganti@11 88 }
kkonganti@11 89
kkonganti@11 90 withLabel: 'process_gigantic' {
kkonganti@11 91 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 92 memory = { 500.GB * task.attempt }
kkonganti@11 93 time = { 60.h * task.attempt }
kkonganti@11 94 }
kkonganti@11 95 }
kkonganti@11 96
kkonganti@11 97 if ( ( (params.input || params.metadata ) && params.pipeline ) ||
kkonganti@11 98 ( params.pipeline.toString().equalsIgnoreCase('cronology_db') && params.output ) ) {
kkonganti@11 99 try {
kkonganti@11 100 includeConfig "${params.workflowsconf}${params.fs}process${params.fs}${params.pipeline}.process.config"
kkonganti@11 101 } catch (Exception e) {
kkonganti@11 102 System.err.println('-'.multiply(params.linewidth) + "\n" +
kkonganti@11 103 "\033[0;31m${params.cfsanpipename} - ERROR\033[0m\n" +
kkonganti@11 104 '-'.multiply(params.linewidth) + "\n" + "\033[0;31mCould not load " +
kkonganti@11 105 "default pipeline's process configuration. Please provide a pipeline \n" +
kkonganti@11 106 "name using the --pipeline option.\n\033[0m" + '-'.multiply(params.linewidth) + "\n" + e + "\n")
kkonganti@11 107 System.exit(1)
kkonganti@11 108 }
kkonganti@11 109 }
kkonganti@11 110
kkonganti@11 111 // Function will return after sleeping for some time.
kkonganti@11 112 // Sleep time increases exponentially by task attempt.
kkonganti@11 113 def dynamic_retry(task_retry_num, factor_by) {
kkonganti@11 114 // sleep(Math.pow(2, task_retry_num.toInteger()) * factor_by.toInteger() as long)
kkonganti@11 115 sleep(Math.pow(1.27, task_retry_num.toInteger()) as long)
kkonganti@11 116 return 'retry'
kkonganti@11 117 }
kkonganti@11 118
kkonganti@11 119 // Function that will adjust the minimum number of CPU
kkonganti@11 120 // cores depending as requested by the user.
kkonganti@11 121 def min_cpus(cores) {
kkonganti@11 122 return Math.min(cores as int, "${params.max_cpus}" as int)
kkonganti@11 123 }