-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect given memory parameter in BBTools processes #36
Comments
Similar issue also applies to other BBTools processes (grep for BBTools
label or Xmx memory string
…On Mon, 1 Jul 2024, 14:53 Michael McLaren, ***@***.***> wrote:
See #29 <#29> for a
description and illustration of the issue. The fix involves generating the
correct bbtools/java memory parameter string from the workflow's
task.memory parameter.
—
Reply to this email directly, view it on GitHub
<#36>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADWVV6UKV6Y2WBELKAPCZQ3ZKGQTNAVCNFSM6AAAAABKGDRMVWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DINJSG42DQMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@willbradshaw a few clarification questions that will help me figure this out: First, I notice sometimes we have process KRAKEN {
label "Kraken2"
cpus 16
memory "${params.mem}"
input: can you explain what that is doing and if it is related to Second, to help me determine how to translate the Third, is there an example you can point to where the If they aren't being used at all yet, then perhaps it would make sense to require that they are specified in the java format to avoid needing to translate from "32.5GB" to "32500m" or "32g" ("-XmX32.5g" is not valid) |
Good question, I had to look this up. I think this is the relevant part of the Nextflow documentation, which states that "You can create a memory unit by adding a unit suffix to an integer, e.g. 1.GB". So I think we can safely assume it will be an integer value, with a 1:1 mapping between unit suffixes in nextflow and those in Java.
As I understand it, it's being used in every process, including KRAKEN; it specifies the amount of memory that process is allowed to use. The problem in the BBTools processes isn't that the memory parameters aren't being used. Rather, it's that the process is only allocated the amount of memory specified by the relevant |
Thanks @willbradshaw , this is very helpful! |
I looked to see how https://github.com/nf-core/mag handles this issue and found this example, bbnorm.sh \\
$input \\
$output \\
$args \\
threads=$task.cpus \\
-Xmx${task.memory.toGiga()}g \\
&> ${prefix}.bbnorm.log Apparently the Nextflow DSL defines a MemoryUnit class that has methods (https://www.nextflow.io/docs/latest/script.html#memoryunit) to help with the conversion, including So my plan is to simply swap in notes for future reference
|
Memory config can be unlimited, e.g. |
@mikemc did you end up getting any further with this? Would you like me to include it in the list of issues for Harmon to work on in Q4? |
I consider the fix I describe above, implemented in 89b2c75, as fixing the issue and is what @evanfields has been using. I think it's an improvement over hard-setting the memory and would suggest making this fix. (This is also the behavior you'd get if you moved to using nf-core BBTools modules). I think I didn't make a pull request because you were in the midst of refactoring. Regarding @jtjvanlunenburg 's question, I'm not really sure if unlimited memory is something you need to handle, but either way I'm guessing making the workflow support setting unlimited memory should be its own new issue and not block fixing the immediate issue. |
Cool, I'll add it to the list. I agree handling unlimited memory isn't a major priority. |
This is now implemented. |
See #29 for a description and illustration of the issue. The fix involves generating the correct bbtools/java memory parameter string from the workflow's
task.memory
parameter.Applies to 'RUN:DEDUP:CLUMPIFY_PAIRED' and other processes that use BBTools scripts
The text was updated successfully, but these errors were encountered: