Mercurial > hg > Members > kokubo > 2013-mid-thesis
annotate paper/cerium.tex @ 1:f4b3de446113
write introduction and cerium
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 Nov 2013 23:59:45 +0900 |
parents | 9e88a388ec83 |
children | b7c8a956c10b |
rev | line source |
---|---|
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1 \section{Cerium における Task の生成}\label{section:cerium} |
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2 Cerium では,user が createtask を行い、input data や依存関係の設定し spawn を行うと TaskManager で Task が生成される。 |
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
3 spawn の代わりに新たに用意した iterate を利用することで,Data 並列処理を行う Task として登録される。 |
0 | 4 Task 毎に依存関係を表す wait\_i と wait\_me というリストがあり、依存関係が解消されて実行可能になった |
5 Task は ActiveTaskList に移される。さらに、Scheduler に転送しやすい TaskList に変換してから各 Scheduler に | |
6 転送される。 | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
7 |
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
8 以下に Data 並列処理を行う Task を生成する例題を示す。 |
0 | 9 input data を二つ用意し、 input 同士を乗算し、 output に格納する multiply という例題となる。 |
10 \begin{Verbatim}[fontsize=\footnotesize,xleftmargin=1cm] | |
11 void | |
12 multiply_init | |
13 (HTaskPtr twice, int *i_data, int *o_data) { | |
14 multiply = | |
15 manager->create_task(MULTIPLY_TASK); | |
16 // MULTIPLY_TASK is task id(enum) | |
17 multiply->set_inData(0, i_data1, | |
18 sizeof(int)*length); | |
19 multiply->set_inData(1, i_data2, | |
20 sizeof(int)*length); | |
21 multiply->set_outData(0, o_data, | |
22 sizeof(int)*length); | |
23 multiply->set_cpu(SPE_ANY); | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
24 multiply->iterate(length); |
0 | 25 } |
26 \end{Verbatim} | |
27 | |
28 \begin{tiny} | |
29 \begin{table}[ht] | |
30 \begin{center} | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
31 \caption{Task 生成における API} |
0 | 32 \label{table:create_taskAPI} |
33 \scalebox{0.5}[0.9] | |
34 \small | |
35 \begin{tabular}[t]{c|l} | |
36 \hline | |
37 create\_task& Task を生成する \\ | |
38 \hline | |
39 set\_inData & Task への入力データのアドレスを追加 \\ | |
40 \hline | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
41 set\_outData & Task からの出力データのアドレスを追加 \\ |
0 | 42 \hline |
43 set\_cpu & Task を実行するデバイスの設定 \\ | |
44 \hline | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
45 iterate&Data 並列処理を行う Task として ActiveTaskList に登録 \\ |
0 | 46 \hline |
47 \end{tabular} | |
48 \end{center} | |
49 \end{table} | |
50 \end{tiny} | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
51 |
0 | 52 \begin{tiny} |
53 \begin{table}[ht] | |
54 \begin{center} | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
55 \caption{Task 側で使用する API} |
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
56 \label{table:created_taskAPI} |
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
57 \scalebox{0.5}[0.9] |
0 | 58 \small |
59 \begin{tabular}[t]{c|l} | |
60 \hline | |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
61 get\_input&Scheduler から set\_inData したアドレスを取得\\ |
0 | 62 \hline |
1
f4b3de446113
write introduction and cerium
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
63 get\_output&Scheduler から set\_outData したアドレスを取得\\ |
0 | 64 \hline |
65 \end{tabular} | |
66 \end{center} | |
67 \end{table} | |
68 \end{tiny} |