Mercurial > hg > Members > innparusu > Gears
changeset 121:bb8be1820302
Rename Code Gears
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jul 2016 13:06:46 +0900 |
parents | 4df5bc41561d |
children | a086857e1812 |
files | src/parallel_execution/dependency.c src/parallel_execution/main.c src/parallel_execution/worker.c |
diffstat | 3 files changed, 14 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/dependency.c Tue Jul 19 18:42:52 2016 +0900 +++ b/src/parallel_execution/dependency.c Tue Jul 26 13:06:46 2016 +0900 @@ -7,15 +7,14 @@ goto (context->code[next])(context); } -__code waitFor1(struct Context* context, struct Task* master, struct Task* slave, struct Element* element, union Data* data) { +__code waitFor(struct Context* context, struct Task* slave, struct Element* element, union Data* data) { struct Integer integer = (struct Integer *)data; struct Queue waitMeTasks = (struct Queue *)(integer + integer-> mDataOffset); element->data = (union Data *)slave; - // enqueue waitMe goto meta_waitFor(context, waitMeTasks, PutQueue1); } -__code waitFor1_stub(struct Context* context) { +__code waitFor_stub(struct Context* context) { // think } @@ -44,36 +43,38 @@ &context->data[WaitQueue]->queue); } -__code meta_check_task_finish1(struct Context* context, struct Queue* queue, enum Code next) { +__code meta_checkTaskFinish1(struct Context* context, struct Queue* queue, enum Code next) { context->data[Queue] = (union Data *)queue; goto (context->code[next])(context); } -__code check_task_finish1(struct Context* context, struct Data* data) { +__code checkTaskFinish1(struct Context* context, struct Data* data) { struct Integer integer = (struct Integer *)data; struct Queue waitMeTasks = (struct Queue *)(integer + integer->mDataOffset); context->next = check_task_finish2; - goto meta_check_task_finish1(context, waitMeTasks, CheckTaskFinish2); + goto meta_check_task_finish1(context, waitMeTasks, GetQueue1); } -__code check_task_finish1_stub(struct Context* context) { +__code checkTaskFinish1_stub(struct Context* context) { } /* * ready input data Gear for waitme task */ -__code check_task_finish2(struct Context* context) { +__code checkTaskFinish2(struct Context* context) { struct Task task = ((struct Task) element -> data); task->idsCount--; } -__code check_task_finish2_stub(struct Context* context) { +__code checkTaskFinish2_stub(struct Context* context) { } __code add(struct Context* context, struct Integer* input1, struct Integer* input2, struct Integer* output) { output->value = input1->value + input2->value; + goto meta(context, context->next); } __code mult(struct Context* context, struct Integer* input1, struct Integer* input2, struct Integer* output) { output->value = input1->value * input2->value; + goto meta(context, context->next); }
--- a/src/parallel_execution/main.c Tue Jul 19 18:42:52 2016 +0900 +++ b/src/parallel_execution/main.c Tue Jul 26 13:06:46 2016 +0900 @@ -301,12 +301,12 @@ if (i < worker->num) { struct Context* worker_context = &worker->contexts[i]; - worker_context->next = GetQueue; + worker_context->next = GetQueue2; worker_context->data[Tree] = context->data[Tree]; worker_context->data[ActiveQueue] = context->data[ActiveQueue]; worker_context->data[WaitQueue] = context->data[WaitQueue]; worker_context->data[Queue] = context->data[ActiveQueue]; - pthread_create(&worker_context->thread, NULL, (void*)&start_code, worker_context); + pthread_create(&worker_context->thread, NULL, (void*)&getQueue1, worker_context); worker_context->thread_num = i; loopCounter->i++;
--- a/src/parallel_execution/worker.c Tue Jul 19 18:42:52 2016 +0900 +++ b/src/parallel_execution/worker.c Tue Jul 26 13:06:46 2016 +0900 @@ -3,7 +3,7 @@ #include "context.h" #include "origin_cs.h" -__code getQueue(struct Context* context, struct Queue* queue, struct Element* element) { +__code getQueue1(struct Context* context, struct Queue* queue, struct Element* element) { if (queue->first == 0) return; @@ -16,7 +16,7 @@ } } -__code getQueue_stub(struct Context* context) { +__code getQueue1_stub(struct Context* context) { goto getQueue(context, &context->data[Queue]->queue, &context->data[Element]->element); }