Add an intdiv method to nextflow.util.MemoryUnit #3114
-
New featureIs it possible to implement an assert 7.GB == (15.GB).intdiv(2) Usage scenarioI would like to assign a long type of value to memory in a process label when the memory allocation is determined programmatically based on another parameter. withLabel:biTenancy {
memory = (params.max_memory - 1.GB).intdiv(2)
} Suggest implementationMemoryUnit intdiv( Number value ) {
return new MemoryUnit( (long)(size.intdiv(value)) )
} |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
MemoryUnit has already a method to divide ('div' ) For example: main.nf
|
Beta Was this translation helpful? Give feedback.
-
Hi @jorgeaguileraseqera thank you for your reply. To clarify, I was wondering if I could pass a long integer in GB to memory without having to converting it to bytes e.g. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late response So If I understand well you can do something as:
|
Beta Was this translation helpful? Give feedback.
-
@jorgeaguileraseqera sorry for the late reply. Yes that may help me solve the problem. Thank you! Please feel free to close the ticket if no further actions would be taken. |
Beta Was this translation helpful? Give feedback.
Sorry for the late response
So If I understand well you can do something as:
nextflow run ./mem.nf --input=123123123123