Skip to content

Commit 364c77b

Browse files
committed
Merge branch 'main' into docs/storage_update
2 parents 53fbc83 + 2e5d308 commit 364c77b

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [0.5.1](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v0.5.0...v0.5.1) (2024-05-14)
4+
5+
6+
### Bug Fixes
7+
8+
* allowing for accounts containing whitespace ([#86](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/86)) ([6993f2d](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/6993f2d7dd7c31fd34a79317df35ff80779f8a63))
9+
* proper line ending status message ([#87](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/87)) ([7b94aec](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/7b94aec8fdda5d2b0f8986154b6cb07d1954b7e8))
10+
11+
## [0.5.0](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v0.4.5...v0.5.0) (2024-05-06)
12+
13+
14+
### Features
15+
16+
* wildcards in comment string [#85](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/85) ([#88](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/88)) ([730cac0](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/730cac09c12a7038557ee937bc58c8c9e483c8f3))
17+
318
## [0.4.5](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v0.4.4...v0.4.5) (2024-04-17)
419

520

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "snakemake-executor-plugin-slurm"
3-
version = "0.4.5"
3+
version = "0.5.1"
44
description = "A Snakemake executor plugin for submitting jobs to a SLURM cluster."
55
authors = [
66
"Christian Meesters <meesters@uni-mainz.de>",

snakemake_executor_plugin_slurm/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ def run_job(self, job: JobExecutorInterface):
8989
# generic part of a submission string:
9090
# we use a run_uuid as the job-name, to allow `--name`-based
9191
# filtering in the job status checks (`sacct --name` and `squeue --name`)
92+
if wildcard_str == "":
93+
comment_str = f"rule_{job.name}"
94+
else:
95+
comment_str = f"rule_{job.name}_wildcards_{wildcard_str}"
9296
call = (
9397
f"sbatch --job-name {self.run_uuid} --output {slurm_logfile} --export=ALL "
94-
f"--comment {job.name}"
98+
f"--comment {comment_str}"
9599
)
96100

97101
call += self.get_account_arg(job)
@@ -210,7 +214,7 @@ async def check_active_jobs(
210214

211215
# We use this sacct syntax for argument 'starttime' to keep it compatible
212216
# with slurm < 20.11
213-
sacct_starttime = f"{datetime.now() - timedelta(days=2):%Y-%m-%dT%H:00}"
217+
sacct_starttime = f"{datetime.now() - timedelta(days = 2):%Y-%m-%dT%H:00}"
214218
# previously we had
215219
# f"--starttime now-2days --endtime now --name {self.run_uuid}"
216220
# in line 218 - once v20.11 is definitively not in use any more,
@@ -289,7 +293,9 @@ async def check_active_jobs(
289293
elif status in fail_stati:
290294
msg = (
291295
f"SLURM-job '{j.external_jobid}' failed, SLURM status is: "
292-
f"'{status}'"
296+
# message ends with '. ', because it is proceeded
297+
# with a new sentence
298+
f"'{status}'. "
293299
)
294300
self.report_job_error(j, msg=msg, aux_logs=[j.aux["slurm_logfile"]])
295301
active_jobs_seen_by_sacct.remove(j.external_jobid)
@@ -369,7 +375,7 @@ def get_account_arg(self, job: JobExecutorInterface):
369375
# here, we check whether the given or guessed account is valid
370376
# if not, a WorkflowError is raised
371377
self.test_account(job.resources.slurm_account)
372-
return f" -A {job.resources.slurm_account}"
378+
return f" -A '{job.resources.slurm_account}'"
373379
else:
374380
if self._fallback_account_arg is None:
375381
self.logger.warning("No SLURM account given, trying to guess.")
@@ -436,7 +442,9 @@ def test_account(self, account):
436442
f"'{account}' with sacctmgr: {e.stderr}"
437443
)
438444

439-
accounts = accounts.split()
445+
# The set() has been introduced during review to eliminate
446+
# duplicates. They are not harmful, but disturbing to read.
447+
accounts = set(_.strip() for _ in accounts.split("\n") if _)
440448

441449
if account not in accounts:
442450
raise WorkflowError(

0 commit comments

Comments
 (0)