changeset 1:3488934d6d23

hoge
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Fri, 09 May 2014 11:17:10 +0900
parents 6dca8c7e1cb6
children 105ba499ae40
files s6/.DS_Store s6/blank.css.less s6/blank.html
diffstat 3 files changed, 256 insertions(+), 131 deletions(-) [+]
line wrap: on
line diff
Binary file s6/.DS_Store has changed
--- a/s6/blank.css.less	Tue Apr 08 19:22:11 2014 +0900
+++ b/s6/blank.css.less	Fri May 09 11:17:10 2014 +0900
@@ -6,7 +6,7 @@
 @color:                  black;
 @color-step-hidden:      silver;
 
-@background-color-code:  azure;
+@background-color-code:  #ffffa9;
 
 // -- gradient colors used for slides classified with cover | title
 
@@ -23,9 +23,9 @@
 @font-size-h1:     190%;    // 30pt / 40px    (assuming 100% => 12pt / 16px)
 @font-size-h2:     200%;    // 28pt / 37px
 @font-size-h3:     150%;    // 24pt / 32px
-@font-size-text:   200%;    // 18pt / 24px
-@font-size-code:   140%;    // 16pt / 22px
-
+@font-size-text:   130%;    // 18pt / 24px
+@font-size-code:   150%;    // 16pt / 22px
+@font-small-size:   100%;
 
 /////////////////////////////
 
@@ -51,7 +51,7 @@
        &.hidden     { display: none; }
       }
   
-  h2 { font-size: @font-size-h2; background-color: #808db5; color:white;}
+  h2 { font-size: @font-size-h2; background-color: #808db5; color:white; padding: 5px;}
 
   h3 { font-size: @font-size-h3; }
   name {
@@ -70,16 +70,21 @@
 ul { list-style-type: square; }
 
 
-p, li, dt, dd, td, th { font-size: @font-size-text; }
+p, li, dt, dd, td{ font-size: @font-size-text; }
+th { font-size: @font-small-size;}
 
 
-pre { font-size: @font-size-code; }
+pre {font-size: @font-size-code; }
 
 .code { 
         background-color: @background-color-code;
         padding: 5px;
-      }
-     
+          }
+code {
+        font-size: @font-size-code; 
+        background-color: @background-color-code;
+        padding: 5px;
+     }
 .footnote a:first-of-type  { text-decoration: none; }
 
 p.footnote { font-size: 88%; }
--- a/s6/blank.html	Tue Apr 08 19:22:11 2014 +0900
+++ b/s6/blank.html	Fri May 09 11:17:10 2014 +0900
@@ -1,137 +1,257 @@
 <!DOCTYPE html>
 <html>
-<head>
-  <meta charset='utf-8'>
-  <title>[your_title]</title>
+  <head>
+    <meta charset='utf-8'>
+    <title>Seminar</title>
 
-<!-- 
-   Notes on CSS media types used:
- 
-   1) projection -> slideshow mode (display one slide at-a-time; hide all others)
-   2) screen     -> outline mode (display all slides-at-once on screen) 
-   3) print      -> print (and print preview)
-  
-   Note: toggle between projection/screen (that is, slideshow/outline) mode using t-key
+    <!-- 
+         Notes on CSS media types used:
+         
+         1) projection -> slideshow mode (display one slide at-a-time; hide all others)
+         2) screen     -> outline mode (display all slides-at-once on screen) 
+         3) print      -> print (and print preview)
+         
+         Note: toggle between projection/screen (that is, slideshow/outline) mode using t-key
+
+         Questions, comments?
+         - send them along to the mailinglist/forum online @ http://groups.google.com/group/webslideshow    
+      -->
 
-   Questions, comments?
-   - send them along to the mailinglist/forum online @ http://groups.google.com/group/webslideshow    
--->
+    <!-- style sheet links -->
+    <link rel="stylesheet/less" href="themes/blank/projection.css.less"  media="screen,projection">
+    <link rel="stylesheet/less" href="themes/blank/screen.css.less"      media="screen">
+    <link rel="stylesheet/less" href="themes/blank/print.css.less"       media="print">
+
+    <link rel="stylesheet/less" href="blank.css.less"    media="screen,projection">
+
+    <!-- Notes about less css support
+         - all less stylesheets (*.css.less) need to get listed/loaded first (before the less.js script)
+         - find more info about less.js online @ http://lesscss.org
 
