Skip to content
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

Fix mem sort for HISAT2 output #158

Merged
merged 12 commits into from
Feb 28, 2019
Merged

Fix mem sort for HISAT2 output #158

merged 12 commits into from
Feb 28, 2019

Conversation

apeltzer
Copy link
Member

Copying in the conversation from nf-core slack:

So we keep seeing some issues with the RNAseq workflow when sorting the hisat2 output - memory requested on the server seems to be higher than what is provided, thus the jobs get killed by the scheduler...
e.g. something like Excceed job memory limit 63348736 > 82914560
which happens here

rnaseq/main.nf

Line 676 in e837637

-@ ${task.cpus} $avail_mem \\

I'd suggest dropping this memory request, as I never really saw issues without it in other pipelines sorting BAM files...
Sarek e.g. does this somewhat similar thing to set it permanently to 2G https://github.com/SciLifeLab/Sarek/blob/88921e6944604d077afd8a5bc0a89b8e93937313/main.nf#L174
Suggestions ?

@apeltzer apeltzer requested a review from a team February 18, 2019 13:41
@ewels
Copy link
Member

ewels commented Feb 18, 2019

Wow, that's like 30% over... Are you sure that the final script is actually using the -m flag? Note that it can be empty depending on the config.

We should probably at least leave some overhead from that calculation though at the very least.

@apeltzer
Copy link
Member Author

Hm, what I thought when looking at the command is that the -m <XYZ> flag isn't used at the moment. The command simply states the $avail_mem instead of using the -m $avail_mem value, which might cause some trouble too for big bam files? Maybe that is the real reason?

I'd also be happy to compute the avail_mem as is and then deduct something as you mentioned it - let me know and I'll adapt it, maybe trying first to just incorporate the -m switch ?

@ewels
Copy link
Member

ewels commented Feb 18, 2019

I think the -m flag is inside that variable, no? It's intentional - so that the -m flag isn't left empty if we don't know what memory the process has.

@apeltzer
Copy link
Member Author

apeltzer commented Feb 18, 2019

It is indeed - I changed to using - 100000000 as in hisat, star and other memory intensive processes to keep hopefully within the limits 👍 Sorry my bad, I didn't see it...

@ewels
Copy link
Member

ewels commented Feb 18, 2019

Nice! Is it possible for you to test this before merging to see if it fixes the problem? Or should we just merge?

@apeltzer
Copy link
Member Author

I can let Silvia test tomorrow 👍

@apeltzer
Copy link
Member Author

We're testing at the moment - will keep you posted on updates

@apeltzer
Copy link
Member Author

Local testing revealed that this seems to work fine even for weird samples that were not running beforehand 👍

main.nf Outdated
@@ -671,11 +671,11 @@ if(params.aligner == 'hisat2'){
file "where_are_my_files.txt"

script:
def avail_mem = task.memory ? "-m ${task.memory.toBytes() / task.cpus}" : ''
def avail_mem = task.memory ? "-m ${(task.memory.toBytes() - 6000000000) / task.cpus}" : ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Could you just add in some extra code that checks that this isn't a negative number / stupidly small? If so then it can just be a blank string and left unspecified again. I'm just thinking that on some small (eg. testing) envs, there may be under 6GB memory given to this process.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :-)

@ewels ewels merged commit fa57e21 into nf-core:dev Feb 28, 2019
@apeltzer apeltzer deleted the fix-mem-sort branch June 8, 2019 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants