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
Further note, that there is further development ongoing to enable differentiation of file access patterns.
223
223
224
+
## Retries - Or Trying again when a Job failed
225
+
226
+
Some cluster jobs may fail. In this case Snakemake can be instructed to try another submit before the entire workflow fails, in this example up to 3 times:
227
+
228
+
```console
229
+
snakemake --retries=3
230
+
```
231
+
232
+
If a workflow fails entirely (e.g. when there are cluster failures), it can be resumed as any other Snakemake workflow:
233
+
234
+
```console
235
+
snakemake --rerun-incomplete
236
+
```
237
+
238
+
To prevent failures due to faulty parameterization, we can dynamically adjust the runtime behaviour:
239
+
240
+
## Dynamic Parameterization
241
+
242
+
Using dynamic parameterization we can react on different different inputs and prevent our HPC jobs from failing.
243
+
244
+
### Adjusting Memory Requirements
245
+
246
+
Input size of files may vary. [If we have an estimate for the RAM requirement due to varying input file sizes, we can use this to dynamically adjust our jobs.](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#dynamic-resources)
247
+
248
+
### Adjusting Runtime
249
+
250
+
Runtime adjustments can be made in a Snakefile:
251
+
252
+
```Python
253
+
def get_time(wildcards, attempt):
254
+
return f"{1 * attempt}h"
255
+
256
+
rule foo:
257
+
input: ...
258
+
output: ...
259
+
resources:
260
+
runtime=get_time
261
+
...
262
+
```
263
+
264
+
or in a workflow profile
265
+
266
+
```YAML
267
+
set-resources:
268
+
foo:
269
+
runtime: f"{1 * attempt}h"
270
+
```
271
+
272
+
Be sure to use sensible settings for your cluster and make use of parallel execution (e.g. threads) and [global profiles](#using-profiles) to avoid I/O contention.
273
+
274
+
224
275
## Summary:
225
276
226
277
When put together, a frequent command line looks like:
0 commit comments