changeset 221:2454f4392316

Success create Task and inqueue Task
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Mon, 09 Jan 2017 21:39:33 +0900
parents 6c0692c9bfed
children 77faa28128b4
files src/parallel_execution/rb_tree.c src/parallel_execution/taskManager.c
diffstat 2 files changed, 23 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/rb_tree.c	Mon Jan 09 21:16:29 2017 +0900
+++ b/src/parallel_execution/rb_tree.c	Mon Jan 09 21:39:33 2017 +0900
@@ -54,9 +54,9 @@
 __code putRedBlackTree_stub(struct Context* context) {
     struct Node* newNode = &ALLOCATE(context, Node)->Node;
     goto putRedBlackTree(context,
-             &Gearef(context, Tree)->tree->RedBlackTree,
+             &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
              Gearef(context, Tree)->node,
-             Gearef(context, Tree)->tree->RedBlackTree.root,
+             Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.root,
              newNode
              );
 }
@@ -72,10 +72,10 @@
 
 __code replaceNode_stub(struct Context* context) {
     goto replaceNode(context,
-                  &Gearef(context, Tree)->tree->RedBlackTree,
-                  Gearef(context, Tree)->tree->RedBlackTree.current,
+                  &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
+                  Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.current,
                   //context->data[D_RedBlackTree]->RedBlackTree.newNode,
-                  Gearef(context, Tree)->tree->RedBlackTree.newNode,
+                  Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.newNode,
                   Gearef(context, Stack));
 }
 
@@ -103,12 +103,12 @@
 __code replaceNode1_stub(struct Context* context) {
     struct Node* newnewNode = &ALLOCATE(context, Node)->Node;
     goto replaceNode1(context,
-                     &Gearef(context, Tree)->tree->RedBlackTree,
+                     &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
                      Gearef(context, Tree)->node,
-                     Gearef(context, Tree)->tree->RedBlackTree.current,
-                     Gearef(context, Tree)->tree->RedBlackTree.previous,
+                     Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.current,
+                     Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.previous,
                      newnewNode,
-                     Gearef(context, Tree)->tree->RedBlackTree.result,
+                     Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.result,
                      Gearef(context, Tree)->next);
 }
 
@@ -123,10 +123,10 @@
 
 __code insertNode_stub(struct Context* context) {
     goto insertNode(context,
-                    &Gearef(context, Tree)->tree->RedBlackTree,
+                    &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
                     Gearef(context, Stack),
                     Gearef(context, Tree)->node,
-                    Gearef(context, Tree)->tree->RedBlackTree.newNode);
+                    Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.newNode);
 }
 
 __code insertCase1(struct Context* context, struct RedBlackTree* traverse, struct Node *parent, struct Node *grandparent) {
@@ -141,7 +141,7 @@
 
 __code insertCase1_stub(struct Context* context) {
     goto insertCase1(context, 
-        &Gearef(context, Tree)->tree->RedBlackTree,
+        &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
         &context->data[D_Stack]->Stack.data->Node,
         &context->data[D_Stack]->Stack.data1->Node);
 }
@@ -154,7 +154,7 @@
 }
 
 __code insertCase2_stub(struct Context* context) {
-    goto insertCase2(context, &Gearef(context, Tree)->tree->RedBlackTree);
+    goto insertCase2(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree);
 }
 
 __code insertCase3(struct Context* context, struct RedBlackTree* traverse, struct Stack* nodeStack) {
@@ -179,7 +179,7 @@
 }
 
 __code insertCase3_stub(struct Context* context) {
-    goto insertCase3(context, &Gearef(context, Tree)->tree->RedBlackTree,
+    goto insertCase3(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
                      Gearef(context, Stack));
 }
 
@@ -212,7 +212,7 @@
 }
 
 __code insertCase4_stub(struct Context* context) {
-    goto insertCase4(context, &Gearef(context, Tree)->tree->RedBlackTree, Gearef(context, RotateTree));
+    goto insertCase4(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree, Gearef(context, RotateTree));
 }
 
 __code insertCase5(struct Context* context, struct RedBlackTree* traverse,struct Stack *nodeStack) {
@@ -222,7 +222,7 @@
 }
 
 __code insertCase5_stub(struct Context* context) {
-    goto insertCase5(context, &Gearef(context, Tree)->tree->RedBlackTree, Gearef(context, Stack));
+    goto insertCase5(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree, Gearef(context, Stack));
 }
 
 __code insertCase51(struct Context* context, struct RedBlackTree* traverse, struct RotateTree *rotateTree, struct Node* current, struct Node* parent, struct Node* grandparent) {
@@ -247,9 +247,9 @@
     struct Node* parent = &context->data[D_Stack]->Stack.data->Node;
     struct Node* grandparent = &context->data[D_Stack]->Stack.data1->Node;
     goto insertCase51(context,
-                      &Gearef(context, Tree)->tree->RedBlackTree,
+                      &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree,
                       Gearef(context, RotateTree),
-                      Gearef(context, Tree)->tree->RedBlackTree.current,
+                      Gearef(context, Tree)->tree->Tree.tree->RedBlackTree.current,
                       parent,
                       grandparent);
 }
