Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 12 additions & 45 deletions conf/incliva.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,18 @@ params {
config_profile_description = 'INCLIVA Health Research Institute profile for nf-core.'
config_profile_contact = 'Sheila Zúñiga Trejos - bioinfo@incliva.es'
config_profile_url = 'https://www.incliva.es/en/services/platforms/bioinformatics-unit/'
}

// Function to get hostname
def getHostname() {
def process = 'hostname'.execute()
process.waitFor()
return process.text.trim()
}

// Function to set singularity path according to which host nextflow is running on

def hostname = { getHostname() }

if (hostname == 'vlinuxcervantes3srv') {
System.out.println("\nINFO: working on ${hostname}\n")

// Resources details
params.max_memory = 60.GB
params.max_cpus = 15
singularity.cacheDir = "/nfs/home/software/singularity/nf_cacheDir"

process {
resourceLimits = [
memory: 60.GB,
cpus: 15,
]
}

} else if (hostname == 'vlinuxcervantes4srv') {
System.out.println("\nINFO: working on ${hostname}.\n")

// Resources details
params.max_memory = 120.GB
params.max_cpus = 19
singularity.cacheDir = "/nfs/home/software/singularity/nf_cacheDir"

process {
resourceLimits = [
memory: 120.GB,
cpus: 19,
]
}

} else {
System.err.println("\nERROR: unknown machine. Update incliva.config on nf-core/configs if you are working on another host.\n")
system_hostname = 'hostname'.execute().text.trim() ?: 'unknown'
max_memory = params.system_hostname == 'vlinuxcervantes3srv' ? 60.GB
: params.system_hostname == 'vlinuxcervantes4srv' ? 120.GB
: System.err.println("\nERROR: unknown machine. Update incliva.config on nf-core/configs if you are working on another host.\n")
max_cpus = params.system_hostname == 'vlinuxcervantes3srv' ? 15
: params.system_hostname == 'vlinuxcervantes4srv' ? 19
: System.err.println("\nERROR: unknown machine. Update incliva.config on nf-core/configs if you are working on another host.\n")
}

// Singularity details
singularity {
cacheDir = "/nfs/home/software/singularity/nf_cacheDir"
enabled = true
autoMounts = true
}
Expand All @@ -60,4 +23,8 @@ singularity {
process {
executor = 'local'
maxRetries = 2
resourceLimits = params.max_memory && params.max_cpus ? [
memory: params.max_memory,
cpus: params.max_cpus
] : System.err.println("\nERROR: unknown machine. Update incliva.config on nf-core/configs if you are working on another host.\n")
}
Loading