annotate slide/index.html @ 78:0bf2c2ae2bf6

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