Global scheduler skeleton (#45)

* Initial scheduler commit

* global scheduler

* add global scheduler

* Implement global scheduler skeleton.

* Formatting.

* Allow local scheduler to be started without a connection to redis so that we can test it without a global scheduler.

* Fail if there are no local schedulers when the global scheduler receives a task.

* Initialize uninitialized value and formatting fix.

* Generalize local scheduler table to db client table.

* Remove code duplication in local scheduler and add flag for whether a task came from the global scheduler or not.

* Queue task specs in the local scheduler instead of tasks.

* Simple global scheduler tests, including valgrind.

* Factor out functions for starting processes.

* Fixes.
This commit is contained in:
Robert Nishihara
2016-11-18 19:57:51 -08:00
committed by Stephanie Wang
parent 08707f9408
commit d77b685a90
50 changed files with 1070 additions and 328 deletions
+11 -3
View File
@@ -66,7 +66,7 @@ struct task_spec_impl {
(ARGS_VALUE_SIZE))
bool task_ids_equal(task_id first_id, task_id second_id) {
return UNIQUE_ID_EQ(first_id, second_id) ? true : false;
return UNIQUE_ID_EQ(first_id, second_id);
}
bool task_id_is_nil(task_id id) {
@@ -74,7 +74,7 @@ bool task_id_is_nil(task_id id) {
}
bool function_ids_equal(function_id first_id, function_id second_id) {
return UNIQUE_ID_EQ(first_id, second_id) ? true : false;
return UNIQUE_ID_EQ(first_id, second_id);
}
bool function_id_is_nil(function_id id) {
@@ -288,7 +288,7 @@ struct task_impl {
};
bool node_ids_equal(node_id first_id, node_id second_id) {
return UNIQUE_ID_EQ(first_id, second_id) ? true : false;
return UNIQUE_ID_EQ(first_id, second_id);
}
bool node_id_is_nil(node_id id) {
@@ -320,10 +320,18 @@ scheduling_state task_state(task *task) {
return task->state;
}
void task_set_state(task *task, scheduling_state state) {
task->state = state;
}
node_id task_node(task *task) {
return task->node;
}
void task_set_node(task *task, node_id node) {
task->node = node;
}
task_spec *task_task_spec(task *task) {
return &task->spec;
}