Skip to content

Commit

Permalink
Add bullet points and fix my syntax errors (#16, #17)
Browse files Browse the repository at this point in the history
The command passed to `shell` must be a string because a Snakefile
is a Python script. I was thinking of YAML syntax
  • Loading branch information
jdblischak committed Apr 6, 2023
1 parent bbc8d1d commit 815fa68
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ Example that logs stdout and stderr to separate files (`separate-stderr`)

[issue-14]: https://github.com/jdblischak/smk-simple-slurm/issues/14

Example that conditionally specifies a resource for a subset of rules
([TomHarrop][], [#16][issue-16], [#17][pr-17])

Example that lists multiple partitions for Slurm to choose from ([TomHarrop][],
[#16][issue-16], [#17][pr-17])

[TomHarrop]: https://github.com/TomHarrop
[issue-16]: https://github.com/jdblischak/smk-simple-slurm/issues/16
[pr-17]: https://github.com/jdblischak/smk-simple-slurm/pull/17

## v1.3.0 - 2022-08-09

New status script `status-sacct-robust.sh` that re-runs `sacct` multiple times
Expand Down
5 changes: 5 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ them on your cluster to confirm the expected behavior.
* `cluster-cancel` - Cancel all submitted jobs with `scancel` when the main
Snakemake process is cancelled (requires Snakemake 7.0.0+)

* `conditional-resource` - Conditionally specify a resource for a subset of
rules

* `dynamic-resources` - Increase memory for a rule on restart after each failed
attempt

Expand All @@ -17,6 +20,8 @@ them on your cluster to confirm the expected behavior.
* `jobs-per-second` - Measure how many jobs Snakemake can submit to Slurm per
second

* `list-partitions` - List multiple partitions for Slurm to choose from

* `log-file-date` - Insert the current date into the log file path

* `many-input-files` - Use a custom jobscript when a rule has many thousands of
Expand Down
14 changes: 11 additions & 3 deletions examples/conditional-resource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ adding the `partitionFlag` resource to the rule, as in the following Snakefile:
rule withPartitionFlag:
resources:
partitionFlag="--partition=aSpecificPartition",
shell: echo "executed on aSpecificPartition"
shell:
'echo "executed on aSpecificPartition"'
rule withoutPartitionFlag:
shell: echo "executed on whichever partition Slurm chose"
shell:
'echo "executed on whichever partition Slurm chose"'
```

**Note:** This example was inspired by the discussion in [Issue #16][issue-16]

[issue-16]: https://github.com/jdblischak/smk-simple-slurm/issues/16
9 changes: 6 additions & 3 deletions examples/conditional-resource/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
rule withPartitionFlag:
resources:
partitionFlag="--partition=aSpecificPartition",
shell: echo "executed on aSpecificPartition"

shell:
'echo "executed on aSpecificPartition"'


rule withoutPartitionFlag:
shell: echo "executed on whichever partition Slurm chose"
shell:
'echo "executed on whichever partition Slurm chose"'
14 changes: 11 additions & 3 deletions examples/list-partitions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ You can still specify a partition for jobs in the Snakefile as usual:
rule partition1_only:
resources:
partition="partition1",
shell: echo "executed on partition1"

shell:
'echo "executed on partition1"'


rule any_partition:
shell: echo "executed on whichever partition Slurm chose"
shell:
'echo "executed on whichever partition Slurm chose"'

```

**Note:** This example was inspired by the discussion in [Issue #16][issue-16]

[issue-16]: https://github.com/jdblischak/smk-simple-slurm/issues/16
9 changes: 6 additions & 3 deletions examples/list-partitions/Snakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
rule partition1_only:
resources:
partition="partition1",
shell: echo "executed on partition1"

shell:
'echo "executed on partition1"'


rule any_partition:
shell: echo "executed on whichever partition Slurm chose"
shell:
'echo "executed on whichever partition Slurm chose"'

0 comments on commit 815fa68

Please sign in to comment.