1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-11-22 16:29:55 +00:00

Move cluster options creating closure out of process scope

This commit is contained in:
Pontus Freyhult 2021-04-08 09:45:29 +02:00
parent 4d64db85eb
commit fa1b4cb412

View file

@ -11,7 +11,6 @@ singularity {
def hostname = "sinfo --local -N -h | head -1 | cut -f1 -d' ' ".execute().text.trim() def hostname = "sinfo --local -N -h | head -1 | cut -f1 -d' ' ".execute().text.trim()
process {
// closure to create a suitable clusterOptions // closure to create a suitable clusterOptions
def clusterOptionsCreator = { m -> def clusterOptionsCreator = { m ->
String base = "-A $params.project ${params.clusterOptions ?: ''}" String base = "-A $params.project ${params.clusterOptions ?: ''}"
@ -19,9 +18,11 @@ process {
if (m < 125.GB || hostname ==~ "i.*") { if (m < 125.GB || hostname ==~ "i.*") {
return base return base
} }
if (m < 250.GB) { if (m < 250.GB) {
return base + " -p node -C mem256GB " return base + " -p node -C mem256GB "
} }
// Remaining cases use the largest available node (1 Tbyte for rackham, 512 Gbyte for others) // Remaining cases use the largest available node (1 Tbyte for rackham, 512 Gbyte for others)
if (hostname ==~ "r.*") { if (hostname ==~ "r.*") {
return base + " -p node -C mem1TB " return base + " -p node -C mem1TB "
@ -29,7 +30,7 @@ process {
return base + " -p node -C mem512GB " return base + " -p node -C mem512GB "
} }
process {
executor = 'slurm' executor = 'slurm'
clusterOptions = { clusterOptionsCreator(task.memory) } clusterOptions = { clusterOptionsCreator(task.memory) }
} }