Mercurial > hg > Members > innparusu > Gears
diff src/parallel_execution/main.c @ 111:556e203de999
Add dependency.c
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 02 May 2016 20:39:02 +0900 |
parents | 059b26a250cc |
children | e3cba827d489 |
line wrap: on
line diff
--- a/src/parallel_execution/main.c Mon May 02 20:04:06 2016 +0900 +++ b/src/parallel_execution/main.c Mon May 02 20:39:02 2016 +0900 @@ -50,7 +50,7 @@ __code code2(struct Context* context, struct Array* array, struct LoopCounter* loopCounter) { int i = loopCounter->i; - + if (i < length) { // printf("%d\n", array->array[i]); if (array->array[i] == (i*2)) { @@ -81,7 +81,7 @@ loopCounter->i = 0; goto meta(context, Code1); } - + __code createData1_stub(struct Context* context) { goto createData1(context, &context->data[Allocate]->allocate, &context->data[LoopCounter]->loopCounter); } @@ -95,7 +95,7 @@ node->key = i; node->value = (union Data*)array; - + context->next = CreateTask1; goto meta(context, PutTree); @@ -103,9 +103,9 @@ __code createData2_stub(struct Context* context) { goto createData2(context, - &context->data[LoopCounter]->loopCounter, - &context->data[context->dataNum]->array, - &context->data[Node]->node); + &context->data[LoopCounter]->loopCounter, + &context->data[context->dataNum]->array, + &context->data[Node]->node); } __code createTask1(struct Context* context, struct Allocate* allocate) { @@ -146,6 +146,47 @@ &context->data[ActiveQueue]->queue); } + +//__code createTask2(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Element* element) { +// int i = loopCounter->i; +// +// task->code = TaskC; +// task->key = i; +// +// element->task = task; +// +// context->next = CreateData1; +// loopCounter->i++; +// +// goto meta(context, PutQueue1); +//} +// +//__code createTask2_stub(struct Context* context) { +// goto createTask2(context, +// &context->data[LoopCounter]->loopCounter, +// &context->data[context->dataNum]->task, +// &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 = TaskB; +// task->key = i; +// element->task = task; +// +// context->next = CreateData1; +// loopCounter->i++; +// +// goto meta(context, WaitFor1); +//} +// +//__code createTask3_stub(struct Context* context) { +// goto createTask2(context, +// &context->data[context->dataNum]->task, +// &context->data[Element]->element); +//} + __code putQueue1(struct Context* context, struct Allocate* allocate) { allocate->size = sizeof(struct Element); allocator(context);