annotate slide/index.html @ 77:5903492cd498

fix slide
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Wed, 26 Feb 2014 20:15:41 +0900
parents e13727d01f7a
children 0bf2c2ae2bf6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <!DOCTYPE html>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <html>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <head>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 <title>Presentation</title>
15
9b071b32e3de add some files and write slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
6
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <meta charset='utf-8'>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 <script
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 src='./slides.js'></script>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 </head>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 <style>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 /* Your individual styles here, or just use inline styles if that’s
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 what you want. */
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 </style>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <body style='display: none'>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <section class='slides layout-regular template-default'>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 <!--
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 Your slides (<article>s) go here. Delete or comment out the
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 slides below.
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 -->
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 <article >
14
0e7c972b5ca1 write slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
26 <h1>Cerium による並列処理向け I/O の設計と実装</h1>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
27 <h3 class="title">Masataka Kohagura 27th, February</h3>
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 <div align="right">担当教官 : 河野 真治</div>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 </article>
19
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
30
32
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 31
diff changeset
31 <article>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
32 <h3>研究概要</h3>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
33 <p>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
34 当研究室ではCellおよびLinux、 Mac OS X上で動く並列プログラミングフレームワーク、 Ceriumの開発・改良を行っている
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
35 </p>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
36 <img src='images/resources.png' style="height:200px" align="middle">
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 <p>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
38 本研究では
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
39 <font color=red>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
40 <ul>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
41 <li>ファイル読み込みと文字列検索の分離
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
42 </li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
43 <li>I/O専用の Threadを追加
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
44 </li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
45 </ul>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
46 </font>
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 </p>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 <p>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
49 I/0 を含む Task の動作改善を行った
21
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
50 </p>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
51
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
52
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 </article>
14
0e7c972b5ca1 write slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
54
27
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
55
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 <article>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
57 <h3>Cerium Task Manager</h3>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
58 <table border="0" cellpadding="0" cellspacing="0">
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
59 <tbody>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
60 <tr>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
61 <td><img src='images/ceriumtaskmanager.png' style="height:280px"></td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
62 <td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
63 <ol>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
64 <li>Taskを生成</li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
65 <li>依存関係のチェック</li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
66 <li>Schedulerに転送</li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
67 <li>並列実行</li>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
68 </ol>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
69 </td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
70 </tr>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
71 </tbody>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
72 </table>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
73 <p>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
74 I/O 専用の Thread を用意することにより、読み込みに専念させることができる
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
75 </p>
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 </article>
15
9b071b32e3de add some files and write slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
77
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 <article>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
79 <h3>I/O を含む Task の説明</h3>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
80 <br>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
81 <img src='images/includeIOTask.png' style="height:270px" align="middle">
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
82 <ol>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
83 <li>テキストファイルの読み込み後、ファイルをある一定の大きさに分割する</li>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
84 <li>分割したテキストファイルに対して、それぞれ計算を行う</li>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
85 <li>計算した結果を集計する</li>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
86 </ol>
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
87 </article>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
88
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
89 <article>
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
90 <h3>mmap の特徴</h3>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
91 <table border="0" cellpadding="0" cellspacing="0">
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
92 <tbody>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
93 <tr>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
94 <td><img src='images/mmap.png' style="height:350px" align="middle"></td>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
95 <td>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
96 <ul>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
97 <font size = 5>
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
98 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
99 mmap は、C 及び C++ で使用でき、ファイルを読み込む API である。
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
100 </li>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
101 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
102 code がシンプル <br>(メモリを自分自身で malloc せず、read を書いて読み込まなくていいため)
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
103 </li>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
104 </font>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
105 </ul>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
106 </td>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
107 </tr>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
108 </tbody>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
109 </table>
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
110
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
111 <ul>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
112 </ul>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
113 </article>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
114
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
115 <article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
116 <h3>mmapでの実装の問題点</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
117 <ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
118 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
119 mmap でファイルを読み込むと、ファイルはメモリ上に即座に展開されるわけではない。
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
120 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
121 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
122 ファイルがメモリに展開されるタイミングは、そのファイルに対して文字列検索を行うときである。<br><br>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
123 <font color=red>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
124 →つまり、文字列検索が行われるときに初めてファイルが読み込まれるので、ファイル読み込みと文字列検索が分離できない。
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
125 </font>
33
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
126 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
127 </ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
128 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
129
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 32
diff changeset
130
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
131 <article>
27
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
132 <h3>Blocked Read の設計</h3>
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
133 <br>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
134 <img src='images/divide_read.png' style="height:250px" align="middle" >
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
135 <br>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
136
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
137 <ul>
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
138 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
139 メモリへの呼び出しを自分で書ける(制御できる)
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
140 </li>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
141 <li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
142 Read は 連続で動作する。
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
143 </li>
16
56cd6800acb5 write slide No.11 & add images
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
144 </ul>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
145 以後、文字列検索を行う処理を Task と定義する。
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 </article>
15
9b071b32e3de add some files and write slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
147
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
148 <article>
27
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
149 <h3>Blocked Read の実装</h3>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
150 <br>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
151 <img src='images/blockread.png' style="height:250px"align="middle">
19
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
152 <br>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
153
25
3385af0bca0f write block read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
154 <ul>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
155 <li>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
156 Task を 1 つずつではなく、ブロック単位で生成して起動する<br>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
157 (1つずつ生成すると、生成された Task でメモリを圧迫するため)
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
158 </li>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
159 <li>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
160 Blocked Read Task が読み込み終わるまで、Task Blockを待たせる<br>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
161 </li>
25
3385af0bca0f write block read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
162 </ul>
23
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
163 </article>
a452d8f104bd divede read rename to Block Read
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
164
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
165 <!--
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
166 <article class = 'smaller'>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
167 <h3>I/O 専用の therad を追加 (1/2)</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
168 <br>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
169 <img src='images/SPE_ANYblockread.png' style="height:350px"align="middle">
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
170 <ul>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
171 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
172 Task 単位で使用するデバイスをセットすることができる。
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
173 </li>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
174 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
175 SPE_ANY でセットすると、Cerium Task Manager 側で自動的に CPU を割り振る。
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
176 </li>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
177 <li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
178 自動的に割り振るので、Blocked Read に 他のTask が割り込むおそれがある。
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
179 </li>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
180 </ul>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
181 </article>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
182 -->
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
183
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
184
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
185 <article>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
186 <h3>I/O 専用の therad を追加</h3>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
187 <br>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
188 <img src='images/IO_0blockread.png' style="height:350px">
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
189 <ul>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
190 <li>Blocked Read Task が最優先されるので、他の Task に割り込まれなくなる<br>
31
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
191 </li>
7d0f128836ab finish??
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 30
diff changeset
192 </ul>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
193 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
194
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
195 <article>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
196 <h3>I/O 専用の therad を使用しない場合</h3>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
197 <br>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
198 <img src='images/SPE_ANYblockread.png' style="height:350px">
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
199 <ul>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
200 <li>Blocked Read は連続で行われなければならない。<br>しかし、Task が割り振られてしまう可能性がある。
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
201 </li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
202 </ul>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
203 </article>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
204
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
205 <article>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
206 <h3>実験環境</h3>
19
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
207 <br>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
208 <ul>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
209 <li> Mac OS X 10.9.1</li>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
210 <li> 2*2.66 GHz 6-Core Intel Xeon</li>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
211 <li> Memory 16GB 1333MHz DDR3</li>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
212 <li> HHD 1TB</li>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
213 <li> file size : 約 10 GB</li>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
214 <li> ファイルに対して Boyer-Moore String Seaech で文字列検索をかける </li>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
215 <li> ファイルの読み込みから結果までを測定</li>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
216 </ul>
19
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
217 </article>
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
218
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
219 <article>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
220 <h3>実験結果</h3>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
221 <table border="2" cellpadding="0" cellspacing="0">
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
222 <tbody>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
223 <tr>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
224 <td>read mode</td>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
225 <td>CPU num</td>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
226 <td>ave time(s)</td>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
227 </tr>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
228 <tr>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
229 <td>mmap</td>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
230 <td>2</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
231 <td>106.2</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
232 </tr>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
233 <tr>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
234 <td bgcolor="#ffffcc">mmap</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
235 <td bgcolor="#ffffcc">12</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
236 <td bgcolor="#ffffcc">154.6</td>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
237 </tr>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
238 <tr>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
239 <td>一括Read</td>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
240 <td>12</td>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
241 <td>114.9</td>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
242 </tr>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
243 <tr>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
244 <td>Blocked Read(SPE_ANY)</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
245 <td>12</td>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
246 <td>106.0</td>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
247 </tr>
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
248 <tr>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
249 <td bgcolor="#ffffcc">Blocked Read(IO_0)</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
250 <td bgcolor="#ffffcc">(I/0) 1 + (Task) 11</td>
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
251 <td bgcolor="#ffffcc">99.2</td>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
252 </tr>
26
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
253 </tbody>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
254 </table>
54591c145fec add experiment result
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
255
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
256 <ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
257 <li>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
258 Blocked Read & IO_0 が mmap より<font color=red>1.55倍</font>実行速度が向上した。<br>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
259 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
260 <li>
76
e13727d01f7a fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 74
diff changeset
261 mmap では 1つ1つの Task がファイルの読み込みを行ってしまうため、読み込み回数が多くなり実行速度が遅くなったと考えられる。
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
262 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
263 </ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
264 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
265
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
266 <article>
74
ec6ddf37a60b fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
267 <h3>まとめ</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
268 <br>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
269 <ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
270 <li>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
271 I/O と Task を分離し、同時に動くように改良した。
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
272 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
273 <li>
77
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
274 I/O 専用の Thread の追加
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
275 <li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
276 I/O を含む Task をで並列実装するときに mmap では不向きであり、
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
277 Blocked Read で読み込みを制御したほうが効果的。
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
278 </li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
279 </ul>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
280 <h3 class="yellow">今後の課題</h3>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
281 <ul>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
282 <li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
283 Cerium の API として実装
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
284 </li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
285 <li>
5903492cd498 fix slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 76
diff changeset
286 様々な実装の試み<br>(I/O threads を 2つ、分割 mmap・・・)
34
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
287 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
288 </ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
289 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
290
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
291 <article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
292 <h3>Cerium Task の生成の例(1)</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
293 <p>(例題) multiply : 2つの数を掛け算するプログラム</p>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
294 <h3 class="yellow">main.cc の記述</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
295 <pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
296 float* A, B, C;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
297 // Task の宣言
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
298 HTaskPtr multiply = manager->create_task(MULTIPLY_TASK);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
299 // Task を実行する デバイスの設定
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
300 multiply->set_cpu(SPE_ANY);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
301 // Task に入力データのアドレスを追加
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
302 multiply->set_inData(0, (memaddr)A, sizeof(float)*length);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
303 multiply->set_inData(1, (memaddr)B, sizeof(float)*length);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
304 // Task に出力データのアドレスを追加
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
305 multiply->set_outData(0, (memaddr)C, sizeof(float)*length);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
306 // Task へ値を1つだけ渡す
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
307 multiply->set_param(0,length);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
308 // Task を TaskList に set する
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
309 multiply->spawn(); </pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
310 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
311
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
312 <article>
34
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
313 <h3> Cerium Task の生成(2)</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
314 <br>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
315 <h3 class="yellow">Task の記述</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
316 <pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
317 static int
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
318 multiply(SchedTask *s,void *rbuf, void *wbuf)
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
319 {
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
320 float *A,*B,*C
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
321 // 登録した inData を取得
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
322 A = (float*)s->get_input(rbuf,0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
323 B = (float*)s->get_input(rbuf,1);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
324 // 登録した outData を取得
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
325 C = (float*)s->get_output(wbuf,0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
326 // 登録した param を取得
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
327 long length=(long)s->get_param(0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
328 for (int i=0;i &lt; length;i++) {
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
329 C[i] = A[i] * B[i];
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
330 }
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
331 return 0;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
332 } </pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
333 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
334
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
335 <article>
34
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
336 <h3>mmap での I/O の実装</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
337 <br>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
338 <h3 class="yellow">mmap の記述</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
339 <pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
340 mmap(SchedTask *s, void *in, void *out)
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
341 {
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
342 // FileReadPtr : File情報などを格納している構造体
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
343 FileReadPtr fr = (FileReadPtr)in;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
344 int map = MAP_PRIVATE;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
345
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
346 fr->read_text =
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
347 (char*)mmap(NULL,fr->filesize,PROT_READ,map,fr->fd,(off_t)0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
348 }
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
349 </pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
350 <ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
351 <li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
352 PROT_READ : 読み込み可
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
353 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
354 <li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
355 MAP_PRIVATE : 読み込んだ領域に対して書き込みが起こると複製し、複製した領域に対して書き込みを行う
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
356 </li>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
357 </ul>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
358 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
359
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
360 <article class='smaller'>
34
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
361 <h3>Block Read の実装(1/2)</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
362 <br>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
363 <h3 class="yellow">Block Read の実装</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
364 <pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
365 HTaskPtr t_read = manager->create_task(READ_TASK);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
366 t_read->set_cpu(read_spe_cpu);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
367 // 読み出すファイルの格納場所を設定
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
368 t_read->set_outData(0,
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
369 w->file_mmap + w->task_spawned * w->division_size,
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
370 w->task_blocks * w->division_size);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
371 // ファイルディスクリプタの受け渡し
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
372 t_read->set_param(0,w->fd);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
373 // ファイル読み込みの始点
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
374 t_read->set_param(1,w->task_spawned*w->division_size);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
375
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
376 // run_tasks(manager,w, w->task_blocks, t_read, t_next, w->division_size + w->extra_len);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
377 // ここで、ファイルに対して何らかの計算を掛けるような Task を設定する
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
378 run_tasks(manager,w, w->task_blocks,・・・ );
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
379
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
380 // ファイル読み込みの終点
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
381 t_read->set_param(2,w->task_spawned*w->division_size + w->extra_len);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
382
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
383 t_read->spawn();
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
384
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
385 </pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
386 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
387
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
388 <article>
34
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 33
diff changeset
389 <h3>Block Read の実装(2/2)</h3>
28
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
390 <br>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
391 <h3 class="yellow"> Block Read の記述</h3>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
392 <pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
393 static int
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
394 read_task(SchedTask *s, void *rbuf, void *wbuf)
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
395 {
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
396 long fd = (long)s->get_param(0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
397 long start_read_position = (long)s->get_param(1);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
398 long end_read_position = (long)s->get_param(2);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
399 char *read_text = (char*)s->get_output(wbuf,0);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
400 long read_size = end_read_position - start_read_position;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
401
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
402 pread(fd, read_text, read_size , start_read_position);
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
403 return 0;
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
404 }
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
405 </pre>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
406 </article>
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
407
19
36958c5e0b90 add slide pages 8-17
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
408
13
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 </body>
ff5c2b4ca18a add slide
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 </html>