(This needs updating for final nodes.)

A Dag is finished when:

  1. There are no nodes remaining to submit, all post scripts have completed, the final node has completed.
  2. 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.
  3. 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.