jdblischak / smk-simple-slurm

A simple Snakemake profile for Slurm without --cluster-config
Creative Commons Zero v1.0 Universal
120 stars 14 forks source link

Control for number of tries of a failed job? #13

Closed hudja closed 1 year ago

hudja commented 1 year ago

Hello,

In case of a fail (e.g. code error) my jobs always restart 3 times. Is it possible to control for it and allow only for 1 try? So, in case of a fail snakemake stops without re-trying. I have the following line in my config.yaml restart-times: 1, but I am not sure what it controls for.

Best regards, Georgi

jdblischak commented 1 year ago

If you only want each rule to run once, you want to have zero restarts:

restart-times: 0

From the Snakemake docs:

-T, --retries, --restart-times

Number of times to restart failing jobs (defaults to 0).

Default: 0

Since zero is the default, you could also simply delete this field from the YAML file entirely.

All the fields in the profile YAML file are passed as command-line flags directly to snakemake. Thus to learn more about them, you can run snakemake --help in the terminal or read the documentation on the command line interface.