Mercurial > hg > Members > Moririn
changeset 392:36964b9ac5fd
Fix taskManager
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 01 Aug 2017 17:53:26 +0900 |
parents | 2d9c500f263e |
children | 99c50356d917 |
files | src/parallel_execution/TaskManager.cbc src/parallel_execution/TaskManagerImpl.cbc src/parallel_execution/context.h src/parallel_execution/examples/twice/twice.cbc |
diffstat | 4 files changed, 12 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/TaskManager.cbc Tue Aug 01 17:50:23 2017 +0900 +++ b/src/parallel_execution/TaskManager.cbc Tue Aug 01 17:53:26 2017 +0900 @@ -1,12 +1,12 @@ typedef struct TaskManager<Impl>{ union Data* taskManager; + struct Context* context; + struct Context** tasks; __code spawn(Impl* taskManager, struct Queue* queue, struct Context* task, __code next(...)); - __code spawnTasks(struct TaskManager* taskManager, Impl* taskManagerImpl, struct Context** contexts); + __code spawnTasks(Impl* taskManagerImpl, struct Context** tasks, __code next1(...), struct TaskManager* taskManager); __code shutdown(struct LoopCounter* loopCounter, struct TaskManager* taskManager, Impl* taskManagerImpl, struct Queue* queue, __code next(...)); __code next(...); __code next1(...); - __code task(...); - struct Context* context; int worker; int cpu; int gpu;
--- a/src/parallel_execution/TaskManagerImpl.cbc Tue Aug 01 17:50:23 2017 +0900 +++ b/src/parallel_execution/TaskManagerImpl.cbc Tue Aug 01 17:53:26 2017 +0900 @@ -53,7 +53,7 @@ } } -__code spawnTasksTaskManager(struct TaskManager* taskManager, struct TaskManagerImpl* taskManagerImpl, struct Context** tasks) { +__code spawnTasksTaskManager(struct TaskManagerImpl* taskManagerImpl, struct Context** tasks, __code next1(...)) { int i = taskManagerImpl->loopCounter->i; if(i < GET_SIZE(tasks)) { struct Context* task = tasks[i]; @@ -70,12 +70,13 @@ __code spawnTasksTaskManager_stub(struct Context* context) { TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager); goto spawnTasksTaskManager(context, - Gearef(context, TaskManager), taskManager, - Gearef(context, TaskManager)->contexts); + Gearef(context, TaskManager)->tasks, + Gearef(context, TaskManager)->next1, + Gearef(context, TaskManager)); } -__code spawnTasksTaskManager1(struct TaskManager* taskManager, struct TaskManagerImpl* taskManagerImpl, struct Context** tasks, __code next(...)) { +__code spawnTasksTaskManager1(struct TaskManager* taskManager, struct TaskManagerImpl* taskManagerImpl, struct Context** tasks, __code next1(...)) { int i = taskManagerImpl->loopCounter->i; if(i < GET_SIZE(tasks)) { struct Context* task = tasks[i]; @@ -85,7 +86,7 @@ goto meta(context, C_spawnTaskManager); } taskManagerImpl->loopCounter->i = 0; - goto meta(context, next); + goto meta(context, next1); } __code spawnTasksTaskManager1_stub(struct Context* context) { @@ -93,7 +94,7 @@ goto spawnTasksTaskManager1(context, Gearef(context, TaskManager), taskManager, - Gearef(context, TaskManager)->contexts, + Gearef(context, TaskManager)->tasks, Gearef(context, TaskManager)->next1); }
--- a/src/parallel_execution/context.h Tue Aug 01 17:50:23 2017 +0900 +++ b/src/parallel_execution/context.h Tue Aug 01 17:53:26 2017 +0900 @@ -131,7 +131,7 @@ enum Code next1; enum Code task; struct Context* context; - struct Context** contexts; + struct Context** tasks; union Data* data; int worker; int cpu;
--- a/src/parallel_execution/examples/twice/twice.cbc Tue Aug 01 17:50:23 2017 +0900 +++ b/src/parallel_execution/examples/twice/twice.cbc Tue Aug 01 17:53:26 2017 +0900 @@ -153,10 +153,8 @@ task->maxOdg = task->odg; tasks[0] = task; - taskManager->contexts = tasks; // goto crateTask1(); - taskManager->next1 = C_createTask1; - goto meta(context, taskManager->taskManager->TaskManager.spawnTasks); + goto taskManager->spawnTasks(tasks, C_createTask1); } void init(int argc, char** argv) {