From 34aaaad34e72c921ea72d7b023e5a5270e76dd40 Mon Sep 17 00:00:00 2001 From: Matthijs Bijman Date: Mon, 27 Feb 2017 15:19:15 +0100 Subject: Add tasks that run on 1 machine --- Simulator/src/database/Database.cpp | 12 +++++++++--- Simulator/src/simulation/workloads/Workload.cpp | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'Simulator/src') diff --git a/Simulator/src/database/Database.cpp b/Simulator/src/database/Database.cpp index 5abee41e..d1bb2af5 100644 --- a/Simulator/src/database/Database.cpp +++ b/Simulator/src/database/Database.cpp @@ -260,7 +260,7 @@ namespace Database { Simulation::WorkloadPool pool; - std::vector> tasks; + std::vector> tasks; // Fetch tasks from database { // Retrieves the traceId corresponding to the simulation section @@ -272,7 +272,7 @@ namespace Database .get(); // Retrieves the tasks that belong to the traceId - QueryExecuter q2(db); + QueryExecuter q2(db); tasks = q2 .setQuery(Queries::GET_TASKS_OF_TRACE) .bindParams(traceId) @@ -287,9 +287,15 @@ namespace Database int totalFlopCount = row.get(); int traceId = row.get(); int dependency = row.get(); + std::string parallelizability = row.get(); + bool parallel = false; + if (parallelizability == "PARALLEL") + { + parallel = true; + } // TODO possibly wait and batch? - Simulation::Workload workload(totalFlopCount, startTick, id, traceId, dependency); + Simulation::Workload workload(totalFlopCount, startTick, id, traceId, dependency, parallel); if(dependency == 0) workload.dependencyFinished = true; diff --git a/Simulator/src/simulation/workloads/Workload.cpp b/Simulator/src/simulation/workloads/Workload.cpp index ba8ca950..f8fe1444 100644 --- a/Simulator/src/simulation/workloads/Workload.cpp +++ b/Simulator/src/simulation/workloads/Workload.cpp @@ -2,7 +2,7 @@ namespace Simulation { - Workload::Workload(int size, int startTick, int dbId, int traceId, int dependency) : dependencyId(dependency), remainingFlops(size), TOTAL_FLOPS(size), START_TICK(startTick), ID(dbId), TRACE_ID(traceId) {} + Workload::Workload(int size, int startTick, int dbId, int traceId, int dependency, bool parallel) : dependencyId(dependency), remainingFlops(size), TOTAL_FLOPS(size), START_TICK(startTick), ID(dbId), TRACE_ID(traceId), isParallel(parallel) {} void Workload::doOperations(uint32_t opCount) { @@ -52,4 +52,9 @@ namespace Simulation { return coresUsed; } + + bool Workload::isParallelizable() + { + return isParallel; + } } -- cgit v1.2.3