changeset 407:00d9b0664bdb

Fix
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Wed, 06 Sep 2017 20:40:43 +0900
parents 9b35e6581b5c
children 8ee89eefbc6d
files src/parallel_execution/examples/bitonicSort/bitonicSort.cbc src/parallel_execution/examples/calc/calc.cbc src/parallel_execution/generate_stub.pl
diffstat 3 files changed, 7 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/examples/bitonicSort/bitonicSort.cbc	Wed Sep 06 15:11:27 2017 +0900
+++ b/src/parallel_execution/examples/bitonicSort/bitonicSort.cbc	Wed Sep 06 20:40:43 2017 +0900
@@ -96,8 +96,7 @@
 }
 
 __code code2(struct LoopCounter* loopCounter, struct TaskManager* taskManager, struct Time* time) {
-    taskManager->next = C_exit_code;
-    goto meta(context, taskManager->taskManager->TaskManager.shutdown);
+    goto taskManager->shutdown(exit_code);
 }
 
 void init(int argc, char** argv) {
--- a/src/parallel_execution/examples/calc/calc.cbc	Wed Sep 06 15:11:27 2017 +0900
+++ b/src/parallel_execution/examples/calc/calc.cbc	Wed Sep 06 20:40:43 2017 +0900
@@ -12,21 +12,6 @@
 int CPU_ANY = -1;
 int CPU_CUDA = -1;
 
-void print_queue(struct Element* element) {
-    while (element) {
-        printf("%p\n", ((struct Task *)(element->data)));
-        element = element->next;
-    }
-}
-
-void print_tree(struct Node* node) {
-    if (node != 0) {
-        printf("%d\n", node->value->Array.index);
-        print_tree(node->left);
-        print_tree(node->right);
-    }
-}
-
 void *start_taskManager(struct Context *context) {
     goto initDataGears(context, Gearef(context, LoopCounter), Gearef(context, TaskManager));
     return 0;
@@ -47,7 +32,7 @@
     while(! cuda_initialized) {};
 #endif
 #endif
-    goto meta(context, C_createTask1);
+    goto meta(context, C_code1);
 }
 
 __code initDataGears_stub(struct Context* context) {
@@ -81,7 +66,7 @@
     /* puts("result"); */
 
     //time->next = C_code2;
-    goto meta(context, C_exit_code);
+    goto meta(context, C_createTask1);
     //goto meta(context, C_start_time);
 }
 
@@ -99,9 +84,8 @@
     }
 
     loopCounter->i = 0;
-    taskManager->next = C_code1;
-    sleep(5);
-    goto meta(context, taskManager->taskManager->TaskManager.shutdown);
+    taskManager->next = C_exit_code;
+    goto taskManager->shutdown(exit_code);
 }
 
 __code createTask2(struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
--- a/src/parallel_execution/generate_stub.pl	Wed Sep 06 15:11:27 2017 +0900
+++ b/src/parallel_execution/generate_stub.pl	Wed Sep 06 20:40:43 2017 +0900
@@ -429,7 +429,6 @@
                 }
                 if (! $inParGoto) {
                     $inParGoto = 1;
-                    print $fd "${prev}struct SingleLinkedQueue* queue = &context->tasks->queue->SingleLinkedQueue;\n";
                     print $fd "${prev}struct Element* element;\n";
                 }
                 my $initTask = << "EOFEOF";
@@ -465,8 +464,8 @@
                 ${prev}element = &ALLOCATE(context, Element)->Element;
                 ${prev}element->next = NULL;
                 ${prev}element->data = (union Data*)context->task;
-                ${prev}queue->last->next  = element;
-                ${prev}queue->last = element;
+                ${prev}context->tasks->queue->SingleLinkedQueue.last->next  = element;
+                ${prev}context->tasks->queue->SingleLinkedQueue.last = element;
 EOFEOF
                 print $fd $putTask;
                 next;