-<!-- style sheet links -->
-<link rel="stylesheet/less" href="themes/blank/projection.css.less"  media="screen,projection">
-<link rel="stylesheet/less" href="themes/blank/screen.css.less"      media="screen">
-<link rel="stylesheet/less" href="themes/blank/print.css.less"       media="print">
+         ***** NOTE:
+         less.js browser script currently won’t work if you’re using Google Chrome
+         and the path to your page starts with "file:///" due to a known Chrome issue.
+         (In the developer/js console you will see:
+         XMLHttpRequest cannot load file:///../s6/shared/projection.css.less.
+         Cross origin requests are only supported for HTTP.)
+      -->
 
-<link rel="stylesheet/less" href="blank.css.less"    media="screen,projection">
-
-<!-- Notes about less css support
-     - all less stylesheets (*.css.less) need to get listed/loaded first (before the less.js script)
-     - find more info about less.js online @ http://lesscss.org
+    <!-- add js libs (less, jquery) -->
+    <script src="js/less-1.1.4.min.js"></script>
+    <script src="js/jquery-1.7.min.js"></script>
 
-    ***** NOTE:
-   less.js browser script currently won’t work if you’re using Google Chrome
-    and the path to your page starts with "file:///" due to a known Chrome issue.
-   (In the developer/js console you will see:
-     XMLHttpRequest cannot load file:///../s6/shared/projection.css.less.
-     Cross origin requests are only supported for HTTP.)
-  -->
-
-<!-- add js libs (less, jquery) -->
-<script src="js/less-1.1.4.min.js"></script>
-<script src="js/jquery-1.7.min.js"></script>
+    <!-- S6 JS -->
+    <script src="js/jquery.slideshow.js"></script>
+    <script src="js/jquery.slideshow.counter.js"></script>
+    <script src="js/jquery.slideshow.controls.js"></script>
+    <script src="js/jquery.slideshow.footer.js"></script>
+    <script src="js/jquery.slideshow.autoplay.js"></script>
+    <script>
+      $(document).ready( function() {
+      Slideshow.init();
+      
+      // Example 2: Start Off in Outline Mode
+      // Slideshow.init( { mode: 'outline' } );
+      
+      // Example 3: Use Custom Transition
+      // Slideshow.transition = transitionScrollUp;
+      // Slideshow.init();
 
-<!-- S6 JS -->
-<script src="js/jquery.slideshow.js"></script>
-<script src="js/jquery.slideshow.counter.js"></script>
-<script src="js/jquery.slideshow.controls.js"></script>
-<script src="js/jquery.slideshow.footer.js"></script>
-<script src="js/jquery.slideshow.autoplay.js"></script>
-<script>
-  $(document).ready( function() {
-    Slideshow.init();
-    
-    // Example 2: Start Off in Outline Mode
-    // Slideshow.init( { mode: 'outline' } );
-    
-    // Example 3: Use Custom Transition
-    // Slideshow.transition = transitionScrollUp;
-    // Slideshow.init();
+      // Example 4: Start Off in Autoplay Mode with Custom Transition
+      // Slideshow.transition = transitionScrollUp;
+      // Slideshow.init( { mode: 'autoplay' } );
+      } );
+    </script>
+
+    <!-- Better Browser Banner for Microsoft Internet Explorer (IE) -->
+    <!--[if IE]>
+        <script src="js/jquery.microsoft.js"></script>
+        <![endif]-->
 
-    // Example 4: Start Off in Autoplay Mode with Custom Transition
-    // Slideshow.transition = transitionScrollUp;
-    // Slideshow.init( { mode: 'autoplay' } );
-  } );
-</script>
+  </head>
+  <body>
 
-<!-- Better Browser Banner for Microsoft Internet Explorer (IE) -->
-<!--[if IE]>
-<script src="js/jquery.microsoft.js"></script>
-<![endif]-->
+    <div class="layout">
+      <div id="header"></div>
+      <div id="footer">
+        <div align="right">
+          <img src="images/concurrency.png" width="200">
+        </div>
+      </div>
+    </div>
+
+    <div class="presentation">
 
