Skip to content

feat: Enables running snakemake job within a slurm cluster reservation. #285

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions snakemake_executor_plugin_slurm/submit_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def get_submit_command(job, params):
if job.resources.get("nodes", False):
call += f" --nodes={job.resources.get('nodes', 1)}"

# Specify reservation for job if any. Reservation name is in
Copy link
Member

Choose a reason for hiding this comment

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

is this is a resource per job, users would need to alter workflows or write a default resource in their workflow profiles. Both scenarios not really desirable, when wanting to stay as generic as possible. See the comment thread for alternatives.

Copy link
Author

Choose a reason for hiding this comment

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

Hi Christian,
I hadn't considered relying on the magnetic attribute of a reservation. I agree, this would be best as a default resource for a workflow, or passed on the command line, and not a per job resource. This capability is something we would use during post-downtime cluster testing. I'll discuss use of magnetic reservations with our sys admins.
Thanks,
Brett

# single quotes since reservation names may include spaces.
if job.resources.get("reservation"):
call += f" --reservation='{job.resources.reservation}'"

# fixes #40 - set ntasks regardless of mpi, because
# SLURM v22.05 will require it for all jobs
gpu_job = job.resources.get("gpu") or "gpu" in job.resources.get("gres", "")
Expand Down
Loading