Page History

Turn Off History

Note: not yet complete!

The way this is handled in the code is probably not as clean as it could be, because PRE and POST scripts got added to DAGMan after the initial code was written. Because of that, I guess, PRE scripts are handled outside of the ready queue data structure, which is kind of awkward.

There are a number of important data structures relating to job ordering:

When DAGMan starts up, the ready queue is empty. Dag::Bootstrap() calls Dag::StartNode() on all jobs with empty waiting queues. Dag::StartNode() either runs the node's PRE script (if there is one) or puts the node into the ready queue. If a job does have a PRE script, and the PRE script succeeds, Dag::PreScriptReaper() puts the job into the ready queue. (If the PRE script fails, Dag::PreScriptReaper() marks the job as failed, except in special cases.)

Once a job is in the ready queue, it will eventually get submitted by Dag::SubmitReadyJobs(), which is called from condor_event_timer() in dagman_main.cpp; condor_event_timer() is called by daemoncore (every 5 seconds by default). Note that Dag::SubmitReadyJobs() will only submit a certain number of jobs each time it is called (that number is configurable). If the attempt to submit the job fails, Dag::SubmitReadyJobs() calls Dag::ProcessFailedSubmit(), which puts the job back into the ready queue.

condor_event_timer() in dagman_main.cpp gets called every five (by default) seconds. In that function, we call Dag::SubmitReadyJobs() to submit any jobs that are ready; ready any new node job events (see ???); output the status of the DAG; and check whether the DAG is finished.