Open eldadkd opened 5 months ago
this is an unfortunate quick of the Nextflow compiler. when you declare a variable with def
, it gets defined as a global variable
likely needs to be addressed by #4613 or a subsequent iteration
I forgot to mention that if I remove those lines:
taskMemory = task.memory.toGiga()
println("taskMemory from inside the calculateCPUs: $taskMemory")
overrideValue
is null as expected
I would say just always declare local variables with def
unless you actually want it to be global
Bug report
Expected behavior and actual behavior
Expected behavior:
println("calculateCPUs overrideValue = $overrideValue")
should print: alculateCPUs overrideValue = nullActual behavior: what prints out is:
calculateCPUs overrideValue = 1 GB
Steps to reproduce the problem
running this nf script:
and this script:
after calling this line
taskMemory = task.memory.toGiga()
oncalculateCPUs
method overrideValue value is changed from null to the value given tocalculateMem
Program output
Environment