Mercurial > hg > GearsTemplate
changeset 374:fb50cf8aa615
Add Iterator Interface
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Jul 2017 15:14:08 +0900 |
parents | 03fdea4ef680 |
children | ad44fdb11433 |
files | src/parallel_execution/CMakeLists.txt src/parallel_execution/CPUWorker.cbc src/parallel_execution/Iterator.cbc src/parallel_execution/OneDimIterator.cbc src/parallel_execution/Queue.cbc src/parallel_execution/TaskManager.cbc src/parallel_execution/TaskManagerImpl.cbc src/parallel_execution/context.h src/parallel_execution/examples/bitonicSort.cbc src/parallel_execution/examples/calc.cbc src/parallel_execution/examples/swap.cbc src/parallel_execution/examples/twice.cbc |
diffstat | 12 files changed, 192 insertions(+), 196 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/CMakeLists.txt Tue Jul 18 15:14:08 2017 +0900 @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 2.8) set(USE_CUDA,0) - # -DUSE_CUDA # add_definitions("-Wall -g -O") @@ -13,7 +12,7 @@ if (${USE_CUDA}) include_directories("/usr/local/cuda/include") set(NVCCFLAG "-std=c++11" "-g" "-O0" ) - set(CUDA_LINK_FLAGS "-framework CUDA -lc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a -Wl,-rpath,/usr/local/cuda/lib") + set(CUDA_LINK_FLAGS "-framework CUDA -lc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a -Wl,-rpath,/usr/local/cuda/lib") find_package(CUDA REQUIRED) SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CUDA_LINK_FLAGS}" ) endif() @@ -24,31 +23,31 @@ set( _ONE_VALUE_ARGS TARGET ) set( _MULTI_VALUE_ARGS SOURCES ) cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} ) - + set (_Gears_CSOURCES) foreach(i ${_Gears_SOURCES}) if (${i} MATCHES "\\.cbc") string(REGEX REPLACE "(.*).cbc" "c/\\1.c" j ${i}) add_custom_command ( - OUTPUT ${j} - DEPENDS ${i} + OUTPUT ${j} + DEPENDS ${i} COMMAND "perl" "generate_stub.pl" "-o" ${j} ${i} ) elseif (${i} MATCHES "\\.cu") string(REGEX REPLACE "(.*).cu" "c/\\1.ptx" j ${i}) add_custom_command ( - OUTPUT ${j} - DEPENDS ${i} + OUTPUT ${j} + DEPENDS ${i} COMMAND nvcc ${NVCCFLAG} -c -ptx -o ${j} ${i} ) else() set(j ${i}) endif() list(APPEND _Gears_CSOURCES ${j}) - endforeach(i) + endforeach(i) add_custom_command ( - OUTPUT c/${_Gears_TARGET}-context.c + OUTPUT c/${_Gears_TARGET}-context.c DEPENDS ${_Gears_CSOURCES} COMMAND "perl" "generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CSOURCES} ) @@ -59,15 +58,22 @@ GearsCommand( TARGET twice - SOURCES - examples/twice.cbc CPUWorker.cbc twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc SemaphoreImpl.cbc TimeImpl.cbc + SOURCES + examples/twice.cbc CPUWorker.cbc twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc TimeImpl.cbc ) GearsCommand( TARGET calc - SOURCES - examples/calc.cbc examples/Add.cbc examples/Mult.cbc examples/InitIntegerDataGears.cbc CPUWorker.cbc time.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc SemaphoreImpl.cbc + SOURCES + examples/calc.cbc examples/add.cbc examples/mult.cbc examples/InitIntegerDataGears.cbc CPUWorker.cbc time.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc +) + +GearsCommand( + TARGET + bitonic_sort + SOURCES + examples/bitonicSort.cbc examples/swap.cbc examples/InitIntegerDataGears.cbc CPUWorker.cbc time.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc OneDimIterator.cbc ) if (${USE_CUDA})
--- a/src/parallel_execution/CPUWorker.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/CPUWorker.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -37,7 +37,11 @@ return; // end thread task->worker = worker; enum Code taskCg = task->next; - task->next = C_odgCommit; // set CG after task exec + if (task->iterate) { + task->next = C_iterateCommit; + } else { + task->next = C_odgCommit; // set CG after task exec + } goto meta(task, taskCg); } @@ -47,9 +51,26 @@ goto getTask(context, worker, task); } +__code iterateCommit(struct Iterator* iterator) { + iterator->iterator = (union Data*)context->iterator; + iterator->task = context; + iterator->next = C_odgCommit; + iterator->whenWait = C_iterateCommit1; + goto meta(context, context->iterator->barrier); +} + +__code iterateCommit1() { + goto meta(context, C_taskReceiveWorker); +} + +__code iterateCommit_stub(struct Context* context) { + struct Context* workerContext = context->worker->worker->CPUWorker.context; + goto iterateCommit(workerContext) +} + __code odgCommit(struct LoopCounter* loopCounter, struct Context* task) { int i = loopCounter->i ; - if(task->odg + i < task->maxOdg) { + if (task->odg+i < task->maxOdg) { goto meta(task, C_odgCommit1); } loopCounter->i = 0; @@ -88,26 +109,20 @@ } __code odgCommit3(struct TaskManager* taskManager, struct Context* task) { - int idgCount = task->idgCount; - if(__sync_bool_compare_and_swap(&task->idgCount, idgCount, idgCount-1)) { // atomic decrement idg counter - if(idgCount-1 == 0) { - taskManager->taskManager = (union Data*)task->taskManager; - taskManager->context = task; - taskManager->next = C_odgCommit1; - goto meta(context, task->taskManager->spawn); - } else { - goto meta(context, C_odgCommit1); - } - } else { - goto meta(context, C_odgCommit3); + if (__sync_fetch_and_sub(&task->idgCount, 1) == 1) { // atomic decrement idg counter(__sync_fetch_and_sub function return initial value of task->idgCount point) + taskManager->taskManager = (union Data*)task->taskManager; + taskManager->context = task; + taskManager->next = C_odgCommit1; + goto meta(context, task->taskManager->spawn); } + goto meta(context, C_odgCommit1); } __code odgCommit3_stub(struct Context* context) { struct Context* task = &Gearef(context, Queue)->data->Context; goto odgCommit3(context, - Gearef(context, TaskManager), - task); + Gearef(context, TaskManager), + task); } __code odgCommit4(struct LoopCounter* loopCounter) { @@ -117,7 +132,7 @@ __code odgCommit4_stub(struct Context* context) { goto odgCommit4(context, - Gearef(context, LoopCounter)); + Gearef(context, LoopCounter)); } __code shutdownWorker(struct CPUWorker* worker) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parallel_execution/Iterator.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -0,0 +1,8 @@ +typedef struct Iterator<Impl>{ + union Data* iterator; + __code exec(Impl* iterator, __code next(...)); + __code barrier(Impl* iterator, __code next(...)); + __code whenWait(...); + __code next(...); +} Iterator; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parallel_execution/OneDimIterator.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -0,0 +1,37 @@ +#include "../context.h" +#include <stdio.h> + +Iterator createOneDimIterator(struct Context* context, int x) { + struct Iterator* iterator = new Iterator(); + struct OneDimIterator* oneDimIterator = new OneDimIterator(); + iterator->iterator = (union Data*)oneDimIterator; + iterator->exec = C_execOneDimIterator; + iterator->barrier = C_barrierOneDimItearator; + oneDimIterator->x = x; + oneDimIterator->count = x; + iterator->loopCounter = new LoopCounter(); + iterator->loopCounter->i = 0; + oneDimIterator->exec = C_execOneDimIterator; +} + +__code execOneDimIterator(struct OneDimIterator* oneDimIterator, struct TaskManager* taskManager, struct context* task, __code next(...)) { + if (oneDimIterator->loopCounter->i == oneDimIterator->x) { + oneDimIterator->loopCounter->i = 0; + goto next(...); + } + struct context* iterate_task = NEW(struct Context); + *iterate_task = *task; + task->iterate = 1; + oneDimIterator->loopCounter->i++; + taskManager->taskManager = (union Data*)task->taskManager; + taskManager->task = iterate_task; + taskManager->next = C_execOneDimIterator; + goto meta(context, C_execOneDimIterator); +} + +__code barrierOneDimIterator(struct OneDimIterator* oneDimIterator, struct context* task, __code next(...), __code whenWait(...)) { + if (__sync_fetch_and_sub(&oneDimIterator->count, 1) == 1) { + goto next(...); + } + goto whenWait(...); +}
--- a/src/parallel_execution/Queue.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/Queue.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -8,4 +8,3 @@ __code isEmpty(Impl* queue, __code next(...), __code whenEmpty(...)); __code next(...); } Queue; -
--- a/src/parallel_execution/TaskManager.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/TaskManager.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -1,10 +1,10 @@ typedef struct TaskManager<Impl>{ union Data* taskManager; - __code createTask(struct TaskManager* taskManager); __code spawn(Impl* taskManager, struct Queue* queue, struct Context* task, __code next(...)); - __code spawnTasks(struct TaskManager* taskManager, Impl* taskManagerImpl, struct Context* contexts); + __code spawnTasks(struct TaskManager* taskManager, Impl* taskManagerImpl, struct Context** contexts); __code shutdown(struct LoopCounter* loopCounter, struct TaskManager* taskManager, Impl* taskManagerImpl, struct Queue* queue, __code next(...)); __code next(...); + __code next1(...); __code task(...); struct Context* context; int worker;
--- a/src/parallel_execution/TaskManagerImpl.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/TaskManagerImpl.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -27,23 +27,6 @@ return taskManager; } -struct Context* cloneTask(struct Context* task) { - struct Context* task1 = NEW(struct Context); - task1->next = task->next; - - for(int i = task->idg; i < task->maxOdg; i++) { - task1->data[i] = task->data[i]; - } - - task1->dim = 0; - task1->idgCount = 0; - task1->idg = task->idg; - task1->maxIdg = task->maxIdg; - task1->odg = task->odg; - task1->maxOdg = task->maxOdg; - return task1; -} - void createWorkers(struct Context* context, TaskManager* taskManager, TaskManagerImpl* taskManagerImpl) { int i = 0; taskManagerImpl->workers = (Worker**)ALLOC_ARRAY(context, Worker, taskManager->maxCPU); @@ -75,6 +58,7 @@ if(i < GET_SIZE(tasks)) { struct Context* task = tasks[i]; taskManagerImpl->loopCounter->i++; + task->taskManager = &taskManager->taskManager->TaskManager; taskManager->context = task; taskManager->next = C_spawnTasksTaskManager; goto meta(context, C_setWaitTask); @@ -135,50 +119,18 @@ Gearef(context, TaskManager)->next); } -__code dimensionTaskSpawn(struct TaskManagerImpl* taskManager, struct Queue* queue, struct LoopCounter* loopCounter, struct Context* task, __code next(...)) { - int i = loopCounter->i; - int dimCount = task->x * task->y * task->z; - // TODO: implement 3-dimension - if(i < dimCount) { - loopCounter->i++; - struct Context* dimTask = cloneTask(task); - task->workerId = taskManager->sendWorkerIndex; - struct Queue* tasks = taskManager->workers[task->workerId]->tasks; - queue->queue = (union Data*)tasks; - queue->data = (union Data*)dimTask; - queue->next = C_dimensionTaskSpawn; - pthread_mutex_unlock(&taskManager->mutex); - goto meta(context, tasks->put); - } - goto next(...); -} - -__code dimensionTaskSpawn_stub(struct Context* context) { - TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager); - struct Context* task = Gearef(context, TaskManager)->context; - goto dimensionTaskSpawn(context, - taskManager, - Gearef(context, Queue), - Gearef(task, LoopCounter), - task, - Gearef(context, TaskManager)->next); -} - -__code spawnTaskManager(struct TaskManagerImpl* taskManager, struct Context* task, __code next(...)) { +__code spawnTaskManager(struct TaskManagerImpl* taskManager, struct Iterator* iterator, struct Context* task, __code next(...)) { if (task->idgCount == 0) { - if(context->dim) { - goto meta(context, C_dimensionTaskSpawn); - } - // set workerId - task->workerId = taskManager->sendWorkerIndex; - if(++taskManager->sendWorkerIndex >= taskManager->numWorker) { - taskManager->sendWorkerIndex = 0; + if(task->iterator != NULL && task->iterate == 0) { + iterator->iterator = (union Data*)task->iterator; + iterator->task = task; + iterator->next = next; + goto meta(context, task->iterator->exec); } goto meta(context, C_taskSend); - } else { - pthread_mutex_unlock(&taskManager->mutex); - goto next(...); } + pthread_mutex_unlock(&taskManager->mutex); + goto next(...); } __code spawnTaskManager_stub(struct Context* context) { @@ -186,11 +138,17 @@ pthread_mutex_lock(&taskManager->mutex); goto spawnTaskManager(context, taskManager, + Gearef(context, Iterator), Gearef(context, TaskManager)->context, Gearef(context, TaskManager)->next); } __code taskSend(struct TaskManagerImpl* taskManager, struct Queue* queue, struct Context* task, __code next(...)) { + // set workerId + task->workerId = taskManager->sendWorkerIndex; + if(++taskManager->sendWorkerIndex >= taskManager->numWorker) { + taskManager->sendWorkerIndex = 0; + } struct Queue* tasks = taskManager->workers[task->workerId]->tasks; queue->queue = (union Data*)tasks; queue->data = (union Data*)task;
--- a/src/parallel_execution/context.h Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/context.h Tue Jul 18 15:14:08 2017 +0900 @@ -96,11 +96,8 @@ union Data **data; /* multi dimension parameter */ - struct Context* contexts; - int dim; - int x; - int y; - int z; + int iterate; + struct Iterator* iterator; }; union Data { @@ -308,7 +305,18 @@ enum Code kernel; enum Code kernel2; enum Code swap; - }SortArray; + } SortArray; + struct Iterator { + struct Iterator *iterator; + enum Code exec; + enum Code barrier; + enum Code whenWait; + enum Code next; + } Iterator; + struct OneDimIterator { + int x; + int count; + } OneDimIterator; }; // union Data end this is necessary for context generator typedef union Data Data;
--- a/src/parallel_execution/examples/bitonicSort.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/examples/bitonicSort.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -31,7 +31,7 @@ while(! cuda_initialized) {}; #endif #endif - goto meta(context, C_createTask1); + goto meta(context, C_code1); } __code initDataGears_stub(struct Context* context) { @@ -64,114 +64,79 @@ /* print_tree(context->data[Tree]->tree.root); */ /* puts("result"); */ - //time->next = C_code2; - goto meta(context, C_exit_code); - //goto meta(context, C_start_time); -} - -__code code1_stub(struct Context* context) { - goto code1(context, Gearef(context, Time)); + time->time = (union Data*)createTimeImpl(context); + time->next = C_createTask1; + goto meta(context, time->time->Time.start); } - -__code createTask1(struct LoopCounter* loopCounter, struct TaskManager* taskManager) { - int waitFlag = 0; - struct SortArray* inputSortArray = &ALLOCATE_DATA_GEAR(context, sortArray)->sortArray; - inputSortArray->array = array; - for (int i=2; i <= length; i=2*i) { - int first = 1; - lastOne = (length <= i*2) ? true : false; - for (int j=i>>1; 0 < j; j=j>>1) { - struct SortArray* outputSortArray = &ALLOCATE_DATA_GEAR(context, sortArray)->sortArray; - outputSortArray->array = array; - for(int k=0; 0 < length/2; k++) { - struct Context* task = NEW(struct Context); - struct Integer* integer1 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - struct Integer* integer2 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - struct Integer* integer3 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - integer1->value = j; - integer2->value = first; - integer3->value = k; +//__code createTask1(struct LoopCounter* loopCounter, struct TaskManager* taskManager) { +// int waitFlag = 0; +// struct SortArray* inputSortArray = &ALLOCATE_DATA_GEAR(context, sortArray)->sortArray; +// inputSortArray->array = array; +// for (int i=2; i <= length; i=2*i) { +// int first = 1; +// lastOne = (length <= i*2) ? true : false; +// for (int j=i>>1; 0 < j; j=j>>1) { +// struct SortArray* outputSortArray = &ALLOCATE_DATA_GEAR(context, sortArray)->sortArray; +// outputSortArray->array = array; +// for(int k=0; 0 < length/2; k++) { +// struct Context* task = NEW(struct Context); +// struct Integer* integer1 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; +// struct Integer* integer2 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; +// struct Integer* integer3 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; +// integer1->value = j; +// integer2->value = first; +// integer3->value = k; +// +// task->next = C_swap; +// if (waitFlag) { +// task->idgCount = length/2; +// } else { +// task->idgCount = 0; +// } +// task->idg = task->dataNum; +// task->data[task->idg] = (union Data*)inputSortArray; +// task->data[task->idg+1] = (union Data*)integer1; +// task->data[task->idg+2] = (union Data*)integer2; +// task->data[task->idg+3] = (union Data*)integer3; +// task->maxIdg = task->idg + 4; +// task->odg = task->maxIdg; +// task->data[task->odg] = outputSortArray; +// task->maxOdg = task->odg + 1; +// first = 0; +// } +// inputSortArray = outputSortArray; +// } +// waitFlag = 1; +// } +// goto meta(context, taskManager->taskManager->TaskManager.shutdown); +//} - task->next = C_swap; - if (waitFlag) { - task->idgCount = length/2; - } else { - task->idgCount = 0; - } - task->idg = task->dataNum; - task->data[task->idg+1] = (union Data*)inputSortArray; - task->data[task->idg+2] = (union Data*)integer1; - task->data[task->idg+3] = (union Data*)integer2; - task->data[task->idg+4] = (union Data*)integer3; - task->maxIdg = task->idg + 4; - task->odg = task->maxIdg; - task->data[task->odg] = outputSortArray; - task->maxOdg = task->odg + 1; - first = 0; - } - inputSortArray = outputSortArray; - } - waitFlag = 1; +__code createTask1(struct LoopCounter* loopCounter, struct TaskManager* taskManager, struct Time* time) { + int i = loopCounter->i; + + if (i < length) { + loopCounter->i++; + goto meta(context, C_createTask2); } + + loopCounter->i = 0; + taskManager->next = C_code2; goto meta(context, taskManager->taskManager->TaskManager.shutdown); } __code createTask2(struct LoopCounter* loopCounter, struct TaskManager* taskManager) { - struct Context** tasks = (struct Context**)ALLOC_ARRAY(context, Context, 3); - - Integer* integer1 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - Integer* integer2 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - Integer* integer3 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - // par goto mult(integer1, integer2, integer3, __exit); + struct Context** tasks = (struct Context**)ALLOC_ARRAY(context, Context, 1); struct Context* task = NEW(struct Context); - initContext(task); - task->taskManager = &taskManager->taskManager->TaskManager; - task->next = C_mult; - task->idgCount = 2; - task->idg = task->dataNum; - task->data[task->idg] = (union Data*)integer1; - task->data[task->idg+1] = (union Data*)integer2; - task->maxIdg = task->idg + 2; - task->odg = task->maxIdg; - task->data[task->odg] = (union Data*)integer3; - task->maxOdg = task->odg + 1; - tasks[0] = task; - - Integer* integer4 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - Integer* integer5 = &ALLOCATE_DATA_GEAR(context, Integer)->Integer; - // par goto add(integer4, integer5, integer1, __exit); - task = NEW(struct Context); - initContext(task); - task->taskManager = &taskManager->taskManager->TaskManager; - task->next = C_add; - task->idgCount = 2; - task->idg = task->dataNum; - task->data[task->idg] = (union Data*)integer4; - task->data[task->idg+1] = (union Data*)integer5; - task->maxIdg = task->idg + 2; - task->odg = task->maxIdg; - task->data[task->odg] = (union Data*)integer1; - task->maxOdg = task->odg + 1; - tasks[1] = task; - - // par goto initIntegerDataGears(integer2, integer4, integer5, __exit); - task = NEW(struct Context); - initContext(task); - task->taskManager = &taskManager->taskManager->TaskManager; - task->next = C_initIntegerDataGears; + task->iterator = createOneDimIterator(context, 10); + task->next = C_printIterator; task->idgCount = 0; task->idg = task->dataNum; task->maxIdg = task->idg; task->odg = task->maxIdg; - task->data[task->odg] = (union Data*)integer2; - task->data[task->odg+1] = (union Data*)integer4; - task->data[task->odg+2] = (union Data*)integer5; - task->maxOdg = task->odg + 3; - tasks[2] = task; - + task->maxOdg = task->odg; + tasks[0] = task; taskManager->contexts = tasks; - // goto crateTask1(); taskManager->next1 = C_createTask1; goto meta(context, taskManager->taskManager->TaskManager.spawnTasks); }
--- a/src/parallel_execution/examples/calc.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/examples/calc.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -113,7 +113,6 @@ // par goto mult(integer1, integer2, integer3, __exit); struct Context* task = NEW(struct Context); initContext(task); - task->taskManager = &taskManager->taskManager->TaskManager; task->next = C_mult; task->idgCount = 2; task->idg = task->dataNum; @@ -130,7 +129,6 @@ // par goto add(integer4, integer5, integer1, __exit); task = NEW(struct Context); initContext(task); - task->taskManager = &taskManager->taskManager->TaskManager; task->next = C_add; task->idgCount = 2; task->idg = task->dataNum;
--- a/src/parallel_execution/examples/swap.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/examples/swap.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -26,3 +26,8 @@ context->next, O_output); } + +__code printIterator(__code next(...)) { + printf("test\n"); + goto meta(context, next); +}
--- a/src/parallel_execution/examples/twice.cbc Tue Jul 11 18:18:14 2017 +0900 +++ b/src/parallel_execution/examples/twice.cbc Tue Jul 18 15:14:08 2017 +0900 @@ -84,9 +84,6 @@ time->time = (union Data*)createTimeImpl(context); time->next = C_createTask1; goto meta(context, time->time->Time.start); - //goto meta(context, C_createTask1); - //goto meta(context, C_exit_code); - //goto meta(context, C_start_time); } __code code2(struct LoopCounter* loopCounter) {