changeset 524:3bb5da57ddb5

Fix
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Sun, 21 Jan 2018 23:27:19 +0900
parents e28e3bd6b181
children 98c5235b3ecb
files src/parallel_execution/RedBlackTreeReWright.cbc src/parallel_execution/SemaphoreImpl.cbc src/parallel_execution/TaskManagerImpl.cbc src/parallel_execution/examples/bitonicSort/sort.cbc src/parallel_execution/examples/boundedBuffer/SemaphoreImpl.cbc src/parallel_execution/examples/twice/printArray.cbc
diffstat 6 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/RedBlackTreeReWright.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/RedBlackTreeReWright.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -211,7 +211,7 @@
     tree->current->right->color = Black;
     goto stack->pop(insertBalance);
 
-  } else if(tree->current->color == Black && tree->current->left->color == Red && tree->current->left->right->color == Red) {
+  } else if (tree->current->color == Black && tree->current->left->color == Red && tree->current->left->right->color == Red) {
     struct Node* tmpCurrent   = tree->current;
     struct Node* tmpLeft      = tree->current->left;
     struct Node* tmpLeftRight = tree->current->left->right;
--- a/src/parallel_execution/SemaphoreImpl.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/SemaphoreImpl.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -19,7 +19,7 @@
 }
 
 __code pOperationSemaphoreImpl1(struct SemaphoreImpl* semaphore, __code next(...)) {
-    if(semaphore->value == 0) {
+    if (semaphore->value == 0) {
         pthread_cond_wait(&semaphore->cond, &semaphore->mutex);
         goto meta(context, C_pOperationSemaphoreImpl1);
     }
--- a/src/parallel_execution/TaskManagerImpl.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/TaskManagerImpl.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -99,7 +99,7 @@
 
 __code setWaitTaskTaskManagerImpl(struct TaskManagerImpl* taskManager, struct Context* task, __code next(...)) {
     int i = taskManager->loopCounter;
-    if(task->idg+i < task->maxIdg) {
+    if (task->idg+i < task->maxIdg) {
         struct Queue* queue = GET_WAIT_LIST(task->data[task->idg + i]);
         taskManager->loopCounter++;
         goto queue->put(task, setWaitTaskTaskManagerImpl);
@@ -122,7 +122,7 @@
     task->taskManager = taskManager;
     if (task->idgCount == 0) {
         // iterator task is normal task until spawned
-        if(task->iterator != NULL && task->iterate == 0) {
+        if (task->iterator != NULL && task->iterate == 0) {
             pthread_mutex_unlock(&taskManagerImpl->mutex);
             struct Iterator* iterator = task->iterator;
             goto iterator->exec(task, taskManagerImpl->cpu - taskManagerImpl->gpu, next(...));
@@ -156,7 +156,7 @@
 
 __code taskSend1(struct TaskManagerImpl* taskManager, struct Context* task, __code next(...)) {
     int workerId = taskManager->sendGPUWorkerIndex;
-    if(++taskManager->sendGPUWorkerIndex >= taskManager->cpu) {
+    if (++taskManager->sendGPUWorkerIndex >= taskManager->cpu) {
         taskManager->sendGPUWorkerIndex = taskManager->gpu;
     }
     pthread_mutex_unlock(&taskManager->mutex);
@@ -166,7 +166,7 @@
 
 __code taskSend2(struct TaskManagerImpl* taskManager, struct Context* task, __code next(...)) {
     int workerId = taskManager->sendCPUWorkerIndex;
-    if(++taskManager->sendCPUWorkerIndex >= taskManager->maxCPU) {
+    if (++taskManager->sendCPUWorkerIndex >= taskManager->maxCPU) {
         taskManager->sendCPUWorkerIndex = taskManager->cpu;
     }
     pthread_mutex_unlock(&taskManager->mutex);
--- a/src/parallel_execution/examples/bitonicSort/sort.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/examples/bitonicSort/sort.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -36,7 +36,7 @@
 __code print(struct SortArray* sortArray){//配列表示
     if (sortArray->sortArray->loop_counter == MAX){//ループの終了→ソートへ
         printf("\n");
-        if(sortArray->sortArray->sort_finish == 1){//ソート終わってたら終了
+        if (sortArray->sortArray->sort_finish == 1){//ソート終わってたら終了
             goto meta(context, C_exit_code);
         }
         sortArray->sortArray->loop_counter = 0;
--- a/src/parallel_execution/examples/boundedBuffer/SemaphoreImpl.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/examples/boundedBuffer/SemaphoreImpl.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -22,7 +22,7 @@
 }
 
 __code pOperationSemaphoreImpl1(struct SemaphoreImpl* semaphore, __code next(...)) {
-    if(semaphore->value == 0) {
+    if (semaphore->value == 0) {
         context->next= C_pOperationSemaphoreImpl;
         struct Queue* queue = semaphore->waitThreadQueue;
         goto queue->put(context, pOperationSemaphoreImpl2); // put this context(thread, process)
--- a/src/parallel_execution/examples/twice/printArray.cbc	Sun Jan 21 22:30:44 2018 +0900
+++ b/src/parallel_execution/examples/twice/printArray.cbc	Sun Jan 21 23:27:19 2018 +0900
@@ -16,7 +16,7 @@
 __code printArray1(struct Array* array, __code next(...), struct LoopCounter* loopCounter){
     int i = loopCounter->i;
     //printf("%d\n", array->array[i]);
-    if(i < GET_LEN(array->array)) {
+    if (i < GET_LEN(array->array)) {
         if (array->array[i] == i*2) {
             loopCounter->i++;
             goto meta(context, C_printArray1);