Split local scheduler task queue (#211)

* Split local scheduler task queue into waiting and dispatch queue

* Fix memory leak

* Add a new task scheduling status for when a task has been queued locally

* Fix global scheduler test case and add task status doc

* Documentation

* Address Philipp's comments

* Move tasks back to the waiting queue if their dependencies become unavailable

* Update existing task table entries instead of overwriting
This commit is contained in:
Stephanie Wang
2017-01-18 20:27:40 -08:00
committed by Philipp Moritz
parent 6fe69bec11
commit f1987cdc16
7 changed files with 356 additions and 175 deletions
+12 -5
View File
@@ -244,18 +244,25 @@ void print_task(task_spec *spec, UT_string *output);
/**
* ==== Task ====
* Contains information about a scheduled task: The task specification, the task
* schedulign state (WAITING, SCHEDULED, RUNNING, DONE), and which local
* scheduler the task is scheduled on.
* Contains information about a scheduled task: The task specification, the
* task scheduling state (WAITING, SCHEDULED, QUEUED, RUNNING, DONE), and which
* local scheduler the task is scheduled on.
*/
/** The scheduling_state can be used as a flag when we are listening
* for an event, for example TASK_WAITING | TASK_SCHEDULED. */
typedef enum {
/** The task is waiting to be scheduled. */
TASK_STATUS_WAITING = 1,
/** The task has been scheduled to a node, but has not been queued yet. */
TASK_STATUS_SCHEDULED = 2,
TASK_STATUS_RUNNING = 4,
TASK_STATUS_DONE = 8
/** The task has been queued on a node, where it will wait for its
* dependencies to become ready and a worker to become available. */
TASK_STATUS_QUEUED = 4,
/** The task is running on a worker. */
TASK_STATUS_RUNNING = 8,
/** The task is done executing. */
TASK_STATUS_DONE = 16
} scheduling_state;
/** A task is an execution of a task specification. It has a state of execution