diff src/parallel_execution/main.c @ 148:473b7d990a1f

fix data gears type enum
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 10 Nov 2016 12:07:53 +0900
parents d529c024e5a5
children 63ab65b28466
line wrap: on
line diff
--- a/src/parallel_execution/main.c	Thu Nov 10 10:35:48 2016 +0900
+++ b/src/parallel_execution/main.c	Thu Nov 10 12:07:53 2016 +0900
@@ -40,7 +40,7 @@
 
     context->next = CreateWorker;
 
-    struct Time *t = &context->data[Time]->time;
+    struct Time *t = &context->data[D_Time]->time;
     t->next = CreateWorker;
     goto meta(context, StartTime);
 }
@@ -66,7 +66,7 @@
 }
 
 __code code2_stub(struct Context* context) {
-    goto code2(context, &context->data[Node]->node.value->array, &context->data[LoopCounter]->loopCounter);
+    goto code2(context, &context->data[D_Node]->node.value->array, &context->data[D_LoopCounter]->loopCounter);
 }
 
 __code createData1(struct Context* context, struct Allocate* allocate, struct LoopCounter* loopCounter) {
@@ -84,7 +84,7 @@
 }
 
 __code createData1_stub(struct Context* context) {
-    goto createData1(context, &context->data[Allocate]->allocate, &context->data[LoopCounter]->loopCounter);
+    goto createData1(context, &context->data[D_Allocate]->allocate, &context->data[D_LoopCounter]->loopCounter);
 }
 
 __code createData2(struct Context* context, struct LoopCounter* loopCounter, struct Array* array, struct Node* node) {
@@ -104,9 +104,9 @@
 
 __code createData2_stub(struct Context* context) {
     goto createData2(context,
-            &context->data[LoopCounter]->loopCounter,
+            &context->data[D_LoopCounter]->loopCounter,
             &context->data[context->dataNum]->array,
-            &context->data[Node]->node);
+            &context->data[D_Node]->node);
 }
 
 __code createTask1(struct Context* context, struct Allocate* allocate) {
@@ -116,7 +116,7 @@
 }
 
 __code createTask1_stub(struct Context* context) {
-    goto createTask1(context, &context->data[Allocate]->allocate);
+    goto createTask1(context, &context->data[D_Allocate]->allocate);
 }
 
 __code createTask2(struct Context* context, struct Allocate* allocate) {
@@ -126,7 +126,7 @@
 }
 
 __code createTask2_stub(struct Context* context) {
-    goto createTask2(context, &context->data[Allocate]->allocate);
+    goto createTask2(context, &context->data[D_Allocate]->allocate);
 }
 
 __code createTask3(struct Context* context, struct Allocate* allocate) {
@@ -136,11 +136,11 @@
 }
 
 __code createTask3_stub(struct Context* context) {
-    goto createTask3(context, &context->data[Allocate]->allocate);
+    goto createTask3(context, &context->data[D_Allocate]->allocate);
 }
 
 __code meta_createTask4(struct Context* context, struct Queue* activeQueue, enum Code next) {
-    context->data[Queue] = (union Data *)activeQueue;
+    context->data[D_Queue] = (union Data *)activeQueue;
     goto (context->code[next])(context);
 }
 
@@ -171,12 +171,12 @@
 
 __code createTask4_stub(struct Context* context) {
     goto createTask4(context,
-            &context->data[LoopCounter]->loopCounter,
+            &context->data[D_LoopCounter]->loopCounter,
             &context->data[context->dataNum-2]->task,
             &context->data[context->dataNum-1]->queue,
             &context->data[context->dataNum]->queue,
-            &context->data[Element]->element,
-            &context->data[ActiveQueue]->queue);
+            &context->data[D_Element]->element,
+            &context->data[D_ActiveQueue]->queue);
 }
 
 
@@ -234,7 +234,7 @@
 }
 
 __code putQueue1_stub(struct Context* context) {
-    goto putQueue1(context, &context->data[Allocate]->allocate);
+    goto putQueue1(context, &context->data[D_Allocate]->allocate);
 }
 
 __code putQueue2(struct Context* context, struct Element* new_element, struct Element* element, struct Queue* queue) {
@@ -249,8 +249,8 @@
 __code putQueue2_stub(struct Context* context) {
     goto putQueue2(context,
             &context->data[context->dataNum]->element,
-            &context->data[Element]->element,
-            &context->data[Queue]->queue);
+            &context->data[D_Element]->element,
+            &context->data[D_Queue]->queue);
 }
 
 __code putQueue3(struct Context* context, struct Queue* queue, struct Element* new_element) {
@@ -267,7 +267,7 @@
 }
 
 __code putQueue3_stub(struct Context* context) {
-    goto putQueue3(context, &context->data[Queue]->queue, &context->data[context->dataNum]->element);
+    goto putQueue3(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element);
 }
 
 __code putQueue4(struct Context* context, struct Queue* queue, struct Element* new_element) {
@@ -282,7 +282,7 @@
 }
 
 __code putQueue4_stub(struct Context* context) {
-    goto putQueue4(context, &context->data[Queue]->queue, &context->data[context->dataNum]->element);
+    goto putQueue4(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element);
 }
 
 __code createWorker(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) {
@@ -291,8 +291,8 @@
     if (i < worker->num) {
         struct Context* worker_context = &worker->contexts[i];
         worker_context->next = GetQueue;
-        worker_context->data[Tree] = context->data[Tree];
-        worker_context->data[ActiveQueue] = context->data[ActiveQueue];
+        worker_context->data[D_Tree] = context->data[D_Tree];
+        worker_context->data[D_ActiveQueue] = context->data[D_ActiveQueue];
         pthread_create(&worker_context->thread, NULL, (void*)&start_code, worker_context);
         worker_context->thread_num = i;
         loopCounter->i++;
@@ -305,7 +305,7 @@
 }
 
 __code createWorker_stub(struct Context* context) {
-    goto createWorker(context, &context->data[LoopCounter]->loopCounter, &context->data[Worker]->worker);
+    goto createWorker(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->worker);
 }
 
 __code taskManager(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) {
@@ -320,13 +320,13 @@
 
     loopCounter->i = 0;
 
-    struct Time *t = &context->data[Time]->time;
+    struct Time *t = &context->data[D_Time]->time;
     t->next = C_code2;
     goto meta(context, EndTime);
 }
 
 __code taskManager_stub(struct Context* context) {
-    goto taskManager(context, &context->data[LoopCounter]->loopCounter, &context->data[Worker]->worker);
+    goto taskManager(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->worker);
 }
 
 void init(int argc, char** argv) {
@@ -355,7 +355,7 @@
 
     struct Context* worker_contexts = NEWN(cpu_num, struct Context);
 
-    struct Worker* worker = &main_context->data[Worker]->worker;
+    struct Worker* worker = &main_context->data[D_Worker]->worker;
     worker->num = cpu_num;
     worker->contexts = worker_contexts;