Skip to content

Commit 22c3244

Browse files
committed
docs: added documentation for this new feature
1 parent a48eea5 commit 22c3244

File tree

1 file changed

+4
-55
lines changed

1 file changed

+4
-55
lines changed

docs/further.md

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,6 @@ A command line invocation of the plugin could look like:
3333

3434
```console
3535
$ 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-
=======
4936
> -j unlimited \
5037
> --workflow-profile <profile directory with a `config.yaml`> \
5138
> --configfile config/config.yaml \
@@ -60,7 +47,6 @@ Furthermore, on many clusters we must assume separation of workflows and data. U
6047
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.
6148
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).
6249

63-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
6450
#### Where to set Resources and Configurations
6551

6652
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
7056
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).
7157

7258
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-
=======
8159
In profiles and on the command line, you can additionally set default resources and threads.
82-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
8360
See the [snakemake documentation on profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles) for further details.
8461

8562
#### Dynamic Resource Specification
8663

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-
=======
9464
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
9665
[There are detailed examples for these in the snakemake documentation.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#dynamic-resources)
9766

9867

@@ -131,11 +100,7 @@ These are the available options, and the SLURM `sbatch` command line arguments t
131100
| `nodes` | number of nodes | `--nodes` |
132101
| `slurm_account` | account for resource usage tracking | `--account` |
133102
| `slurm_partition` | partition/queue to submit job(s) to | `--partition` |
134-
<<<<<<< HEAD
135-
| `slurm_requeue` | handle `--retries` with SLURM | |
136-
=======
137103
| `slurm_requeue` | handle `--retries` with SLURM | `--requeue` |
138-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
139104
| | functionality | |
140105
| `tasks` | number of concurrent tasks / ranks | `--ntasks` |
141106

@@ -207,20 +172,12 @@ You can check whether your cluster has this enabled with:
207172
scontrol show config | grep Requeue
208173
```
209174

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-
=======
217175
This should show a numerical value for the `JobRequeue` parameter, indicating the number of requeues for individual jobs.
218176
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.)
219177

220178
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.
221179

222180
If your cluster does not support automated requeuing, you can ask the plugin to requeue preempted jobs with the `--slurm-requeue` flag:
223-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
224181

225182
```console
226183
snakemake --slurm-requeue ...
@@ -233,26 +190,18 @@ This flag effectively does not consider failed SLURM jobs or preserves job IDs a
233190

234191
Snakemake's SLURM executor plugin supports the execution of MPI ([Message Passing Interface](https://en.wikipedia.org/wiki/Message_Passing_Interface)) jobs.
235192

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-
=======
239193
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.
240194
MPI jobs enable parallel computations spanning across multiple nodes, thus potentially parallelizing to more cores than any machine in you cluster can offer.
241195
[See the main documentation section of Snakemake, too.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#mpi-support)
242-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
243196

244197
| Snakemake | Description |
245198
|---------------|---------------------------------------------|
246199
| `mpi` | MPI launcher command, for example `srun` |
247200
| `tasks` | The number of SLURM tasks - equivalent to MPI-ranks |
248201

249202

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-
=======
253203
To effectively utilize MPI within a Snakemake workflow, it's recommended to use `srun` as the MPI launcher when operating in a SLURM environment.
254204
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
256205

257206
Here's an example of defining an MPI rule in a Snakefile:
258207

@@ -426,12 +375,8 @@ By defining these resource specifications in a profile, you maintain a clean and
426375
### Running Jobs locally
427376

428377
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-
=======
432378
To designate specific rules for local execution, Snakemake offers the `localrules` directive.
433379
For more details, refer to the [Snakemake documentation on local rules](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#local-rules).
434-
>>>>>>> 22f87153520e7657100a210706ee646954256e64
435380
This directive allows you to specify a comma-separated list of rules that should run locally:
436381

437382
```Python
@@ -673,6 +618,10 @@ This configuration directs SLURM logs to a centralized location, making them eas
673618
Running Snakemake within an active SLURM job can lead to unpredictable behavior, as the execution environment may not be properly configured for job submission.
674619
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.
675620

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+
676625
### Frequently Asked Questions
677626

678627
#### Should I run Snakemake on the Login Node of my Cluster?

0 commit comments

Comments
 (0)