Skip to content

Commit

Permalink
also wrap-up 1st attempt in check_max function to avoid requesting mo…
Browse files Browse the repository at this point in the history
…re than what is allowed
  • Loading branch information
fmalmeida committed Feb 16, 2024
1 parent db878fb commit a9c4358
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ process {
// Assemblies will first try to adjust themselves to a parallel execution
// If it is not possible, then it waits to use all the resources allowed
withLabel:process_assembly {
cpus = { if (task.attempt == 1) { params.start_asm_cpus } else { params.max_cpus } }
memory = { if (task.attempt == 1) { params.start_asm_mem } else { params.max_memory } }
cpus = { if (task.attempt == 1) { check_max( params.start_asm_cpus, 'cpus' ) } else { params.max_cpus } }
memory = { if (task.attempt == 1) { check_max( params.start_asm_mem , 'memory' ) } else { params.max_memory } }

// retry at least once to try it with full resources
errorStrategy = { task.exitStatus in [1,21,143,137,104,134,139,247] ? 'retry' : 'finish' }
Expand All @@ -48,9 +48,9 @@ process {
def quast_mem = ((params.start_asm_mem / 2) > 6.GB) ? (params.start_asm_mem / 2) : 6.GB
def quast_cpus = ((params.start_asm_cpus / 2) > 4 ) ? (params.start_asm_mem / 2) : 4
withName:quast {
cpus = { if (task.attempt == 1) { quast_cpus } else { params.max_cpus } }
memory = { if (task.attempt == 1) { quast_mem } else { params.max_memory } }
time = { if (task.attempt == 1) { check_max( 12.h * task.attempt, 'time' ) } else { params.max_time } }
cpus = { if (task.attempt == 1) { check_max( params.quast_cpus, 'cpus' ) } else { params.max_cpus } }
memory = { if (task.attempt == 1) { check_max( params.quast_mem , 'memory' ) } else { params.max_memory } }
time = { if (task.attempt == 1) { check_max( 12.h * task.attempt, 'time' ) } else { params.max_time } }

// retry at least once to try it with full resources
errorStrategy = { task.exitStatus in [21,143,137,104,134,139,247] ? 'retry' : 'finish' }
Expand Down

0 comments on commit a9c4358

Please sign in to comment.