A Dag is finished when:
- There are no nodes remaining to submit, all post scripts have completed, the final node has completed.
- No nodes are queued up and the ready queue is empty. This implies a cycle in the putative DAG or that something internally in DAGMan is messed up. DAGMan should exit, writing out a rescue DAG.
- A node has exited with failure and all remaining nodes have a dependency on it completing successfully. DAGMan should exit, writing out a rescue DAG.