changeset 79:74e64dea2b49

fix slide
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Wed, 26 Feb 2014 22:08:57 +0900
parents 0bf2c2ae2bf6
children b38e4f75351b
files paper/fig/blockread.graffle slide/index.html
diffstat 2 files changed, 53 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/paper/fig/blockread.graffle	Wed Feb 26 20:58:00 2014 +0900
+++ b/paper/fig/blockread.graffle	Wed Feb 26 22:08:57 2014 +0900
@@ -26,7 +26,7 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2014-02-26 11:17:27 +0000</string>
+	<string>2014-02-26 12:37:11 +0000</string>
 	<key>Modifier</key>
 	<string>masataka kohagura</string>
 	<key>NotesVisible</key>
@@ -39344,8 +39344,8 @@
 					<integer>15</integer>
 					<key>Points</key>
 					<array>
-						<string>{292.9807554294768, 96.558044277146266}</string>
-						<string>{238.73188730179959, 129.8897293955992}</string>
+						<string>{299.13476199233236, 96.543735445649133}</string>
+						<string>{240.56404744769253, 129.90060972846385}</string>
 					</array>
 					<key>Style</key>
 					<dict>
@@ -39425,8 +39425,8 @@
 					<integer>13</integer>
 					<key>Points</key>
 					<array>
-						<string>{180.06149680284955, 96.738562124096788}</string>
-						<string>{197.44889096837204, 129.70763933348272}</string>
+						<string>{186.08965642949588, 96.758182184094579}</string>
+						<string>{199.73979653968107, 129.68644699366126}</string>
 					</array>
 					<key>Style</key>
 					<dict>
@@ -39460,8 +39460,8 @@
 					<integer>12</integer>
 					<key>Points</key>
 					<array>
-						<string>{123.46512194080368, 96.560698006030975}</string>
-						<string>{176.95379290708831, 129.88708453810307}</string>
+						<string>{119.06854569924865, 96.549883779268256}</string>
+						<string>{175.73059899626145, 129.89455577180576}</string>
 					</array>
 					<key>Style</key>
 					<dict>
@@ -39514,7 +39514,7 @@
 				</dict>
 				<dict>
 					<key>Bounds</key>
-					<string>{{285.06002299166397, 71.851854207411748}, {56.47795071315111, 24.444438926962349}}</string>
+					<string>{{285.06002299166397, 71.851854207411748}, {71.939971923828125, 24.444438926962349}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>ID</key>
@@ -39549,7 +39549,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 I/O CPU}</string>
+\f0\fs24 \cf0 I/O Thread}</string>
 					</dict>
 				</dict>
 				<dict>
@@ -39582,7 +39582,7 @@
 				</dict>
 				<dict>
 					<key>Bounds</key>
-					<string>{{145.14346380267656, 71.851859124931906}, {56.47795071315111, 24.444438926962349}}</string>
+					<string>{{152.5925898977105, 71.851857120776828}, {56.47795071315111, 24.444438926962349}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>ID</key>
@@ -39610,7 +39610,7 @@
 				</dict>
 				<dict>
 					<key>Bounds</key>
-					<string>{{75.185180446902166, 71.851853395522255}, {56.47795071315111, 24.444438926962349}}</string>
+					<string>{{69.629633216700995, 71.851855399677333}, {56.47795071315111, 24.444438926962349}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>ID</key>
@@ -39633,7 +39633,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 Cell}</string>
+\f0\fs24 \cf0 CPU}</string>
 					</dict>
 				</dict>
 				<dict>
@@ -39684,7 +39684,7 @@
 				</dict>
 				<dict>
 					<key>Bounds</key>
