Mercurial > hg > Members > kono > Cerium
changeset 937:9689cba44964
Sort working on spu cpu == 1 or -a case
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 31 Jul 2010 10:11:41 +0900 |
parents | 14fb1c888931 |
children | 8733ad41297d |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/CellTaskManagerImpl.h TaskManager/Makefile.def |
diffstat | 3 files changed, 30 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sat Jul 31 05:31:12 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sat Jul 31 10:11:41 2010 +0900 @@ -114,11 +114,13 @@ void CellTaskManagerImpl::sendTaskList() { - for (int i = 0; i < machineNum; i++) { - if (! taskListInfo[i]->empty() ) { - mail_check(i); + for (int id = 0; id < machineNum; id++) { + mail_check(id); + if (!speTaskList[id]->empty()) + continue; // まだ、走ってる + if (! taskListInfo[id]->empty() ) { // SPE に送る TaskList の準備 - send_taskList(i); + send_taskList(id); spe_running++; } } @@ -142,9 +144,24 @@ do { poll(); } while (ppeManager->activeTaskQueue->empty() && spe_running >0 ); - } while (!ppeManager->activeTaskQueue->empty() || spe_running >0); + } while (!ppeManager->activeTaskQueue->empty() || + !activeTaskQueue->empty() || + spe_running >0); if (!waitTaskQueue->empty()) { - get_scheduler()->printf("Dead lock detected\n"); + show_dead_lock_info(); + } +} + +void +CellTaskManagerImpl::show_dead_lock_info() +{ + get_scheduler()-> printf("Dead lock detected\n ppe queue %d\n", + ppeManager->activeTaskQueue->length()); + get_scheduler()-> printf(" wait queue %d\n",waitTaskQueue->length()); + get_scheduler()-> printf(" spe queue %d\n",activeTaskQueue->length()); + for (int i = 0; i < machineNum; i++) { + get_scheduler()-> printf(" spe %d send %d wait %d\n",i, + speTaskList[i]->length(), taskListInfo[i]->length()); } } @@ -165,6 +182,7 @@ speTaskList[id]->getLast()->next = speTaskList[id]; speTaskList[id]->freeAll(); spe_running--; +printf("SPE %d status ready\n",id); } else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) { // MY_SPE_COMMAND_MALLOC SPE からのmain memory request send_alloc_reply(this, id, speThreads); @@ -231,7 +249,6 @@ void CellTaskManagerImpl::send_taskList(int id) { - if (taskListInfo[id]->empty()) return; // speTaskList は走り終わった ppe の Task の List. // taskListInfo はこれから走る Task の List. // 交換して実行する @@ -243,7 +260,9 @@ // spe の Task が終了した時点でなおす。 tmp->getLast()->next = 0; TaskListPtr p = tmp->getFirst(); +printf("SPE %d task list sending\n",id); speThreads->send_mail(id, 1, (memaddr *)&p); +printf("SPE %d task list sent\n",id); } void CellTaskManagerImpl::show_profile() {
--- a/TaskManager/Cell/CellTaskManagerImpl.h Sat Jul 31 05:31:12 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.h Sat Jul 31 10:11:41 2010 +0900 @@ -34,6 +34,8 @@ private: void send_taskList(int id); + void show_dead_lock_info(); + }; #endif
--- a/TaskManager/Makefile.def Sat Jul 31 05:31:12 2010 +0900 +++ b/TaskManager/Makefile.def Sat Jul 31 10:11:41 2010 +0900 @@ -29,8 +29,8 @@ ABIBIT = 32 -# OPT = -g -O9 -OPT = -g -DTASK_LIST_MAIL -O9 +OPT = -g -O9 +# OPT = -g -DTASK_LIST_MAIL -O9 CC = g++ CFLAGS = -Wall `sdl-config --cflags` -m$(ABIBIT) $(OPT)