/*
* -------------------------------------------------
*  nf-core/proteomicslfq Nextflow big-nodes config file
* -------------------------------------------------
* A 'big-nodes' config file, appropriate for general
* use on most high performace compute environments with datasets with big RAW
* files. This configuration is used for big mzML files and datasets where
* the size of the mzML is higher than 10GB. It also contains parameters
* for error handling. For example, errorStrategyError = 130 is used also
* from LSF is use as a code exit.
*
    * This config is used mainly in PRIDE LSF cluster.
*/

process {

    cpus = {check_max(2 * task.attempt, 'cpus')}
    memory = {check_max(8.GB * task.attempt, 'memory')}
    time = {check_max(4.h * task.attempt, 'time')}

    errorStrategy = {task.exitStatus in [143, 137, 104, 134, 139, 130] ?'retry' : 'finish' }
    maxRetries = 2
    maxErrors = '-1'

    // Process-specific resource requirements
    withLabel:process_very_low {
        cpus = {check_max(2 * task.attempt, 'cpus')}
        memory = {check_max(6.GB * task.attempt, 'memory')}
        time = {check_max(3.h * task.attempt, 'time')}
    }
    withLabel:process_low {
        cpus = {check_max(4 * task.attempt, 'cpus')}
        memory = {check_max(32.GB * task.attempt, 'memory')}
        time = {check_max(6.h * task.attempt, 'time')}
    }
    withLabel:process_medium {
        cpus = {check_max(8 * task.attempt, 'cpus')}
        memory = {check_max(64.GB * task.attempt, 'memory')}
        time = {check_max(8.h * task.attempt, 'time')}
    }
    withLabel:process_high {
        cpus = {check_max(12 * task.attempt, 'cpus')}
        memory = {check_max(100.GB * task.attempt, 'memory')}
        time = {check_max(10.h * task.attempt, 'time')}
    }
    withLabel:process_long {
        time = {check_max(20.h * task.attempt, 'time')}
    }
    withLabel:process_single_thread {
        cpus = {check_max(1 * task.attempt, 'cpus')}
    }
    withName:get_software_versions {
        cache = false
    }
}

