Mercurial > hg > Game > Cerium
changeset 1310:26c155523861 draft
add start_profile
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 15 Dec 2011 16:48:55 +0900 |
parents | 6941385ba022 |
children | ad17daa18d63 |
files | TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/Makefile.parallel TaskManager/kernel/ppe/CpuThreads.cc example/Miller_Rabin/Makefile.def |
diffstat | 5 files changed, 25 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue Dec 13 17:56:30 2011 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Thu Dec 15 16:48:55 2011 +0900 @@ -298,6 +298,21 @@ s->mail_write_from_host(alloc_info[1]); } +void FifoTaskManagerImpl::show_profile() { + for (int id = 0; id < machineNum; id++) { + HTaskPtr t = schedTaskManager->create_task(ShowTime, 0, 0, 0, 0); + t->set_cpu((CPU_TYPE) (id + 2)); + t->spawn(); + } +} + +void FifoTaskManagerImpl::start_profile() { + for (int id = 0; id < machineNum; id++) { + HTaskPtr t = schedTaskManager->create_task(StartProfile, 0, 0, 0, 0); + t->set_cpu((CPU_TYPE) (id + 2)); + t->spawn(); + } +} void FifoTaskManagerImpl::print_arch()
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h Tue Dec 13 17:56:30 2011 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.h Thu Dec 15 16:48:55 2011 +0900 @@ -27,8 +27,8 @@ void poll(); // called from CellTaskManagerImpl void poll1(); // single CPU run called from CellTaskManagerImpl void run(); - void show_profile() {}; - void start_profile() {}; + void show_profile(); + void start_profile(); void polling();
--- a/TaskManager/Makefile.parallel Tue Dec 13 17:56:30 2011 +0900 +++ b/TaskManager/Makefile.parallel Thu Dec 15 16:48:55 2011 +0900 @@ -30,4 +30,4 @@ paralleldistclean: parallelclean rm -f $(TARGET) -parallelclean: \ No newline at end of file +parallelclean:
--- a/TaskManager/kernel/ppe/CpuThreads.cc Tue Dec 13 17:56:30 2011 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.cc Thu Dec 15 16:48:55 2011 +0900 @@ -5,9 +5,10 @@ #include "SysFunc.h" #include "SchedNop.h" #include "SpeTaskManagerImpl.h" +#include "CellScheduler.h" -//SchedExternTask(ShowTime); -//SchedExternTask(StartProfile); +SchedExternTask(ShowTime); +SchedExternTask(StartProfile); CpuThreads::CpuThreads(int num, int useRefDma, int start_id) : cpu_num(num), id_offset(start_id) { @@ -57,8 +58,8 @@ manager->set_scheduler(c_scheduler); - //SchedRegister(ShowTime); - //SchedRegister(StartProfile); + SchedRegister(ShowTime); + SchedRegister(StartProfile); argt->wait->sem_v(); //準備完了したスレッドができるたびに+1していく
--- a/example/Miller_Rabin/Makefile.def Tue Dec 13 17:56:30 2011 +0900 +++ b/example/Miller_Rabin/Makefile.def Thu Dec 15 16:48:55 2011 +0900 @@ -8,8 +8,8 @@ CERIUM = ../../../Cerium CC = g++ -CFLAGS = -O9 -Wall -#CFLAGS = -g -O0 -Wall +#CFLAGS = -O9 -Wall +CFLAGS = -g -O0 -Wall #CFLAGS = -pg -Wall INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..