snakemake / snakemake-executor-plugin-slurm

A Snakemake executor plugin for submitting jobs to a SLURM cluster
MIT License
9 stars 13 forks source link

fix: Use sacct syntax that is compatible with slurm < 20.11.0 #26

Closed dnerini closed 4 months ago

dnerini commented 5 months ago

Closes #25

Tested with slurm 20.02.07

Not a great contribution in terms of code readability, but it'd ensure that the plugin works with older slurm versions.

fgvieira commented 5 months ago

slurm 2.11.0 is more than 3 years old. Wouldn't it be better to update it?

dnerini commented 5 months ago

I agree, it would be great, but unfortunately that is not an option in my case. I'm happy to keep using my fork. I just thought I would submit the PR in case someone else is facing the same issue.

cmeesters commented 5 months ago

Yep, and I would support this PR rather than lose the idea. I would also hate to require from you @dnerini to update your fork, whenever a relevant feature or fix is merged upstream ... and I understand that some admins are very reluctant to update their slurm. Although they really should due to security fixes.

Please run black on your code and add the comment.

dnerini commented 5 months ago

thanks @cmeesters for the feedback. I reformatted the code, added a comment, and changed to local time using datetime.now() (although it shouldn't make a difference for the purpose introduced in #9).