-</head>
-<body>
-
-<div class="layout">
-  <div id="header"></div>
-  <div id="footer">
-    <div align="right">
-      <img src="images/concurrency.png" width="200">
-    </div>
-  </div>
-</div>
-
-<div class="presentation">
-
-  <!-- add slides here; example -->
-  
-  <div class='slide cover'>
-<table width="90%" height="90%" border="0" align="center">
-<tr>
-<td><div align="center">
-    <h1><font color="#808db5">CeriumにおけるGPUとMultiCore CPUの同時実行</font></h1>
-</div></td>
-</tr>
-<tr>
-<td><div align="left">
-    <name>Yuhi TOMARI Apr 8,2014</name>
-</div></td>
-</tr>
-</table>
-  </div>
+      <!-- add slides here; example -->
+      
+      <div class='slide cover'>
+        <table width="90%" height="90%" border="0" align="center">
+          <tr>
+            <td><div align="center">
+                <h1><font color="#808db5">CeriumにおけるGPUとMultiCore CPUの同時実行</font></h1>
+            </div></td>
+          </tr>
+          <tr>
+            <td><div align="left">
+                Yuhi TOMARI
+                <script>
+                  var date = new Date();
+                  var year = date.getFullYear();
+                  var month = date.getMonth();
+                  var day = date.getDate();
+                  
+                  var monthList = new Array("January","February","March","April","May","June",
+                  "July","August","September","October","November","December");
+                  
+                  document.write(monthList[month]+" "+day+", "+year);
+                  
+                </script>
+                <hr style="color:#ffcc00;background-color:#ffcc00;text-align:left;border:none;width:300%;height:0.2em;">
+            </div></td>
+          </tr>
+        </table>
+      </div>
+      
+      <div class='slide'>
+        <h2>研究目的</h2>
+        <p>
+          当研究室ではCellおよびLinux、
+          Mac OSX上で動く並列プログラミングフレームワーク、
+          Ceriumの開発・改良を行っている。
+        </p>
+        <p>本研究では新たにGPU上での並列実行に対応し、
+          ヘテロジニアス(異種混合)環境下でのプログラミングをサポートする
+        </p>
+        <p>
+          GPGPUでは通常のマルチコア<font color="red">CPUとは異なる並列プログラミング</font>
+          と<font color="red">特別なチューニング</font>が必要となる。
+          そこでCeriumを用いてその差を吸収し、自動的なチューニングを可能にする。
+        </p>
+        <p>
+          しかし、GPUのみで並列計算を行った場合、Taskによっては並列度が出ない場合がある。
+          そこでチューニングの一環として、MultiCoreとGPU上での同時実行を可能にする。
+        </p>
+      </div>
+      
+      <!-- h1.hidden => use heading just for table of contents (toc) -->
+      <div class='slide'>
+        <h2>進捗</h2>
+        <dl>
+          <dt>s6 Slide整えて遊んでた</dt>
+          <dt>mallocのお勉強</dt>
+          <dd>kernel reading party(小崎さん)</dd>
+          <dd><a href="http://shelby.tv/video/youtube/0-vWT-t0UHg/the-67th-yokohama-kernel-reading-party">動画</a></dd>
+          <dd><a href="http://www.slideshare.net/kosaki55tea/glibc-malloc">資料</a></dd>
+      </div>
+      
+      <div class='slide'>
+        <h2>mallocってなんだっけ……?</h2>
+        <img src="images/malloc.png" width="500">
+        <pre class="code">
+          void *malloc(size_t size);</pre>
+        <ul>
+          <li>mallocはsizeバイト分のメモリを割り当て、ポインタを返す</li>
+          <li>返ってくるのはvoidのポインタなので、戻り値を型でキャストする必要がある</li>
+          <li>中身は初期化されていない</li>
+          <li>確保した領域はfreeを忘れずに</li>
+        </ul>
+        <pre class="code">
+          char *str = (char*)malloc(length); // 使う型でキャストする</pre>
+      </div>
 
