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