Mercurial > hg > Members > innparusu > Gears
diff src/parallel_execution/main.c @ 117:c9ab10847fc3
Define dependency Task create function
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 19 Jul 2016 02:18:31 +0900 |
parents | 69fbd905d750 |
children | 4df53a60e59a |
line wrap: on
line diff
--- a/src/parallel_execution/main.c Tue Jul 12 16:26:05 2016 +0900 +++ b/src/parallel_execution/main.c Tue Jul 19 02:18:31 2016 +0900 @@ -119,7 +119,6 @@ goto meta(context, CreateData2); } - loopCounter->i = 0; goto meta(context, CreateTask1); } @@ -184,13 +183,15 @@ __code createTask2(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Element* element, struct Queue* activeQueue) { int i = loopCounter->i; - task->code = TaskB; - task->key = i; + task->code = Mult; + task->iKeys[0] = i-1; + task->iKeys[1] = i-2; + task->idsCount = 1; + loopCounter->i -= 2; element->data = (union Data *)task; - context->next = CreateData1; - loopCounter->i++; + context->next = CreateTask3; goto meta(context, SpawnTask); } @@ -202,23 +203,37 @@ &context->data[Element]->element); } -__code createTask3(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Task* slave, struct Element* element) { - int i = loopCounter->i; - - task->code = TaskA; - task->key = i; - element->data = (union Data *)task; - - context->next = CreateData1; - loopCounter->i++; - - goto meta(context, WaitFor1); +__code createTask3(struct Context* context, struct Allocate* allocate) { + allocate->size = sizeof(struct Task); + allocator(context); + goto meta(context, CreateTask2); } __code createTask3_stub(struct Context* context) { + goto createTask1(context, &context->data[Allocate]->allocate); +} + + +__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Element* element, struct Node* node) { + int i = loopCounter->i; + + task->code = Add; + task->oKeys[0] = i; + task->iKeys[0] = i-1; + task->iKeys[1] = i-2; + loopCounter->i -= 2; + element->data = (union Data *)task; + context->next = WaitFor1; + + node->key = okeys[0]; + goto meta(context, Get); +} + +__code createTask4_stub(struct Context* context) { goto createTask3(context, &context->data[LoopCounter]->loopCounter, &context->data[context->dataNum]->task, + &context->data[Node]->node, &context->data[Element]->element); }