summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database/schema.sql8
-rw-r--r--database/test.sql10
m---------opendc-simulator10
3 files changed, 16 insertions, 12 deletions
diff --git a/database/schema.sql b/database/schema.sql
index 7c17e48f..bb066328 100644
--- a/database/schema.sql
+++ b/database/schema.sql
@@ -117,6 +117,8 @@ CREATE TABLE IF NOT EXISTS schedulers (
name TEXT PRIMARY KEY NOT NULL
);
INSERT INTO schedulers (name) VALUES ("DEFAULT");
+INSERT INTO schedulers (name) VALUES ("SRTF");
+INSERT INTO schedulers (name) VALUES ("FIFO");
/*
* Each simulation has a single trace. A trace contains tasks and their start times.
@@ -135,6 +137,7 @@ CREATE TABLE IF NOT EXISTS tasks (
total_flop_count INTEGER NOT NULL,
trace_id INTEGER NOT NULL,
task_dependency_id INTEGER NULL,
+ parallelizability TEXT NOT NULL,
FOREIGN KEY (trace_id) REFERENCES traces (id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (task_dependency_id) REFERENCES tasks (id) ON DELETE CASCADE ON UPDATE CASCADE
@@ -150,8 +153,9 @@ CREATE TABLE IF NOT EXISTS task_states (
id INTEGER PRIMARY KEY NOT NULL,
task_id INTEGER NOT NULL,
experiment_id INTEGER NOT NULL,
- tick INTEGER NOT NULL,
- flops_left INTEGER NOT NULL,
+ tick INTEGER NOT NULL CHECK (tick >= 0),
+ flops_left INTEGER NOT NULL CHECK (flops_left >= 0),
+ cores_used INTEGER NOT NULL CHECK (cores_used >= 0),
FOREIGN KEY (task_id) REFERENCES tasks (id),
FOREIGN KEY (experiment_id) REFERENCES experiments (id)
diff --git a/database/test.sql b/database/test.sql
index 69304767..30e3b870 100644
--- a/database/test.sql
+++ b/database/test.sql
@@ -39,11 +39,11 @@ INSERT INTO sections (path_id, datacenter_id, start_tick) VALUES (2, 3, 0);
INSERT INTO traces (name) VALUES ('test trace');
-- Tasks
-INSERT INTO tasks (id, start_tick, total_flop_count, trace_id) VALUES (1, 0, 40000000, 1);
-INSERT INTO tasks (start_tick, total_flop_count, trace_id) VALUES (25, 10000, 1);
-INSERT INTO tasks (start_tick, total_flop_count, trace_id) VALUES (25, 10000, 1);
-INSERT INTO tasks (start_tick, total_flop_count, trace_id) VALUES (26, 10000, 1);
-INSERT INTO tasks (start_tick, total_flop_count, trace_id, task_dependency_id) VALUES (80, 200000, 1, 1);
+INSERT INTO tasks (id, start_tick, total_flop_count, trace_id, parallelizability) VALUES (1, 0, 40000000, 1, 'SEQUENTIAL');
+INSERT INTO tasks (start_tick, total_flop_count, trace_id, parallelizability) VALUES (25, 10000, 1, 'PARALLEL');
+INSERT INTO tasks (start_tick, total_flop_count, trace_id, parallelizability) VALUES (25, 10000, 1, 'PARALLEL');
+INSERT INTO tasks (start_tick, total_flop_count, trace_id, parallelizability) VALUES (26, 10000, 1, 'PARALLEL');
+INSERT INTO tasks (start_tick, total_flop_count, trace_id, task_dependency_id, parallelizability) VALUES (80, 200000, 1, 1, 'PARALLEL');
-- Experiments
INSERT INTO experiments (simulation_id, path_id, trace_id, scheduler_name, name, state, last_simulated_tick)
diff --git a/opendc-simulator b/opendc-simulator
-Subproject 0709a81231b695caecb2269fe23d8dadeb76489
+Subproject f563b9c9a05b3e47070bfa4775a0e18ace8797a