changeset 440:55db2a339958

Add worker shutdown
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 06 Nov 2017 19:04:41 +0900
parents eab6f8cd2820
children 5a737c3df91c
files src/parallel_execution/CMakeLists.txt src/parallel_execution/CPUWorker.cbc src/parallel_execution/CUDAWorker.cbc
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt	Mon Nov 06 18:36:38 2017 +0900
+++ b/src/parallel_execution/CMakeLists.txt	Mon Nov 06 19:04:41 2017 +0900
@@ -83,15 +83,15 @@
       TARGET
           CUDAtwice
       SOURCES 
-      examples/twice/main.cbc examples/twice/twice.cbc examples/twice/CUDAtwice.cu examples/twice/createArray.cbc examples/twice/printArray.cbc CPUWorker.cbc TimeImpl.cbc examples/twice/twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc CUDAWorker.cbc cuda.c MultiDimIterator.cbc CudaExecutor.cbc
+          examples/twice/main.cbc examples/twice/twice.cbc examples/twice/CUDAtwice.cu examples/twice/createArray.cbc examples/twice/printArray.cbc CPUWorker.cbc TimeImpl.cbc examples/twice/twice.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc CUDAWorker.cbc cuda.c MultiDimIterator.cbc CUDAExecutor.cbc
     )
     set_target_properties(CUDAtwice PROPERTIES COMPILE_FLAGS "-Wall -g -DUSE_CUDAWorker=1") # -DUSE_CUDA_MAIN_THREAD
 
     GearsCommand(
       TARGET
-        CUDAbitonicSort
+          CUDAbitonicSort
       SOURCES 
-        examples/bitonicSort/bitonicSort.cbc examples/bitonicSort/bitonicSwap.cbc examples/bitonicSort/CUDAbitonicSwap.cu examples/bitonicSort/makeArray.cbc examples/bitonicSort/printArray.cbc CPUWorker.cbc CUDAWorker.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc cuda.c MultiDimIterator.cbc TimeImpl.cbc CudaExecutor.cbc
+          examples/bitonicSort/bitonicSort.cbc examples/bitonicSort/bitonicSwap.cbc examples/bitonicSort/CUDAbitonicSwap.cu examples/bitonicSort/makeArray.cbc examples/bitonicSort/printArray.cbc CPUWorker.cbc CUDAWorker.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc cuda.c MultiDimIterator.cbc TimeImpl.cbc CUDAExecutor.cbc
     )
     set_target_properties(CUDAbitonicSort PROPERTIES COMPILE_FLAGS "-Wall -g -DUSE_CUDAWorker=1")
 endif()
@@ -112,7 +112,7 @@
 
 GearsCommand(
   TARGET
-  multiDimIterator_test
+      multiDimIterator_test
   SOURCES
       test/multiDimIterator_test.cbc test/printIterator.cbc CPUWorker.cbc TaskManagerImpl.cbc SingleLinkedQueue.cbc SynchronizedQueue.cbc MultiDimIterator.cbc TimeImpl.cbc
 )
--- a/src/parallel_execution/CPUWorker.cbc	Mon Nov 06 18:36:38 2017 +0900
+++ b/src/parallel_execution/CPUWorker.cbc	Mon Nov 06 19:04:41 2017 +0900
@@ -139,4 +139,5 @@
 }
 
 __code shutdownWorker(struct CPUWorker* worker) {
+    goto meta(context, C_exit_code);
 }
--- a/src/parallel_execution/CUDAWorker.cbc	Mon Nov 06 18:36:38 2017 +0900
+++ b/src/parallel_execution/CUDAWorker.cbc	Mon Nov 06 19:04:41 2017 +0900
@@ -146,6 +146,7 @@
 
 __code shutdownCUDAWorker(struct Context* context, CUDAWorker* worker) {
     cudaShutdown(worker);
+    goto meta(context, C_exit_code);
 }
 
 __code shutdownCUDAWorker_stub(struct Context* context) {