From dfddb6c25c96598295ad8b50092c9f4dd946e560 Mon Sep 17 00:00:00 2001
From: Fabian Mastenbroek <mail.fabianm@gmail.com>
Date: Fri, 20 Jul 2018 00:19:03 +0200
Subject: feat: Implement Scheduler Reference Architecture

This change implements the parts of the Datacenter Scheduling Reference
Architecture as published in SC18.

This commit consists of changes to the database schema such as:

- **Removal of `parallelizability` column in `Task`**
  This field was not used by the simulator and we opted to use a field
  describing the amount of cores the task can run on instead.
- **Removal of `task_id` column in `MachineState`**
  This field did not make sense anymore now that a machine can run
  multiple tasks. Fortunately, this field is not used in the frontend.
---
 database/test.sql | 82 +++++++++++++++++++++++++++----------------------------
 1 file changed, 40 insertions(+), 42 deletions(-)

(limited to 'database/test.sql')

diff --git a/database/test.sql b/database/test.sql
index fa7fb8aa..a2c6d165 100644
--- a/database/test.sql
+++ b/database/test.sql
@@ -43,8 +43,9 @@ INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALU
 INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (25, 10000, 1, 'PARALLEL');
 INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (25, 10000, 1, 'PARALLEL');
 INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (26, 10000, 1, 'PARALLEL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (80, 200000, 1, 1, 'PARALLEL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (80, 200000, 1, 'PARALLEL');
+
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (1, 5);
 
 -- Image Processing Trace
 INSERT INTO traces (name) VALUES ('Image Processing');
@@ -121,38 +122,39 @@ INSERT INTO traces (name) VALUES ('Path planning');
 INSERT INTO jobs (name, trace_id) VALUES ('Path planning', 3);
 
 INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (0, 1000000, 3, 'PARALLEL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (11, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (12, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (13, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (14, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (11, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (12, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (13, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (14, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (11, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (12, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (13, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (14, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (11, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (12, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (13, 200000, 3, 66, 'SEQUENTIAL');
-INSERT INTO tasks (start_tick, total_flop_count, job_id, task_dependency_id, parallelizability)
-VALUES (14, 200000, 3, 66, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (11, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (12, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (13, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (14, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (11, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (12, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (13, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (14, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (11, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (12, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (13, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (14, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (11, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (12, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (13, 200000, 3, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALUES (14, 200000, 3, 'SEQUENTIAL');
+
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 67);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 68);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 69);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 70);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 71);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 72);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 73);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 74);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 75);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 76);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 77);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 78);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 79);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 80);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 81);
+INSERT INTO task_dependencies (first_task_id, second_task_id) VALUES (66, 82);
 
 -- Parallelizable Trace
 INSERT INTO traces (name) VALUES ('Parallel heavy trace');
@@ -174,17 +176,13 @@ INSERT INTO tasks (start_tick, total_flop_count, job_id, parallelizability) VALU
 
 -- Experiments
 INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 1, 'SRTF', 'Default trace, SRTF', 'QUEUED', 110);
-INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 2, 'SRTF', 'Image processing trace, SRTF', 'QUEUED', 0);
-INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 3, 'SRTF', 'Path planning trace, FIFI', 'QUEUED', 0);
+VALUES (1, 1, 3, 'fifo-bestfit', 'Path planning trace, FIFO', 'QUEUED', 0);
 INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 1, 'FIFO', 'Default trace, SRTF', 'QUEUED', 0);
+VALUES (1, 1, 1, 'srtf-firstfit', 'Default trace, SRTF', 'QUEUED', 0);
 INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 2, 'FIFO', 'Image processing trace, SRTF', 'QUEUED', 0);
+VALUES (1, 1, 2, 'srtf-firstfit', 'Image processing trace, SRTF', 'QUEUED', 0);
 INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
-VALUES (1, 1, 3, 'FIFO', 'Path planning trace, FIFO', 'QUEUED', 0);
+VALUES (1, 1, 3, 'fifo-firstfit', 'Path planning trace, FIFO', 'QUEUED', 0);
 
 -- Rooms
 INSERT INTO rooms (name, datacenter_id, type) VALUES ('room 1', 1, 'SERVER');
-- 
cgit v1.2.3

