annotate TaskManager/Cell/CellTaskManagerImpl.cc @ 1464:3f2230d79eba draft

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