-  <div class='slide'>
-    <h2>研究目的</h2>
-    <p>
-      当研究室ではCellおよびLinux、
-      Mac OSX上で動く並列プログラミングフレームワーク、
-      Ceriumの開発・改良を行っている。
-    </p>
-    <p>本研究では新たにGPU上での並列実行に対応し、
-      ヘテロジニアス(異種混合)環境下でのプログラミングをサポートする
-    </p>
-    <p>
-      GPGPUでは通常のマルチコア<font color="red">CPUとは異なる並列プログラミング</font>
-      と<font color="red">特別なチューニング</font>が必要となる。
-      そこでCeriumを用いてその差を吸収し、自動的なチューニングを可能にする。
-    </p>
-    <p>
-      しかし、GPUのみで並列計算を行った場合、Taskによっては並列度が出ない場合がある。
-      そこでチューニングの一環として、MultiCoreとGPU上での同時実行を可能にする。
-    </p>
-  </div>
+      <div class='slide'>
+        <h2>古典的malloc</h2>
+        <img src="images/heap.png" width="700">
+        <ul>
+          <li>使用可能なブロックを繋げたリスト構造、free list (freeされているブロックのlist?)
+          <li>listを使ってメモリを管理
+          <li>管理領域(header)分だけ多くallocateして、先頭に管理領域を付加
+          <li>first fit
+        </ul>
+        <hr>
+        <pre class="code">
+          union header {
+              struct {
+                  union header *ptr;  // 空きリストの上なら次のブロック
+                  unsigned size;      // このブロックの大きさ
+              } s;
+          };</pre>
+      </div>
+
+      <div class='slide'>
+        <h2>First Fit</h2>
+        <p>
+          リストを頭から見ていって、最初に見つけたものを使用するというすごいシンプルな方法。
+        </p>
+        <img src="images/firstfit.png" width="500">
+      </div>
+
+      <div class='slide'>
+        <h2>First Fit</h2>
+        <img src="images/firstfit2.png" width="500">
+        <p>実は、もう一個先にもっと適切なブロックがあった。こんな場合に対応できない…というか、対応しないのがfirst fit。</p>
+        <p>あまりよくない……</p>
+      </div>
+
+      <div class='slide'>
+        <h2>free</h2>
+        <pre class="code">
+          void free(void *ptr);</pre>
+        <p>
+          メモリの開放自体は、使用中のブロックをfree listに追加するだけで良い。
+          引数で受け取ったポインタ部分を開放したら良い……かに思える。
+          でもそれだけじゃダメで、開放したい領域と隣接しているブロックが空きブロックなら併合しないといけない。
+        </p>
+        <img src="images/free_merge.png" width="700">
+      </div>
 
-  <!-- h1.hidden => use heading just for table of contents (toc) -->
-  <div class='slide'>
-    <h2>進捗</h2>
-    <dl>
-      <dt>s6 Slide整えて遊んでた</dt>
-      <dt>mallocのお勉強</dt>
-      <dd>kernel reading party(小崎さん)</dd>
-      <dd><a href="http://shelby.tv/video/youtube/0-vWT-t0UHg/the-67th-yokohama-kernel-reading-party">動画</a></dd>
-      <dd><a href="http://www.slideshare.net/kosaki55tea/glibc-malloc">資料</a></dd>
-    </ul>
-  </div>
+      <div class='slide'>
+        <h2>free</h2>
+        <img src="images/free1.png" width="700">
+        <p>
+          listから最初のポインタと、その次のポインタを取得。prev < p < nextを満たすまで走査していく
+                                                                       </p>
+      </div>
 
-</div> <!-- presentation -->
-</body>
+      <div class='slide'>
+        <h2>free</h2>
+        <img src="images/free2.png" width="700">
+        <p>あった!!</p>
+        <p>
+          開放後に前後のメモリと併合する必要がある場合があるので、prevとp・pとnextが隣接してるか判定する。
+        </p>
+        <ul>
+          <li>(prev+prev-&gt size) != p なので、隣接していない </li>
+          <li>(p+p-&gt size)        = next    なので、隣接している</li>
+          <p>ブロックが隣接している場合は併合する。</p>
+      </div>
+      
+      <div class='slide'>
+        <h2>free</h2>
+        <img src="images/free3.png" width="700">
+        <p>チェックに引っかかったところをマージする。</p>
+      </div>
+      
+      <div class='slide'>
+        <h2>古典的malloc & freeまとめ</h2>
+        <p>フラグメンテーションが頻発する。</p>
+        <ul>
+          <li><p>このmallocが主流だった時は「メモリはプログラムの最初に一気に確保するもの」だった</p></li>
+          <li><p>メモリが充分に空いている状態で、
+              必要なメモリを一気に確保するならフラグメンテーションは起きにくい</p></li>
+          <li><p>今はJava・C++のようなオブジェクト指向言語、
+              Rubyのようなスクリプト言語等、小さいmallocが頻発する</p></li>
+          <li><p>それをfirst fitでやるのはよくない</p></li>
+        </ul>
+        
+      </div>
+      
+      
+      <div class='slide'>
+        <h2>mallocの改良</h2>
+        <p>そもそも、一つのfree listで管理することが無理がある</p>
+        <p>サイズ16用のリスト、サイズ24用のリスト……というようにリストを複数作ってやる</p>
+      </div>      
+    </div> <!-- presentation -->
+  </body>
 </html>