changeset 355:45afe5d70956

Fix
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Thu, 22 Jun 2017 16:20:56 +0900
parents 6dcf6f909e15
children 62b7dbe7f88e a2c01ab30ea2
files src/parallel_execution/TaskManagerImpl.cbc src/parallel_execution/examples/Mult.cbc src/parallel_execution/examples/calc.cbc src/parallel_execution/generate_context.pl
diffstat 4 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/TaskManagerImpl.cbc	Tue Jun 20 03:17:02 2017 +0900
+++ b/src/parallel_execution/TaskManagerImpl.cbc	Thu Jun 22 16:20:56 2017 +0900
@@ -57,6 +57,7 @@
     int i = taskManagerImpl->loopCounter->i;
     struct Context* task = contexts[i];
     if(i < GET_SIZE(contexts)) {
+        taskManagerImpl->loopCounter->i++;
         taskManager->context = task;
         taskManager->next = C_spawnTasksTaskManager;
         goto meta(context, C_setWorker);
@@ -77,6 +78,7 @@
     int i = taskManagerImpl->loopCounter->i;
     struct Context* task = contexts[i];
     if(i < GET_SIZE(contexts)) {
+        taskManagerImpl->loopCounter->i++;
         taskManager->context = task;
         taskManager->next = C_spawnTasksTaskManager1;
         goto meta(context, C_spawnTaskManager);
--- a/src/parallel_execution/examples/Mult.cbc	Tue Jun 20 03:17:02 2017 +0900
+++ b/src/parallel_execution/examples/Mult.cbc	Thu Jun 22 16:20:56 2017 +0900
@@ -3,7 +3,7 @@
 __code mult(struct Integer* input1, struct Integer* input2, __code next(struct Integer* output, ...)) {
     struct Integer* output = *O_output;
     output->value = input1->value * input2->value;
-    printf("%d + %d = %d\n", input1->value, input2->value, output->value);
+    printf("%d * %d = %d\n", input1->value, input2->value, output->value);
     *O_output = output;
     goto meta(context, next);
 }
--- a/src/parallel_execution/examples/calc.cbc	Tue Jun 20 03:17:02 2017 +0900
+++ b/src/parallel_execution/examples/calc.cbc	Thu Jun 22 16:20:56 2017 +0900
@@ -127,7 +127,7 @@
 
     Integer* integer4 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer;
     Integer* integer5 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer;
-    // par goto add(integer2, integer3, integer1, __exit);
+    // par goto add(integer4, integer5, integer1, __exit);
     task = NEW(struct Context);
     initContext(task);
     task->taskManager = &taskManager->taskManager->TaskManager;
@@ -160,7 +160,7 @@
     //goto taskManager->setWaitTask(createTask1);
     taskManager->contexts = tasks;
     // goto crateTask1();
-    taskManager->next = C_createTask1;
+    taskManager->next1 = C_createTask1;
     goto meta(context, taskManager->taskManager->TaskManager.spawnTasks);
 }
 
--- a/src/parallel_execution/generate_context.pl	Tue Jun 20 03:17:02 2017 +0900
+++ b/src/parallel_execution/generate_context.pl	Thu Jun 22 16:20:56 2017 +0900
@@ -160,7 +160,7 @@
     // context->data[D_ActiveQueue] = createSynchronizedQueue(context);
     // context->data[D_WaitQueue]   = createSynchronizedQueue(context);
 
-    context->dataNum = D_Queue;
+    context->dataNum = D_Worker;
 }
 EOFEOF