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.
228
228
229
+
## Retries - Or Trying again when a Job failed
230
+
231
+
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:
232
+
233
+
```console
234
+
snakemake --retries=3
235
+
```
236
+
237
+
If a workflow fails entirely (e.g. when there are cluster failures), it can be resumed as any other Snakemake workflow:
238
+
239
+
```console
240
+
snakemake --rerun-incomplete
241
+
```
242
+
243
+
To prevent failures due to faulty parameterization, we can dynamically adjust the runtime behaviour:
244
+
245
+
## Dynamic Parameterization
246
+
247
+
Using dynamic parameterization we can react on different different inputs and prevent our HPC jobs from failing.
248
+
249
+
### Adjusting Memory Requirements
250
+
251
+
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)
252
+
253
+
### Adjusting Runtime
254
+
255
+
Runtime adjustments can be made in a Snakefile:
256
+
257
+
```Python
258
+
def get_time(wildcards, attempt):
259
+
return f"{1 * attempt}h"
260
+
261
+
rule foo:
262
+
input: ...
263
+
output: ...
264
+
resources:
265
+
runtime=get_time
266
+
...
267
+
```
268
+
269
+
or in a workflow profile
270
+
271
+
```YAML
272
+
set-resources:
273
+
foo:
274
+
runtime: f"{1 * attempt}h"
275
+
```
276
+
277
+
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.
278
+
279
+
229
280
## Summary:
230
281
231
282
When put together, a frequent command line looks like:
0 commit comments