-					<string>{{64.666665489290935, 46.888888025480028}, {285.92592546805753, 57.777778625488281}}</string>
+					<string>{{64.666665489290949, 46.888888025480028}, {298.25924682617188, 57.777778625488281}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>ID</key>
--- a/slide/index.html	Wed Feb 26 20:58:00 2014 +0900
+++ b/slide/index.html	Wed Feb 26 22:08:57 2014 +0900
@@ -27,28 +27,22 @@
 </article>
 
 <article>
-    <h3>研究概要</h3>
+    <h3>I/Oを含むアプリケーションの並列化</h3>
     <p>
-    当研究室ではCellおよびLinux、 Mac OS X上で動く並列プログラミングフレームワーク、 Ceriumの開発・改良を行っている
+    Cerium : CellおよびLinux、 Mac OS X上で動く並列プログラミングフレームワーク
     </p>
     <img src='images/resources.png' style="height:170px" align="middle">
-    <p>
-    本研究では
     <ul>
-    <li><font color=red>ファイル読み込みと文字列検索の分離</font> </li>
+    <li><font color=red>ファイル読み込みとアプリケーションの分離</font> </li>
     <li><font color=red>I/O専用の Threadを追加</font></li>
     </ul>
-    </p>
-
-    <p>
-    以上2点を実装して<br>
-    I/O を含む Task の動作改善を行った
-    </p>
+    mmap 実装と比較して1.5倍の速度を得た
+    
 </article>
 
 
 <article>
-    <h3>Cerium Task Manager</h3>
+    <h3>Cerium Task Manager の構造</h3>
     <table  border="0" cellpadding="0" cellspacing="0">
         <tbody>
             <tr>
@@ -65,12 +59,12 @@
         </tbody>
     </table>
     <p>
-    I/O 専用の Thread を用意することにより、読み込みに専念させることができる
+    ファイルを読みながら、Word Count や grep などを並列実行したい
     </p>
 </article>
 
 <article>
-    <h3>I/O を含む Task の説明</h3>
+    <h3>Block 単位の読み込みと並列計算</h3>
     <br>
     <img src='images/includeIOTask.png' style="height:270px" align="middle">
     <ol>
@@ -82,6 +76,7 @@
 
 <article>
     <h3>mmap の特徴</h3>
+    従来では mmap を使って読み込んでいた
     <table  border="0" cellpadding="0" cellspacing="0">
         <tbody>
             <tr>
@@ -90,10 +85,12 @@
                     <ul>
                         <font size = 5>
                             <li>
-                            mmap は、C 及び C++ で使用でき、ファイルを読み込む API である。
+                            mmap は、ファイルを直接メモリ空間に map する。<br>
+                            アクセスされたメモリ部分を OS が自動的に読み込む。<br>
+                            読み込みがおわるまでアクセスは任される。<br>
                             </li>
                             <li>
-                            code がシンプル <br>(メモリを自分自身で malloc せず、read を書いて読み込まなくていいため)
+                            code がシンプルだが、読み込み終わるまで待たされる。 <br>
                             </li>
                         </font>
                     </ul>
@@ -103,27 +100,17 @@
     </table>
 </article>
 
-<article>
-    <h3>mmapでの実装の問題点</h3>
-    <ul>
-        <li> mmap でファイルを読み込むと、ファイルはメモリ上に即座に展開されるわけではない。 </li>
-        <li>
-        ファイルがメモリに展開されるタイミングは、そのファイルに対して文字列検索を行うときである。<br><br>
-        ->つまり、文字列検索が行われるときに初めてファイルが読み込まれるので、<font color=red>ファイル読み込みと文字列検索が分離できない。</font>
-        </li>
-    </ul>
-</article>
-
 
 <article>
-    <h3>Blocked Read の設計</h3>
+    <h3>読み込みながら計算を行う</h3>
     <br>
     <img src='images/divide_read.png' style="height:250px" align="middle" >
     <br>
 
     <ul>
-        <li> メモリへの呼び出しを自分で書ける(制御できる) </li>
-        <li> Read は 連続で動作する。 </li>
+        <li> Read は 連続で動作しファイルを読み込む </li>
+        <li> Read の待ちは CPU を消費しない </li>
+        <li> 読み込み終わったブロックに対して、<br>並列 Task を起動する </li>
     </ul>
 </article>
 
@@ -135,12 +122,15 @@
 
     <ul>
         <li>
-        Task を 1 つずつではなく、ブロック単位で生成して起動する<br>
-        (1つずつ生成すると、生成された Task でメモリを圧迫するため)
+        Task を一度に生成するとメモリを圧迫する。<br>
+        Block 単位で徐々に起動していく。
         </li>
         <li>
         Blocked Read Task が読み込み終わるまで、<br>Task Blockを待たせる
         </li>
+        <li>
+        待ち合わせには Cerium の wait for を使用する。
+        </li>
     </ul>
 </article>
 
@@ -165,11 +155,13 @@
 
 
 <article>
-    <h3>I/O 専用の thread を追加</h3>
+    <h3>I/O 専用 thread での Blocked Read の実装</h3>
     <br>
     <img src='images/IO_0blockread.png' style="height:350px">
     <ul>
+        <li>priority が最優先されるので、他の Task に割り込まれなくなる<br>
         <li>Blocked Read Task が最優先されるので、他の Task に割り込まれなくなる<br>
+        <li>pthread_setparam で実装<br>
         </li>
     </ul>
 </article>
@@ -228,7 +220,7 @@
         </tr>
         <tr>
             <td bgcolor="#ffffcc">Blocked Read(IO_0)</td>
-            <td bgcolor="#ffffcc">(I/0) 1 + (Task) 11</td>
+            <td bgcolor="#ffffcc">(I/O) 1 + (Task) 11</td>
             <td bgcolor="#ffffcc">99.2</td>
         </tr>
     </tbody>
@@ -237,12 +229,12 @@
     <ul>
         <li> Blocked Read & IO_0 が mmap より<font color=red>1.55倍</font>実行速度が向上した。<br> </li>
         <li> mmap では 1つ1つの Task がファイルの読み込みを行ってしまうため、読み込み回数が多くなり実行速度が遅くなったと考えられる。 </li>
+        <li> mmap で並列の Task で走らせると、ランダムアクセスとなってしまうため速度が遅くなってしまう。</li>
     </ul>
 </article>
 
 <article>
     <h3>まとめ</h3>
-    <br>
     <ul>
         <li> I/O と Task を分離し、同時に動くように改良した。 </li>
         <li> I/O 専用の Thread の追加 </li>
@@ -257,6 +249,9 @@
         <li>
         様々な実装の試み<br>(I/O threads を 2つ、分割 mmap・・・)
         </li>
+        <li>
+        grepの実装
+        </li>
     </ul>
 </article>
 
@@ -329,10 +324,10 @@
 </article>
 
 <article class='smaller'>
-<h3>Block Read の実装(1/2)</h3>
-<br>
-<h3 class="yellow">Block Read の実装</h3>
-<pre>
+    <h3>Block Read の実装(1/2)</h3>
+    <br>
+    <h3 class="yellow">Block Read の実装</h3>
+    <pre>
 HTaskPtr t_read = manager->create_task(READ_TASK);
 t_read->set_cpu(read_spe_cpu);
 // 読み出すファイルの格納場所を設定
@@ -353,14 +348,14 @@
 
 t_read->spawn();
 
-</pre>
+    </pre>
 </article>
 
 <article>
-<h3>Block Read の実装(2/2)</h3>
-<br>
-<h3 class="yellow"> Block Read の記述</h3>
-<pre>
+    <h3>Block Read の実装(2/2)</h3>
+    <br>
+    <h3 class="yellow"> Block Read の記述</h3>
+    <pre>
     static int
 read_task(SchedTask *s, void *rbuf, void *wbuf)
 {
@@ -373,7 +368,7 @@
     pread(fd, read_text, read_size , start_read_position);
     return 0;
 }
-</pre>
+    </pre>
 </article>