@@ -342,7 +342,7 @@
 }
 
 __code stackClear_stub(struct Context* context) {
-    goto stackClear(context, &Gearef(context, Tree)->tree->RedBlackTree, Gearef(context, Stack),
+    goto stackClear(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree, Gearef(context, Stack),
         Gearef(context, Tree)->next);
 }
     
@@ -358,7 +358,7 @@
 }
 
 __code getRedBlackTree_stub(struct Context* context) {
-    goto getRedBlackTree(context, &Gearef(context, Tree)->tree->RedBlackTree, Gearef(context, Tree)->next);
+    goto getRedBlackTree(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree, Gearef(context, Tree)->next);
 }
 
 __code search(struct Context* context, struct RedBlackTree* traverse, struct Node* node, enum Code next) {
@@ -381,7 +381,7 @@
 }
 
 __code search_stub(struct Context* context) {
-    goto search(context, &Gearef(context, Tree)->tree->RedBlackTree, Gearef(context, Node), Gearef(context, Tree)->next);
+    goto search(context, &Gearef(context, Tree)->tree->Tree.tree->RedBlackTree, Gearef(context, Node), Gearef(context, Tree)->next);
 }
 
 /* /\* __code delete(struct Context* context, struct Tree* tree) { *\/ */
--- a/src/parallel_execution/taskManager.c	Mon Jan 09 21:16:29 2017 +0900
+++ b/src/parallel_execution/taskManager.c	Mon Jan 09 21:39:33 2017 +0900
@@ -7,6 +7,7 @@
 union Data* createTaskManager(struct Context* context) {
     struct TaskManager* taskManager = &ALLOCATE(context, TaskManager)->TaskManager;
     struct TaskManagerImpl* taskManagerImpl = &ALLOCATE(context, TaskManagerImpl)->TaskManagerImpl;
+    taskManager->taskManager = (union Data*)taskManagerImpl;
     taskManagerImpl -> activeQueue = &createSynchronizedQueue(context)->Queue;
     taskManagerImpl -> taskQueue = &createSynchronizedQueue(context)->Queue;
     taskManager->spawn = C_spawnTaskManager;
@@ -30,7 +31,7 @@
 
 __code spawnTaskManager_stub(struct Context* context) {
     goto spawnTaskManager(context,
-            (struct TaskManagerImpl *)context->data[D_TaskManager]->TaskManager.taskManager->TaskManager.taskManager,
+            &context->data[D_TaskManager]->TaskManager.taskManager->TaskManager.taskManager->TaskManagerImpl,
             &context->data[D_Queue]->Queue,
             context->data[D_TaskManager]->TaskManager.task,
             context->data[D_TaskManager]->TaskManager.next