Mercurial > hg > Gears > Gears
changeset 884:084639a31aaf
...
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 24 Jan 2021 18:34:37 +0900 |
parents | b69b748e61d9 |
children | 12cf168d6d3f |
files | src/parallel_execution/MCTaskManagerImpl.cbc src/parallel_execution/ModelChecking/MCWorker.cbc src/parallel_execution/generate_stub.pl |
diffstat | 3 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/MCTaskManagerImpl.cbc Sun Jan 24 18:03:25 2021 +0900 +++ b/src/parallel_execution/MCTaskManagerImpl.cbc Sun Jan 24 18:34:37 2021 +0900 @@ -119,6 +119,13 @@ } __code spawnMCTaskManagerImpl(struct MCTaskManagerImpl* taskManagerImpl, struct Context* task, __code next(...), struct TaskManager* taskManager) { + if (task == NULL) { + // get all task for model checking + // start model checker + // we should goto odgCommitMCWorker foreach mctask + Gearef(context, Worker)->worker = (union Data*)taskManagerImpl->workers[0]; + goto startModelChecker(worker); + } task->taskManager = taskManager; if (task->idgCount == 0) { // iterator task is normal task until spawned
--- a/src/parallel_execution/ModelChecking/MCWorker.cbc Sun Jan 24 18:03:25 2021 +0900 +++ b/src/parallel_execution/ModelChecking/MCWorker.cbc Sun Jan 24 18:34:37 2021 +0900 @@ -3,6 +3,7 @@ #interface "Worker.h" #interface "Iterator.h" #interface "Queue.h" +#interface "SingleLinkedQueue.h" static void startWorker(Worker* worker); @@ -34,18 +35,13 @@ } __code startModelChecker(struct MCWorker* worker) { - struct SingleLinkedQueue* mcQueue = (struct SingleLinkedQueue*) worker->mcQueue->queue; - struct Element* taskElement = (struct Element*)mcQueue->top; - struct Context* task = (struct Context*) taskElement->data; - goto meta(task, task->next); + struct Queue* mcQueue = worker->mcQueue; + goto mcQueue->take(meta); } __code getTaskMCWorker(struct MCWorker* mcWorker, struct Context* task, struct Worker* worker) { - if (task == NULL) { - // get all task for model checking - // start model checker - // we should goto odgCommitMCWorker foreach mctask - goto startModelChecker(); + if (!task) { + goto worker->shutdown(); // end thread } task->worker = worker; enum Code taskCg = task->next;
--- a/src/parallel_execution/generate_stub.pl Sun Jan 24 18:03:25 2021 +0900 +++ b/src/parallel_execution/generate_stub.pl Sun Jan 24 18:34:37 2021 +0900 @@ -239,7 +239,7 @@ if ($codeGearName =~ /gmain/ ) { $isGmain = 1; } - } elsif ((/^\s*(union|struct|const|enum)?\s*([\w<>]+)(\*)\s+(\w+)\s+=/) && $currentCodeGear) { # collect local variables + } elsif ((/^\s*(union|struct|const|enum)?\s*([\w<>_*]+)(\*)\s+(\w+)\s+=/) && $currentCodeGear) { # collect local variables #StackGenerics<Integer>* generics_list = createStackGenericsImpl(); debug_print("getDataGear",__LINE__, $_) if $opt_debug;