Failure Recovery
Failures are unfortunately very common in HPC. In the context of sdag, the two most common failures that can happen are:
- The sdag scheduler gets killed
- Tasks fail for whatever reason
Scheduler failures
The scheduler checkpoints its status. So, in case of failures it can be restarted from where it left off. To restart the scheduler, run:
Once restarted, it get from Slurm the status of the supposedly running jobs to update the graph state. However, all previously running local jobs (that get killed if the scheduler goes down) will be marked as failed.
Task failures
Create the following two files in the main project directory:
Run:
to execute the pipeline. As expected, failed_task will fail and all dependent nodes will be skipped. If you fix the bug and the graph structure doesn't change, you can retry the run and see if it completes successfully:
retry will reset all failed and skipped task before continuing the run. If no task failed or get skipped, then sdag retry it's virtually identical to sdag restart of the previous section. You can also set the number of retries for a task. Modify failed_task as follows:
And run the pipeline again:
You will see that the execution of failed_task is retried two times before marking it as failed definitively.
Info
To run these examples with Slurm, turn submit.sh into a sbatch script as explained in the Hello World section and execute pipelines without the --local option.