Mercurial > hg > Game > Cerium
annotate TaskManager/Cell/CellTaskManagerImpl.cc @ 1479:163220e54cc0 draft
remove hard code for TaskLog
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Jul 2012 17:15:15 +0900 |
parents | 5ca4e9469c65 |
children | f2512fb94223 |
rev | line source |
---|---|
321 | 1 #define DEBUG |
2 #include "error.h" | |
57 | 3 #include <stdio.h> |
4 #include <stdlib.h> | |
5 #include <string.h> | |
6 #include "CellTaskManagerImpl.h" | |
956
197b7e19a345
unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
940
diff
changeset
|
7 #include "HTask.h" |
197b7e19a345
unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
940
diff
changeset
|
8 #include "QueueInfo.h" |
1428
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
9 #include "ExportTaskLog.h" |
621 | 10 #include "SchedTask.h" |
635
c56f6847fb87
SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
631
diff
changeset
|
11 #include "MainScheduler.h" |
57 | 12 #include "types.h" |
672 | 13 #include "SysFunc.h" |
14 | |
1179 | 15 static void send_alloc_reply(CellTaskManagerImpl *tm, int id, |
1185
26dea600d4cd
fix CellTaskManagerImpl
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1179
diff
changeset
|
16 Threads *speThreads); |
57 | 17 |
1179 | 18 CellTaskManagerImpl::~CellTaskManagerImpl() { |
1077 | 19 |
1179 | 20 delete speThreads; |
21 delete[] speTaskList; | |
1077 | 22 |
1179 | 23 delete ppeManager; |
67 | 24 } |
25 | |
1479
163220e54cc0
remove hard code for TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1477
diff
changeset
|
26 void CellTaskManagerImpl::init(int spuIdle_,int useRefDma,int export_task_log) { |
1179 | 27 spe_running = 0; |
28 spuIdle = spuIdle_; | |
109 | 29 |
1179 | 30 // 実行される Task 用の パイプライン用のダブルバッファ |
31 speTaskList = new QueueInfo<TaskList>*[machineNum]; // spe上の走っている Task の配列 | |
32 taskListInfo = new QueueInfo<TaskList>*[machineNum]; // 次に走る Task の配列 | |
476
5fc79ff9c257
CellBufferManager removed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
380
diff
changeset
|
33 |
1077 | 34 |
1179 | 35 for (int i = 0; i < machineNum; i++) { |
36 taskListInfo[i] = new QueueInfo<TaskList> (taskListPool); | |
37 speTaskList[i] = new QueueInfo<TaskList> (taskListPool); | |
38 } | |
109 | 39 |
1179 | 40 // PPE 側の管理をする Manager |
41 ppeManager = new FifoTaskManagerImpl(machineNum); | |
42 // 大半のTaskQueueInfoは、共有される | |
43 MainScheduler *mscheduler = new MainScheduler; | |
44 set_scheduler(mscheduler); | |
1229
424c1f16e704
add args useRefDma
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1185
diff
changeset
|
45 ppeManager->init(mscheduler, this, useRefDma); // ここで HTaskInfo が共有される。 |
1077 | 46 |
1362
6b4a0846afcb
Spe Threads Init moved
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1229
diff
changeset
|
47 speThreads->init(); |
6b4a0846afcb
Spe Threads Init moved
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1229
diff
changeset
|
48 |
1179 | 49 // 実行可能な HTask のリスト。 FifoTaskManager と共有される |
50 activeTaskQueue = ppeManager->activeTaskQueue; | |
51 // HTask の factory。 HTaskInfo ならなんでもいい。 | |
52 htaskImpl = activeTaskQueue; // any HTaskInfo | |
53 | |
1077 | 54 |
1179 | 55 ppeManager->get_scheduler()->set_manager(this); |
637 | 56 |
1179 | 57 // Task 内からManager->task_create() とかするときに必要なTaskManager。 |
58 // 現状では ppe 側からしか動かない | |
59 // spe 側から Task create できない | |
60 schedTaskManager = new SchedTask(); | |
1464
3f2230d79eba
TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1462
diff
changeset
|
61 schedTaskManager->init(0, 0, ppeManager->get_scheduler(), 0); |
1179 | 62 ppeManager->schedTaskManager = schedTaskManager; |
1479
163220e54cc0
remove hard code for TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1477
diff
changeset
|
63 |
163220e54cc0
remove hard code for TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1477
diff
changeset
|
64 _export_task_log = export_task_log; |
57 | 65 } |
66 | |
1179 | 67 void CellTaskManagerImpl::append_activeTask(HTaskPtr task) { |
68 if (task->cpu_type == CPU_PPE) { | |
69 ppeManager->append_activeTask(task); | |
70 } else { | |
71 activeTaskQueue->addLast(task); | |
72 } | |
109 | 73 } |
74 | |
321 | 75 // SPE_ANY が指定されていた時に |
76 // これをインクリメントしつつ呼ぶことにする。 | |
940
e01b551f25d6
unknown dead lock still...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
939
diff
changeset
|
77 unsigned int cur_anySpeid = 0; |
109 | 78 |
79 /** | |
321 | 80 * ActiveTaskQueue から Task を |
938
20beb83a5a22
dead lock still remains. zombi problem?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
937
diff
changeset
|
81 * 各 SPE に渡す (backgound) TaskList に入れる |
109 | 82 * |
321 | 83 * ここの activeTaskQueue は FifoTaskManagerImpl のと意味が違い、 |
84 * spe に渡される Task だけ入っている | |
109 | 85 */ |
1179 | 86 void CellTaskManagerImpl::set_runTaskList(QueueInfo<HTask> *activeTaskQueue) { |
87 int speid; | |
88 HTaskPtr htask = activeTaskQueue->getFirst(); | |
89 while (htask != NULL) { | |
70 | 90 |
1179 | 91 if (htask->cpu_type == CPU_PPE) { |
92 | |
93 htask = activeTaskQueue->getNext(htask); | |
70 | 94 |
1179 | 95 } else { |
96 if (htask->cpu_type == SPE_ANY) { | |
97 speid = cur_anySpeid++; | |
98 } else { | |
99 // -1 してるのは | |
100 // htask->cpu_type - CPU_SPE で | |
101 // SPE0 = 1, SPE1 = 2, ... SPE5 = 6 ってなってるので | |
102 // 配列的 (SPE0 = arr[0], SPE1 = arr[1]) にするため | |
103 speid = htask->cpu_type - CPU_SPE - 1; | |
104 } | |
105 | |
106 speid %= machineNum; | |
107 set_taskList(htask, taskListInfo[speid]); | |
108 | |
109 HTaskPtr next = activeTaskQueue->getNext(htask); | |
110 activeTaskQueue->remove(htask); | |
111 htask = next; | |
112 | |
113 } | |
70 | 114 } |
109 | 115 } |
116 | |
1179 | 117 void CellTaskManagerImpl::sendTaskList() { |
118 for (int id = 0; id < machineNum; id++) { | |
119 mail_check(id); | |
120 if (!speTaskList[id]->empty()) { | |
121 continue; // まだ、走ってる | |
122 } | |
123 if (!taskListInfo[id]->empty()) { | |
124 // SPE に送る TaskList の準備 | |
125 send_taskList(id); | |
126 spe_running++; | |
127 } | |
1057
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
128 } |
721 | 129 } |
130 | |
1179 | 131 void CellTaskManagerImpl::poll() { |
132 set_runTaskList(activeTaskQueue); | |
133 // TaskList 待ちの SPE に TaskList を送る | |
134 sendTaskList(); | |
808 | 135 } |
136 | |
1179 | 137 void CellTaskManagerImpl::debug_check_spe_idle( |
138 QueueInfo<HTask> * activeTaskQueue, int spe_running_) { | |
139 printf("spu_idle! spe_running = %d : activeTaskQueue->length = %d \n", | |
140 spe_running_, activeTaskQueue->length()); | |
1116
8e818d8fa36b
It's changed so that CreateSpan may move in the SPE.
tkaito@henri
parents:
1082
diff
changeset
|
141 HTaskPtr task = activeTaskQueue->getFirst(); |
8e818d8fa36b
It's changed so that CreateSpan may move in the SPE.
tkaito@henri
parents:
1082
diff
changeset
|
142 int tmp_i = 0; |
1057
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
143 do { |
1179 | 144 printf("task_name = %s ,", ppeManager->get_task_name(task)); |
1116
8e818d8fa36b
It's changed so that CreateSpan may move in the SPE.
tkaito@henri
parents:
1082
diff
changeset
|
145 printf("cpu = [%d], count = %d", task->cpu_type, tmp_i); |
8e818d8fa36b
It's changed so that CreateSpan may move in the SPE.
tkaito@henri
parents:
1082
diff
changeset
|
146 tmp_i++; |
1057
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
147 } while ((task = activeTaskQueue->getNext(task)) != 0); |
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
148 printf("\n"); |
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
149 } |
8cd123d2f3ca
debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents:
972
diff
changeset
|
150 |
1179 | 151 void CellTaskManagerImpl::run() { |
1437
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
152 int spu_limit = spuIdle; |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
153 if (machineNum == 0) { |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
154 ppeManager->run(); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
155 return; |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
156 } |
1125 | 157 |
1437
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
158 do { |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
159 // PPE side |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
160 ppeManager->poll(); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
161 // SPE side |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
162 do { |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
163 poll(); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
164 } while (ppeManager->activeTaskQueue->empty() && spe_running > 0); |
1179 | 165 |
1437
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
166 if (spe_running < spu_limit) { |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
167 debug_check_spe_idle(ppeManager->activeTaskQueue, spe_running); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
168 } |
1179 | 169 |
1437
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
170 } while (!ppeManager->activeTaskQueue->empty() || !activeTaskQueue->empty() || spe_running > 0); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
171 if (!waitTaskQueue->empty()) { |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
172 show_dead_lock_info(); |
fa6723e7d329
fix GpuTaskManagerImpl
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1429
diff
changeset
|
173 } |
1179 | 174 |
937
ecafd19a1d83
Sort working on spu cpu == 1 or -a case
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
936
diff
changeset
|
175 } |
ecafd19a1d83
Sort working on spu cpu == 1 or -a case
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
936
diff
changeset
|
176 |
1179 | 177 static void loop_check(HTask *p, HTask *me, int depth) { |
178 if (p == me) | |
179 printf("*%lx ", (long) p); // loop | |
180 if (depth == 0) | |
181 return; | |
182 QueueInfo<TaskQueue> *w = p->wait_i; | |
183 if (w) { | |
184 for (TaskQueue *q = w->getFirst(); q; q = w->getNext(q)) { | |
185 loop_check(q->task, me, depth - 1); | |
186 } | |
939 | 187 } |
188 } | |
189 | |
1179 | 190 void CellTaskManagerImpl::show_dead_lock_info() { |
191 get_scheduler()-> printf("Dead lock detected\n ppe queue %d\n", | |
192 ppeManager->activeTaskQueue->length()); | |
193 // 確か waitQueue は共通... | |
194 // get_scheduler()-> printf(" wait queue %d\n",ppeManager->waitTaskQueue->length()); | |
195 get_scheduler()-> printf(" wait queue %d\n", waitTaskQueue->length()); | |
196 for (HTask *p = waitTaskQueue->getFirst(); p; p = waitTaskQueue->getNext(p)) { | |
197 printf(" Waiting task%d %lx", p->command, (long) p); | |
198 QueueInfo<TaskQueue> *w = p->wait_i; | |
199 if (w) { | |
200 for (TaskQueue *q = w->getFirst(); q; q = w->getNext(q)) { | |
201 printf(" waiting task%d %lx", q->task->command, | |
202 (long) q->task); | |
203 if (!waitTaskQueue->find(q->task)) { | |
204 printf("!"); // stray task | |
205 } | |
206 loop_check(q->task, p, 10); | |
207 } | |
940
e01b551f25d6
unknown dead lock still...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
939
diff
changeset
|
208 } |
1179 | 209 printf("\n"); |
939 | 210 } |
1179 | 211 get_scheduler()-> printf(" spe queue %d\n", activeTaskQueue->length()); |
212 for (int i = 0; i < machineNum; i++) { | |
213 get_scheduler()-> printf(" spe %d send %d wait %d\n", i, | |
214 speTaskList[i]->length(), taskListInfo[i]->length()); | |
215 } | |
70 | 216 } |
217 | |
65 | 218 /** |
321 | 219 * SPE からのメールをチェックする |
640
ecf056ddd21a
SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
638
diff
changeset
|
220 */ |
ecf056ddd21a
SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
638
diff
changeset
|
221 |
1179 | 222 void CellTaskManagerImpl::mail_check(int id) { |
223 memaddr data; | |
109 | 224 |
1179 | 225 // SPE Scheduler からの mail check |
226 while (speThreads->has_mail(id, 1, &data)) { | |
227 if (data == (memaddr) MY_SPE_STATUS_READY) { | |
228 // MY_SPE_STATUS_READY: SPE が持ってた Task 全て終了 | |
229 // freeAll する前に循環リストに戻す | |
230 speTaskList[id]->getLast()->next = speTaskList[id]; | |
231 speTaskList[id]->freeAll(); | |
232 spe_running--; | |
233 // printf("SPE %d status ready, %d running\n",id, spe_running); | |
234 } else if (data == (memaddr) MY_SPE_COMMAND_MALLOC) { | |
235 // MY_SPE_COMMAND_MALLOC SPE からのmain memory request | |
236 send_alloc_reply(this, id, speThreads); | |
237 } else if (data > (memaddr) MY_SPE_NOP) { | |
830 | 238 #ifdef TASK_LIST_MAIL |
1179 | 239 TaskListPtr list = (TaskListPtr)data; |
240 check_task_list_finish(schedTaskManager, list, waitTaskQueue); | |
830 | 241 #else |
1179 | 242 // 終了したタスク(PPEにあるのでアドレス) |
243 HTaskPtr task = (HTaskPtr) data; | |
1151 | 244 #if 0 |
1179 | 245 if (task->cpu_type != CPU_SPE) { |
246 const char *name = get_task_name(task); | |
247 if (name != NULL) { | |
248 printf("[SPE] "); | |
249 printf("Task id : %d, ", task->command); | |
250 printf("Task name : %s\n", name); | |
251 } | |
252 } | |
1150 | 253 #endif |
1147 | 254 #ifndef NOT_CHECK |
255 | |
1179 | 256 if (task != NULL) { |
257 //SPE で処理された Task が返ってくるはず。それがもし、type PPE なら・・・ | |
258 if (task->cpu_type == CPU_PPE) { | |
259 printf("attention : PPE task run on SPE\n"); | |
260 printf("Task id : %d\n", task->command); | |
261 const char *name = get_task_name(task); | |
262 if (name != NULL) { | |
263 printf("Task name : %s\n", name); | |
264 } | |
265 } | |
266 } | |
1147 | 267 |
268 #endif | |
1179 | 269 |
270 task->post_func(schedTaskManager, task->post_arg1, task->post_arg2); | |
271 check_task_finish(task, waitTaskQueue); | |
830 | 272 #endif |
1179 | 273 } |
274 // MY_SPE_NOP: 特に意味のないコマンド | |
719
cc1b7333de92
clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
718
diff
changeset
|
275 } |
cc1b7333de92
clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
718
diff
changeset
|
276 } |
109 | 277 |
1179 | 278 void CellTaskManagerImpl::polling() { |
279 // may call recursively check_task_list_finish() | |
280 // we need fifo here | |
281 for (int i = 0; i < machineNum; i++) { | |
282 mail_check(i); | |
283 } | |
833
577bde5d0cec
poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
830
diff
changeset
|
284 } |
577bde5d0cec
poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
830
diff
changeset
|
285 |
1179 | 286 static void send_alloc_reply(CellTaskManagerImpl *tm, int id, |
1185
26dea600d4cd
fix CellTaskManagerImpl
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1179
diff
changeset
|
287 Threads *speThreads) { |
1179 | 288 |
289 /** | |
290 * info[0] = alloc_id; (CellScheduler::mainMem_alloc 参照) | |
291 * info[1] = alloc_addr; | |
292 */ | |
293 memaddr alloc_info[2]; | |
294 long alloc_size; | |
295 long command; | |
275 | 296 |
1179 | 297 speThreads->get_mail(id, 2, alloc_info); |
298 command = (long) alloc_info[0]; | |
299 alloc_size = (long) alloc_info[1]; | |
109 | 300 |
1179 | 301 alloc_info[1] = (memaddr) tm->allocate(alloc_size); |
302 //__debug_ppe("[PPE] MALLOCED 0x%lx from [SPE %d]\n", alloc_info[1],id); | |
303 // 今のところ何もしてない。どうも、この allocate を free | |
304 // するのは、SPE task が返した値を見て行うらしい。それは、 | |
305 // 忘れやすいのではないか? | |
306 speThreads->add_output_tasklist(command, alloc_info[1], alloc_size); | |
109 | 307 |
1179 | 308 speThreads->send_mail(id, 2, alloc_info); |
109 | 309 } |
66 | 310 |
109 | 311 /** |
321 | 312 * 条件を満たしたら SPE に TaskList を送信する |
313 * 条件1. SPE が持ってた TaskList を終了して、次の TaskList を待ってる | |
314 * 条件2. SPE に送る TaskList に Task がある | |
109 | 315 * |
808 | 316 * SPE で実行終了した speTaskList と |
317 * これから実行する taskListInfo のバッファを入れ替える | |
109 | 318 */ |
1179 | 319 void CellTaskManagerImpl::send_taskList(int id) { |
320 // speTaskList は走り終わった ppe の Task の List. | |
321 // taskListInfo はこれから走る Task の List. | |
322 // 交換して実行する | |
323 QueueInfo<TaskList> *tmp = taskListInfo[id]; | |
324 taskListInfo[id] = speTaskList[id]; | |
325 speTaskList[id] = tmp; | |
109 | 326 |
1179 | 327 // speTaskList は本来は循環リストなのだけど、実行中は線形リストである。 |
328 // spe の Task が終了した時点でなおす。 | |
329 tmp->getLast()->next = 0; | |
330 TaskListPtr p = tmp->getFirst(); | |
331 // printf("SPE %d task list sending\n",id); | |
332 speThreads->send_mail(id, 1, (memaddr *) &p); | |
333 // printf("SPE %d task list sent\n",id); | |
57 | 334 } |
335 | |
672 | 336 void CellTaskManagerImpl::show_profile() { |
1179 | 337 for (int id = 0; id < machineNum; id++) { |
338 HTaskPtr t = schedTaskManager->create_task(ShowTime, 0, 0, 0, 0); | |
1477
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1468
diff
changeset
|
339 t->set_cpu((CPU_TYPE) (id + SPE_0)); |
1179 | 340 t->spawn(); |
341 } | |
672 | 342 } |
343 | |
344 void CellTaskManagerImpl::start_profile() { | |
1179 | 345 for (int id = 0; id < machineNum; id++) { |
346 HTaskPtr t = schedTaskManager->create_task(StartProfile, 0, 0, 0, 0); | |
1477
5ca4e9469c65
remove GpuTaskManagerImpl
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1468
diff
changeset
|
347 t->set_cpu((CPU_TYPE) (id + SPE_0)); |
1179 | 348 t->spawn(); |
349 } | |
672 | 350 } |
351 | |
1428
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
352 void CellTaskManagerImpl::export_task_log() { |
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
353 ExportTaskLog _export(taskLogQueue); |
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
354 _export.printOut(); |
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
355 } |
af2adce9752e
add to export TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
356 |
1179 | 357 void CellTaskManagerImpl::print_arch() { |
358 printf("CellTaskManager\n"); | |
1067 | 359 } |
360 | |
1427
db5c022d871c
task array uses TaskList. (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
361 TaskListPtr CellTaskManagerImpl::createTaskList() |
db5c022d871c
task array uses TaskList. (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
362 { |
1462
8cf62aea798f
HTask/TaskList fix (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1427
diff
changeset
|
363 TaskListPtr tl = taskListInfo[0]->create(); |
8cf62aea798f
HTask/TaskList fix (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1427
diff
changeset
|
364 bzero(tl->tasks,sizeof(Task)*TASK_MAX_SIZE); |
8cf62aea798f
HTask/TaskList fix (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1427
diff
changeset
|
365 return tl; |
1427
db5c022d871c
task array uses TaskList. (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
366 } |
db5c022d871c
task array uses TaskList. (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
367 |
db5c022d871c
task array uses TaskList. (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1362
diff
changeset
|
368 |
109 | 369 #ifdef __CERIUM_CELL__ |
57 | 370 TaskManagerImpl* |
1229
424c1f16e704
add args useRefDma
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1185
diff
changeset
|
371 create_impl(int num, int useRefDma) |
57 | 372 { |
1185
26dea600d4cd
fix CellTaskManagerImpl
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1179
diff
changeset
|
373 Threads *cpus = new SpeThreads(num); |
1179 | 374 return new CellTaskManagerImpl(num,cpus); |
57 | 375 } |
109 | 376 #endif // __CERIUM_CELL |