mirror of
https://github.com/MillironX/nf-configs.git
synced 2024-11-25 17:29:55 +00:00
Move cluster options creating closure out of process scope
This commit is contained in:
parent
4d64db85eb
commit
fa1b4cb412
1 changed files with 19 additions and 18 deletions
|
@ -11,25 +11,26 @@ singularity {
|
|||
|
||||
def hostname = "sinfo --local -N -h | head -1 | cut -f1 -d' ' ".execute().text.trim()
|
||||
|
||||
// closure to create a suitable clusterOptions
|
||||
def clusterOptionsCreator = { m ->
|
||||
String base = "-A $params.project ${params.clusterOptions ?: ''}"
|
||||
// Do not use -p node on irma or if a thin node/core is enough
|
||||
if (m < 125.GB || hostname ==~ "i.*") {
|
||||
return base
|
||||
}
|
||||
|
||||
if (m < 250.GB) {
|
||||
return base + " -p node -C mem256GB "
|
||||
}
|
||||
|
||||
// Remaining cases use the largest available node (1 Tbyte for rackham, 512 Gbyte for others)
|
||||
if (hostname ==~ "r.*") {
|
||||
return base + " -p node -C mem1TB "
|
||||
}
|
||||
return base + " -p node -C mem512GB "
|
||||
}
|
||||
|
||||
process {
|
||||
// closure to create a suitable clusterOptions
|
||||
def clusterOptionsCreator = { m ->
|
||||
String base = "-A $params.project ${params.clusterOptions ?: ''}"
|
||||
// Do not use -p node on irma or if a thin node/core is enough
|
||||
if (m < 125.GB || hostname ==~ "i.*") {
|
||||
return base
|
||||
}
|
||||
if (m < 250.GB) {
|
||||
return base + " -p node -C mem256GB "
|
||||
}
|
||||
// Remaining cases use the largest available node (1 Tbyte for rackham, 512 Gbyte for others)
|
||||
if (hostname ==~ "r.*") {
|
||||
return base + " -p node -C mem1TB "
|
||||
}
|
||||
return base + " -p node -C mem512GB "
|
||||
}
|
||||
|
||||
|
||||
executor = 'slurm'
|
||||
clusterOptions = { clusterOptionsCreator(task.memory) }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue