Skip to content

Commit

Permalink
Merge branch 'main' into feat/requeue-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeesters authored Sep 9, 2024
2 parents 4184610 + cb5d656 commit 5774a85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ black = "^23.7.0"
flake8 = "^6.1.0"
coverage = "^7.3.1"
pytest = "^7.4.2"
snakemake = {git = "https://github.com/snakemake/snakemake.git"}
snakemake = "^8.20.0"

[tool.coverage.run]
omit = [".*", "*/site-packages/*", "Snakefile"]
Expand Down
10 changes: 9 additions & 1 deletion snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def run_job(self, job: JobExecutorInterface):
f"sbatch "
f"--parsable "
f"--job-name {self.run_uuid} "
f"--output {slurm_logfile} "
f"--output '{slurm_logfile}' "
f"--export=ALL "
f"--comment {comment_str}"
)
Expand Down Expand Up @@ -423,6 +423,14 @@ def cancel_jobs(self, active_jobs: List[SubmittedJobInfo]):
)
except subprocess.TimeoutExpired:
self.logger.warning("Unable to cancel jobs within a minute.")
except subprocess.CalledProcessError as e:
msg = e.stderr.strip()
if msg:
msg = f": {msg}"
raise WorkflowError(
"Unable to cancel jobs with scancel "
f"(exit code {e.returncode}){msg}"
) from e

async def job_stati(self, command):
"""Obtain SLURM job status of all submitted jobs with sacct
Expand Down

0 comments on commit 5774a85

Please sign in to comment.