You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/further.md
+4-55Lines changed: 4 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -33,19 +33,6 @@ A command line invocation of the plugin could look like:
33
33
34
34
```console
35
35
$ snakemake --executor slurm \
36
-
<<<<<<< HEAD
37
-
> -j unlimited \ # assuming an unlimited number of jobs
38
-
> --workflow-profile <profile directory with a `config.yaml`> \
39
-
> --configfile config/config.yaml \
40
-
> --directory <path># assuming a data path on a different file system than the workflow
41
-
```
42
-
43
-
### Configuration
44
-
45
-
Snakemake offers great [capabilities to specify and thereby limit resources](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#resources) used by a workflow as a whole and by individual jobs.
46
-
The SLURM executor plugin takes care of mapping all the [standard resources to SLURM specific configurations](#standard-resources) and also [provides control over SLURM-specific resources and configurations](#slurm-specific-resources).
47
-
48
-
=======
49
36
> -j unlimited \
50
37
> --workflow-profile <profile directory with a `config.yaml`> \
51
38
> --configfile config/config.yaml \
@@ -60,7 +47,6 @@ Furthermore, on many clusters we must assume separation of workflows and data. U
60
47
Snakemake offers great [capabilities to specify and thereby limit resources](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#resources) used by a workflow as a whole and by individual jobs.
61
48
The SLURM executor plugin takes care of mapping all the [standard resources to SLURM specific configurations](#standard-resources) and also [provides control over SLURM-specific resources and configurations](#slurm-specific-resources).
62
49
63
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
64
50
#### Where to set Resources and Configurations
65
51
66
52
Required resources and configuration options can be specified in three different places:
@@ -70,29 +56,12 @@ Required resources and configuration options can be specified in three different
70
56
3. On the command-line, via the [arguments `--default-resources <resource>=<value>`, `--set-resources <rule_name>:<resource>=<value>` and `--set-threads <rule_name>:<resource>=<value>`](https://snakemake.readthedocs.io/en/stable/executing/cli.html#snakemake.cli-get_argument_parser-execution).
71
57
72
58
On each of these levels, you can set rule-specific limits via `set-resources` and [`set-threads` (for cpus)](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#threads).
73
-
<<<<<<< HEAD
74
-
In profiles and on the command line, you can additionally [set default limits for `default-resources` across all rules](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#default-resources).
75
-
Rule-specific limits will always take precedence over default limits, and workflow-specific profiles will take precedence over system- and user-wide profiles.
76
-
77
-
Where exactly to set resources and configurations can depend on your role.
78
-
For example, system administators might want to set useful defaults in a system-wide `.yaml` profile.
79
-
In contrast, users might want to set defaults in their user or workflow profiles, or even adjust them for a particular workflow run .
80
-
=======
81
59
In profiles and on the command line, you can additionally set default resources and threads.
82
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
83
60
See the [snakemake documentation on profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles) for further details.
84
61
85
62
#### Dynamic Resource Specification
86
63
87
-
<<<<<<< HEAD
88
-
Where to set configurations can also depend on how generically we are able to set them.
89
-
Using [dynamic resource specification](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#dynamic-resources), we can generalize resource requirements.
90
-
This can mean that the respective resources can be set in a rule in the workflow, and end-users will not have to worry about setting them for their analysis-specific workflow instance.
91
-
92
-
Classical examples are determining the memory requirement based on the size of input files, or increasing the runtime with every `attempt` of running a job (if [`--retries` is greater than `0`](https://snakemake.readthedocs.io/en/stable/executing/cli.html#snakemake.cli-get_argument_parser-behavior)).
93
-
=======
94
64
How and where you set configurations on factors like file size or increasing the runtime with every `attempt` of running a job (if [`--retries` is greater than `0`](https://snakemake.readthedocs.io/en/stable/executing/cli.html#snakemake.cli-get_argument_parser-behavior)).
95
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
96
65
[There are detailed examples for these in the snakemake documentation.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#dynamic-resources)
97
66
98
67
@@ -131,11 +100,7 @@ These are the available options, and the SLURM `sbatch` command line arguments t
131
100
|`nodes`| number of nodes |`--nodes`|
132
101
|`slurm_account`| account for resource usage tracking |`--account`|
133
102
|`slurm_partition`| partition/queue to submit job(s) to |`--partition`|
134
-
<<<<<<< HEAD
135
-
| `slurm_requeue` | handle `--retries` with SLURM | |
136
-
=======
137
103
|`slurm_requeue`| handle `--retries` with SLURM |`--requeue`|
138
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
139
104
|| functionality ||
140
105
|`tasks`| number of concurrent tasks / ranks |`--ntasks`|
141
106
@@ -207,20 +172,12 @@ You can check whether your cluster has this enabled with:
207
172
scontrol show config | grep Requeue
208
173
```
209
174
210
-
<<<<<<< HEAD
211
-
This should show a numerical value for the `JobRequeue` parameter, indicating the number of requeues for individual jobs. Any number greater 1 will cause SLURM to reqeue jobs on your cluster upon failure or preemption this many times. (Your cluster may specify additional parameters.)
212
-
213
-
If enabled, this feature allows jobs to be automatically resubmitted if they fail or are preempted - you do not need to rely on this plugin in this case.
214
-
215
-
If your cluster does not support automated requeing, you can ask the plugin to requeu preemted jobs with the `--slurm-requeue` flag:
216
-
=======
217
175
This should show a numerical value for the `JobRequeue` parameter, indicating the number of requeues for individual jobs.
218
176
Any number greater than 1 will cause SLURM to requeue jobs on your cluster upon failure or preemption this many times. (Your cluster may specify additional parameters.)
219
177
220
178
If enabled, this feature allows jobs to be automatically resubmitted if they fail or are preempted - you do not need to rely on this plugin in this case.
221
179
222
180
If your cluster does not support automated requeuing, you can ask the plugin to requeue preempted jobs with the `--slurm-requeue` flag:
223
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
224
181
225
182
```console
226
183
snakemake --slurm-requeue ...
@@ -233,26 +190,18 @@ This flag effectively does not consider failed SLURM jobs or preserves job IDs a
233
190
234
191
Snakemake's SLURM executor plugin supports the execution of MPI ([Message Passing Interface](https://en.wikipedia.org/wiki/Message_Passing_Interface)) jobs.
235
192
236
-
<<<<<<< HEAD
237
-
Per default, jobs can only run on a single cluster node (or machine) and parallelization is thus limited by the maximum number of cores that is available on any machine in the cluster. MPI jobs enable parallel computations spanning across multiple nodes, thus potentially parallelizing to more cores than any machine in you cluster can offer. [See the main documentation section of Snakemake, too.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#mpi-support)
238
-
=======
239
193
By default, jobs can only run on a single cluster node (or machine) and parallelization is thus limited by the maximum number of cores that is available on any machine in the cluster.
240
194
MPI jobs enable parallel computations spanning across multiple nodes, thus potentially parallelizing to more cores than any machine in you cluster can offer.
241
195
[See the main documentation section of Snakemake, too.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#mpi-support)
|`tasks`| The number of SLURM tasks - equivalent to MPI-ranks |
248
201
249
202
250
-
<<<<<<< HEAD
251
-
To effectively utilize MPI within a Snakemake workflow, it's recommended to use `srun` as the MPI launcher when operating in a SLURM environment. However, some programs do not work well with this MPI launcer or require a detailed topology layout - this can be added to the `srun` statement, if required.
252
-
=======
253
203
To effectively utilize MPI within a Snakemake workflow, it's recommended to use `srun` as the MPI launcher when operating in a SLURM environment.
254
204
However, some programs do not work well with this MPI launcher or require a detailed topology layout - this can be added to the `srun` statement, if required.
255
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
256
205
257
206
Here's an example of defining an MPI rule in a Snakefile:
258
207
@@ -426,12 +375,8 @@ By defining these resource specifications in a profile, you maintain a clean and
426
375
### Running Jobs locally
427
376
428
377
In Snakemake workflows executed within cluster environments, certain tasks -- such as brief data downloads or plotting -- are better suited for local execution on the head node rather than being submitted as cluster jobs.
429
-
<<<<<<< HEAD
430
-
To designate specific rules for local execution, Snakemake offers the `localrules` directive. For more details, refer to the [Snakemake documentation on local rules](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#local-rules).
431
-
=======
432
378
To designate specific rules for local execution, Snakemake offers the `localrules` directive.
433
379
For more details, refer to the [Snakemake documentation on local rules](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#local-rules).
434
-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
435
380
This directive allows you to specify a comma-separated list of rules that should run locally:
436
381
437
382
```Python
@@ -673,6 +618,10 @@ This configuration directs SLURM logs to a centralized location, making them eas
673
618
Running Snakemake within an active SLURM job can lead to unpredictable behavior, as the execution environment may not be properly configured for job submission.
674
619
To mitigate potential issues, the SLURM executor plugin detects when it's operating inside a SLURM job and issues a warning, pausing for 5 seconds before proceeding.
675
620
621
+
### Getting Job Efficiency Information
622
+
623
+
With `--slurm-efficiency-report` you can generate a table of all efficiency data. A logfile `efficiency_report_<workflow_id>.log` will be generated in your current directory. This is equivalent to the information with `seff <jobid>` for individual jobs. It works best if "comments" are stored as a job property on your cluster as this plugin uses the "comment" parameter to store the rule name.
624
+
676
625
### Frequently Asked Questions
677
626
678
627
#### Should I run Snakemake on the Login Node of my Cluster?
0 commit comments