-
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
get_cpus_per_task() assigns 1 to cpus_per_task when not specified #27
Comments
Thank you for bringing this issue to my attention. Interesting. Can you use I will polish the PR on GRES (see snakemake/snakemake-executor-plugin-slurm#173 ) in the coming days and wonder whether it helps to code "if a gpu is selected, set |
Hi, Can you use --cpus-per-gpu instead? So my recommendation would be to change make cpus_per_task in the snakemake sheduler accept a 'none' argument and it omits the line where I'll track that down an add it as extra comment. the idea is to provide a solution, that works everywhere. here's hoping 😂😅 Cheers |
Ok, so I think if you look at it has in line 178 that could have an Maybe you have a better idea, this is just what came to my mind. Thanks for the prompt responses 🙌 |
My idea would be to still have a default. 1 CPU is fine for most gpu tasks. So,
where Does this make sense to you? And would it work on your cluster? The idea is to keep the workflow itself generic. If BTW to me there is no difference in |
Hi, I just tried if
Your logic is sound, sadly the coding of the cli_filter doesn't allow it in my specific case. I did tell teh HPC staff that this is an issue, but alas I haven't heard from them. |
ah, this is what you meant. My bad. Still doesn't make sense. Even, if you get assigned n cpus, you should not be able to oversubscribe but explicitly underusing a resource, which otherwise does not get used anyway? (Don't tell me that a signification fraction of GPU applications will use exactly 8 cpus! ;-) It appears your admin team wrote a filter script. Now, I could set point 2 in my list to simply returning no string, if there is only one cpu selected or none are selected. I do not want users to explicitly write |
Hi, yes you are correct, it's a bit of a silly filter. That solution should work for me, as long maybe return no string if cpus are set to zero ? Cheers |
Hi again, I just came across the same situation for memory, once you have a solution for the Cheers |
I'm nearing completion. Hopefully, a fix to all our liking will be released next week. Yet, I do not understand your last comment. We have if job.resources.get("mem_mb_per_cpu"):
call += f" --mem-per-cpu {job.resources.mem_mb_per_cpu}"
elif job.resources.get("mem_mb"):
call += f" --mem {job.resources.mem_mb}"
else:
self.logger.warning(
"No job memory information ('mem_mb' or 'mem_mb_per_cpu') is given "
"- submitting without. This might or might not work on your cluster."
) (hopefully, I got the indentation right - see lines 235 et seqq., ought to be correct there.) Anyway, there is no default setting to be omitted. These parameters are just set if required by a user. Cheers |
Hello and merry 2025 🎉🙌
I am using the execellent Snakemake workflow automation our SLURM HPC Cluster in Western Australia.
As most HPC clusters there are specific rules on what job submissions are allowed and which are not.
For us there is a rule that if I request a GPU node I cannot set
cpus_per_task=x
The problem I am encountering is that when I omit
cpus_per_task=x
from my config.yaml or snakefile resources, the slurm executorplugin will automatically set
cpus_per_task=1
as defined by the get_cpus_per_task() function.Is there a way to instead of setting it to 1, to make slurm do this?
lets say if I do
cpus_per_task='default'
the plugin would simply omit setting acpus_per_task
valueCheers
Jakob
The text was updated successfully, but these errors were encountered: