Mercurial > hg > Game > Cerium
changeset 1057:8cd123d2f3ca draft
debug_check_spu_idle add. commandline option [-spuidle].
author | tkaito@henri |
---|---|
date | Tue, 14 Dec 2010 23:17:04 +0900 |
parents | 4955cedb17e5 |
children | d3cb29f1eccb |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/CellTaskManagerImpl.h TaskManager/Cell/spe/SpeTaskManagerImpl.cc TaskManager/Cell/spe/SpeTaskManagerImpl.h TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/Makefile.def TaskManager/kernel/main.cc TaskManager/kernel/ppe/TaskManager.cc TaskManager/kernel/ppe/TaskManager.h TaskManager/kernel/ppe/TaskManagerImpl.h |
diffstat | 11 files changed, 38 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Tue Dec 14 23:17:04 2010 +0900 @@ -22,9 +22,10 @@ } void -CellTaskManagerImpl::init() +CellTaskManagerImpl::init(int spuIdle_) { spe_running = 0; + spuIdle = spuIdle_; // 実行可能な HTask のリスト。 FifoTaskManager と共有される activeTaskQueue = new QueueInfo<HTask>(htaskPool); @@ -107,13 +108,14 @@ { for (int id = 0; id < machineNum; id++) { mail_check(id); - if (!speTaskList[id]->empty()) + if (!speTaskList[id]->empty()) { continue; // まだ、走ってる + } if (! taskListInfo[id]->empty() ) { // SPE に送る TaskList の準備 send_taskList(id); spe_running++; - } + } } } @@ -125,9 +127,23 @@ sendTaskList(); } + +void +debug_check_spu_idle(QueueInfo<HTask> * activeTaskQueue) +{ + printf("spu_idle : size=%d \n", activeTaskQueue->length()); + HTask *task = activeTaskQueue->getFirst(); + + do { + printf("taskCommand = %d ",task->command); + } while ((task = activeTaskQueue->getNext(task)) != 0); + printf("\n"); +} + void CellTaskManagerImpl::run() { +int spu_limit = spuIdle; do { // PPE side ppeManager->poll(); @@ -135,6 +151,9 @@ do { poll(); } while (ppeManager->activeTaskQueue->empty() && spe_running >0 ); + if (spe_running < spu_limit) { + debug_check_spu_idle(ppeManager->activeTaskQueue); + } } while (!ppeManager->activeTaskQueue->empty() || !activeTaskQueue->empty() || spe_running >0);
--- a/TaskManager/Cell/CellTaskManagerImpl.h Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.h Tue Dec 14 23:17:04 2010 +0900 @@ -18,10 +18,11 @@ SpeThreads *speThreads; FifoTaskManagerImpl *ppeManager; int spe_running; + int spuIdle; /* functions */ // system - void init(); + void init(int spuIdle); void run(); void poll(); void mail_check(int id);
--- a/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Tue Dec 14 23:17:04 2010 +0900 @@ -5,7 +5,7 @@ SpeTaskManagerImpl::SpeTaskManagerImpl() {} SpeTaskManagerImpl::~SpeTaskManagerImpl() {} -void SpeTaskManagerImpl::init() {} +void SpeTaskManagerImpl::init(int spuIdle_) {} void SpeTaskManagerImpl::run() {} HTaskPtr SpeTaskManagerImpl::create_task(int cmd) {return 0;}
--- a/TaskManager/Cell/spe/SpeTaskManagerImpl.h Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Cell/spe/SpeTaskManagerImpl.h Tue Dec 14 23:17:04 2010 +0900 @@ -15,7 +15,7 @@ /* functions */ // call by system - void init(); + void init(int spuIdle); void run(); void start_profile(); void show_profile();
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue Dec 14 23:17:04 2010 +0900 @@ -30,7 +30,7 @@ * FifoScheduler は PPE 側のスケジューラ */ void -FifoTaskManagerImpl::init() +FifoTaskManagerImpl::init(int spuIdle_) { // TaskManager から呼ばれるので、かなりの部分は初期化されている。
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.h Tue Dec 14 23:17:04 2010 +0900 @@ -21,7 +21,7 @@ /* functions */ // call by system - void init(); + void init(int spuIdle); void init(MainScheduler*, TaskManagerImpl*); void poll(); // called from CellTaskManagerImpl void run();
--- a/TaskManager/Makefile.def Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/Makefile.def Tue Dec 14 23:17:04 2010 +0900 @@ -27,7 +27,7 @@ IMPL_CELL_SRCS = $(IMPL_FIFO_SRCS) $(wildcard $(IMPL_CELL_DIR)/*.cc) IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cc=.o) -ABIBIT = 64 +ABIBIT = 32 OPT = -g -O9 -DMAIL_QUEUE # -DEARLY_TOUCH
--- a/TaskManager/kernel/main.cc Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/kernel/main.cc Tue Dec 14 23:17:04 2010 +0900 @@ -34,17 +34,19 @@ main(int argc, char *argv[]) { int machineNum = 1; - + int spuIdle = 6; for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-cpu") == 0) { machineNum = atoi(argv[++i]); } else if (strcmp(argv[i], "-p") == 0) { profile = 1; - } + } else if (strcmp(argv[i], "-spuidle") == 0) { + spuIdle = 1; + } } TaskManager *manager = new TaskManager(machineNum); - manager->init(); + manager->init(spuIdle); manager->set_TMend(defaultTMend);
--- a/TaskManager/kernel/ppe/TaskManager.cc Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.cc Tue Dec 14 23:17:04 2010 +0900 @@ -32,10 +32,10 @@ extern TaskManagerImpl* create_impl(int); void -TaskManager::init() +TaskManager::init(int spuIdle) { m_impl = create_impl(machineNum); - m_impl->init(); + m_impl->init(spuIdle); m_impl->systask_init(); }
--- a/TaskManager/kernel/ppe/TaskManager.h Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.h Tue Dec 14 23:17:04 2010 +0900 @@ -39,7 +39,7 @@ } /* functions */ - void init(); + void init(int spuIdle); void finish(); private:
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Tue Dec 14 17:36:15 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.h Tue Dec 14 23:17:04 2010 +0900 @@ -37,7 +37,7 @@ /* functions */ // system - virtual void init() = 0; + virtual void init(int) = 0; virtual void run() = 0; virtual void start_profile() = 0; virtual void show_profile() = 0;