Mercurial > hg > GearsTemplate
changeset 217:c34e6aa10967
Fix DataGear access name
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 Jan 2017 01:18:13 +0900 |
parents | 6578c5c274ba |
children | d8a59b727f65 |
files | src/parallel_execution/allocate.c src/parallel_execution/context.h src/parallel_execution/main.c src/parallel_execution/queue.c src/parallel_execution/rb_tree.c src/parallel_execution/stack.c src/parallel_execution/twice.c src/parallel_execution/worker.c |
diffstat | 8 files changed, 42 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/allocate.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/allocate.c Mon Jan 09 01:18:13 2017 +0900 @@ -3,7 +3,7 @@ union Data* allocator(struct Context* context) { context->data[++context->dataNum] = context->heap; - context->heap += context->data[D_Allocate]->allocate.size; + context->heap += context->data[D_Allocate]->Allocate.size; return context->data[context->dataNum]; } @@ -14,5 +14,5 @@ } __code allocator_stub(struct Context* context) { - goto allocatorCS(context, &context->data[D_Allocate]->allocate); + goto allocatorCS(context, &context->data[D_Allocate]->Allocate); }
--- a/src/parallel_execution/context.h Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/context.h Mon Jan 09 01:18:13 2017 +0900 @@ -72,7 +72,7 @@ struct LoopCounter { int i; struct Tree* tree; - } loopCounter; + } LoopCounter; struct TaskManager { int numWorker; enum Code spawn; @@ -189,7 +189,7 @@ enum Code next; struct RedBlackTree* traverse; struct Tree* tree; - } rotateTree; + } RotateTree; struct Node { int key; // comparable data segment union Data* value; @@ -200,20 +200,15 @@ Red, Black, } color; - } node; + } Node; struct Allocate { enum Code next; long size; - } allocate; + } Allocate; struct OutPutDataSegments { union Data **data; - } ods; + } Ods; }; // union Data end #include "c/typedefData.h" - -union MetaData { - struct Queue waitMeTasks; - struct Queue waitI; -}; #endif
--- a/src/parallel_execution/main.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/main.c Mon Jan 09 01:18:13 2017 +0900 @@ -66,7 +66,7 @@ } __code code2_stub(struct Context* context) { - goto code2(context, &context->data[D_Node]->node.value->Array, &context->data[D_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[D_Allocate]->allocate, &context->data[D_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, Tree* tree) { @@ -105,9 +105,9 @@ __code createData2_stub(struct Context* context) { goto createData2(context, - &context->data[D_LoopCounter]->loopCounter, + &context->data[D_LoopCounter]->LoopCounter, &context->data[context->dataNum]->Array, - &context->data[D_Node]->node, + &context->data[D_Node]->Node, Gearef(context, Tree)); } @@ -126,7 +126,7 @@ __code createTask1_stub(struct Context* context) { Task* task = &ALLOCATE(context, Task)->Task; goto createTask1(context, - &context->data[D_LoopCounter]->loopCounter, + &context->data[D_LoopCounter]->LoopCounter, task, &context->data[D_Element]->Element); } @@ -197,7 +197,7 @@ } __code createWorker1_stub(struct Context* context) { - goto createWorker1(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->Worker); + goto createWorker1(context, &context->data[D_LoopCounter]->LoopCounter, &context->data[D_Worker]->Worker); } __code taskManager(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { @@ -218,7 +218,7 @@ } __code taskManager_stub(struct Context* context) { - goto taskManager(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->Worker); + goto taskManager(context, &context->data[D_LoopCounter]->LoopCounter, &context->data[D_Worker]->Worker); } void init(int argc, char** argv) {
--- a/src/parallel_execution/queue.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/queue.c Mon Jan 09 01:18:13 2017 +0900 @@ -16,7 +16,7 @@ } void printQueue1(union Data* data) { - struct Node* node = &data->Element.data->node; + struct Node* node = &data->Element.data->Node; if (node == NULL) { printf("NULL"); } else {
--- a/src/parallel_execution/rb_tree.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/rb_tree.c Mon Jan 09 01:18:13 2017 +0900 @@ -18,7 +18,7 @@ } void printTree1(union Data* data) { - struct Node* node = &data->node; + struct Node* node = &data->Node; if (node == NULL) { printf("NULL"); } else { @@ -50,11 +50,11 @@ } __code putRedBlackTree_stub(struct Context* context) { - struct Node* newNode = &ALLOCATE(context, Node)->node; + struct Node* newNode = &ALLOCATE(context, Node)->Node; goto putRedBlackTree(context, &context->data[D_Stack]->Stack, &context->data[D_RedBlackTree]->RedBlackTree, - &context->data[D_Node]->node, + &context->data[D_Node]->Node, context->data[D_RedBlackTree]->RedBlackTree.root, newNode ); @@ -100,10 +100,10 @@ } __code replaceNode1_stub(struct Context* context) { - struct Node* newnewNode = &ALLOCATE(context, Node)->node; + struct Node* newnewNode = &ALLOCATE(context, Node)->Node; goto replaceNode1(context, &context->data[D_RedBlackTree]->RedBlackTree, - &context->data[D_Node]->node, + &context->data[D_Node]->Node, context->data[D_RedBlackTree]->RedBlackTree.current, context->data[D_RedBlackTree]->RedBlackTree.previous, newnewNode, @@ -124,7 +124,7 @@ goto insertNode(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_Stack]->Stack, - &context->data[D_Node]->node, + &context->data[D_Node]->Node, context->data[D_RedBlackTree]->RedBlackTree.newNode); } @@ -141,8 +141,8 @@ __code insertCase1_stub(struct Context* context) { goto insertCase1(context, &context->data[D_RedBlackTree]->RedBlackTree, - &context->data[D_Stack]->Stack.data->node, - &context->data[D_Stack]->Stack.data1->node); + &context->data[D_Stack]->Stack.data->Node, + &context->data[D_Stack]->Stack.data1->Node); } __code insertCase2(struct Context* context, struct RedBlackTree* traverse) { @@ -212,7 +212,7 @@ } __code insertCase4_stub(struct Context* context) { - goto insertCase4(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_RotateTree]->rotateTree); + goto insertCase4(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_RotateTree]->RotateTree); } __code insertCase5(struct Context* context, struct RedBlackTree* traverse,struct Stack *nodeStack) { @@ -244,9 +244,9 @@ } __code insertCase51_stub(struct Context* context) { - struct Node* parent = &context->data[D_Stack]->Stack.data->node; - struct Node* grandparent = &context->data[D_Stack]->Stack.data1->node; - goto insertCase51(context, &context->data[D_RedBlackTree]->RedBlackTree,&context->data[D_RotateTree]->rotateTree, context->data[D_RedBlackTree]->RedBlackTree.current, parent, grandparent); + struct Node* parent = &context->data[D_Stack]->Stack.data->Node; + struct Node* grandparent = &context->data[D_Stack]->Stack.data1->Node; + goto insertCase51(context, &context->data[D_RedBlackTree]->RedBlackTree,&context->data[D_RotateTree]->RotateTree, context->data[D_RedBlackTree]->RedBlackTree.current, parent, grandparent); } __code rotateLeft(struct Context* context, struct RedBlackTree* traverse,struct Stack* nodeStack) { @@ -256,7 +256,7 @@ } __code rotateLeft_stub(struct Context* context) { - struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse; + struct RedBlackTree* traverse = context->data[D_RotateTree]->RotateTree.traverse; goto rotateLeft(context, traverse, &context->data[D_Stack]->Stack); } @@ -280,13 +280,13 @@ } __code rotateLeft1_stub(struct Context* context) { - struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse; - struct Node* parent = &context->data[D_Stack]->Stack.data->node; + struct RedBlackTree* traverse = context->data[D_RotateTree]->RotateTree.traverse; + struct Node* parent = &context->data[D_Stack]->Stack.data->Node; goto rotateLeft1(context, traverse->current, traverse, parent, - &context->data[D_RotateTree]->rotateTree); + &context->data[D_RotateTree]->RotateTree); } __code rotateRight(struct Context* context, struct RedBlackTree* traverse,struct Stack *nodeStack) { @@ -296,7 +296,7 @@ } __code rotateRight_stub(struct Context* context) { - struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse; + struct RedBlackTree* traverse = context->data[D_RotateTree]->RotateTree.traverse; goto rotateLeft(context, traverse, &context->data[D_Stack]->Stack); } @@ -320,13 +320,13 @@ } __code rotateRight1_stub(struct Context* context) { - struct RedBlackTree* traverse = context->data[D_RotateTree]->rotateTree.traverse; - struct Node* parent = &context->data[D_Stack]->Stack.data->node; + struct RedBlackTree* traverse = context->data[D_RotateTree]->RotateTree.traverse; + struct Node* parent = &context->data[D_Stack]->Stack.data->Node; goto rotateRight1(context, traverse->current, traverse, parent, - &context->data[D_RotateTree]->rotateTree); + &context->data[D_RotateTree]->RotateTree); } __code stackClear(struct Context* context, struct RedBlackTree* traverse,struct Stack *nodeStack, enum Code next) { @@ -376,7 +376,7 @@ } __code search_stub(struct Context* context) { - goto search(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_Node]->node, Gearef(context, Tree)->next); + goto search(context, &context->data[D_RedBlackTree]->RedBlackTree, &context->data[D_Node]->Node, Gearef(context, Tree)->next); } /* /\* __code delete(struct Context* context, struct Tree* tree) { *\/ */
--- a/src/parallel_execution/stack.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/stack.c Mon Jan 09 01:18:13 2017 +0900 @@ -19,7 +19,7 @@ } void printStack1(union Data* data) { - struct Node* node = &data->Element.data->node; + struct Node* node = &data->Element.data->Node; if (node == NULL) { printf("NULL"); } else {
--- a/src/parallel_execution/twice.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/twice.c Mon Jan 09 01:18:13 2017 +0900 @@ -21,8 +21,8 @@ __code twice_stub(struct Context* context) { goto twice(context, - &context->data[D_LoopCounter]->loopCounter, - context->data[D_Node]->node.value->Array.index, - context->data[D_Node]->node.value->Array.prefix, - context->data[D_Node]->node.value->Array.array); + &context->data[D_LoopCounter]->LoopCounter, + context->data[D_Node]->Node.value->Array.index, + context->data[D_Node]->Node.value->Array.prefix, + context->data[D_Node]->Node.value->Array.array); }
--- a/src/parallel_execution/worker.c Fri Jan 06 06:53:54 2017 +0900 +++ b/src/parallel_execution/worker.c Mon Jan 09 01:18:13 2017 +0900 @@ -27,7 +27,7 @@ } __code getTask2_stub(struct Context* context) { - goto getTask2(context, /*&(context->data[D_ActiveQueue]->Queue.data->Task)*/ NULL, &context->data[D_Node]->node); + goto getTask2(context, /*&(context->data[D_ActiveQueue]->Queue.data->Task)*/ NULL, &context->data[D_Node]->Node); } #ifdef USE_CUDA