Mercurial > hg > Papers > 2018 > parusu-master
changeset 38:c270df8d0691
Update
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 04 Feb 2018 20:50:16 +0900 |
parents | 506cc13ed747 |
children | ccc2059189ea |
files | paper/evaluation.tex paper/fig/bitonicSort.pdf paper/fig/bitonicSort.svg paper/fig/bitonicSort.xbb paper/fig/gotoInterface.graffle paper/fig/gotoInterface.pdf paper/fig/semaphoreSequence.graffle paper/fig/semaphoreSequence.pdf paper/fig/semaphoreSequence.xbb paper/fig/taskRun.graffle paper/interface.tex paper/master_paper.pdf paper/parallelism_gears.tex paper/src/semaphoreInterface.h paper/src/workerRun.cbc |
diffstat | 15 files changed, 239 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/paper/evaluation.tex Sun Feb 04 17:21:26 2018 +0900 +++ b/paper/evaluation.tex Sun Feb 04 20:50:16 2018 +0900 @@ -1,3 +1,7 @@ +% GPU が遅いのは cpu, GPU 間のデータの通信の分 +% Meta Data で データが GPU にあるのか, CPU にあるのかをわかるようにする +% CPU で必要なったときに初めて取り出す + \chapter{Gears OS の評価} \section{実験環境}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/fig/bitonicSort.svg Sun Feb 04 20:50:16 2018 +0900 @@ -0,0 +1,204 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<svg + width="600" height="480" + viewBox="0 0 600 480" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" +> + +<title>Gnuplot</title> +<desc>Produced by GNUPLOT 5.2 patchlevel 2 </desc> + +<g id="gnuplot_canvas"> + +<rect x="0" y="0" width="600" height="480" fill="none"/> +<defs> + + <circle id='gpDot' r='0.5' stroke-width='0.5'/> + <path id='gpPt0' stroke-width='0.222' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/> + <path id='gpPt1' stroke-width='0.222' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/> + <path id='gpPt2' stroke-width='0.222' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/> + <rect id='gpPt3' stroke-width='0.222' stroke='currentColor' x='-1' y='-1' width='2' height='2'/> + <rect id='gpPt4' stroke-width='0.222' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/> + <circle id='gpPt5' stroke-width='0.222' stroke='currentColor' cx='0' cy='0' r='1'/> + <use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/> + <path id='gpPt7' stroke-width='0.222' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/> + <use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/> + <use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/> + <use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/> + <use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/> + <use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/> + <path id='gpPt13' stroke-width='0.222' stroke='currentColor' d='M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z'/> + <use xlink:href='#gpPt13' id='gpPt14' fill='currentColor' stroke='none'/> + <filter id='textbox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'> + <feFlood flood-color='white' flood-opacity='1' result='bgnd'/> + <feComposite in='SourceGraphic' in2='bgnd' operator='atop'/> + </filter> + <filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'> + <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/> + <feComposite in='SourceGraphic' in2='grey' operator='atop'/> + </filter> +</defs> +<g fill="none" color="white" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,444.0 L72.6,444.0 M557.8,444.0 L548.8,444.0 '/> <g transform="translate(55.3,447.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 0</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,400.7 L72.6,400.7 M557.8,400.7 L548.8,400.7 '/> <g transform="translate(55.3,404.6)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 5</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,357.4 L72.6,357.4 M557.8,357.4 L548.8,357.4 '/> <g transform="translate(55.3,361.3)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 10</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,314.0 L72.6,314.0 M557.8,314.0 L548.8,314.0 '/> <g transform="translate(55.3,317.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 15</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,270.7 L72.6,270.7 M557.8,270.7 L548.8,270.7 '/> <g transform="translate(55.3,274.6)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 20</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,227.4 L72.6,227.4 M557.8,227.4 L548.8,227.4 '/> <g transform="translate(55.3,231.3)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 25</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,184.1 L72.6,184.1 M557.8,184.1 L548.8,184.1 '/> <g transform="translate(55.3,188.0)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 30</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,140.7 L72.6,140.7 M557.8,140.7 L548.8,140.7 '/> <g transform="translate(55.3,144.6)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 35</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,97.4 L72.6,97.4 M557.8,97.4 L548.8,97.4 '/> <g transform="translate(55.3,101.3)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 40</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,54.1 L72.6,54.1 M557.8,54.1 L548.8,54.1 '/> <g transform="translate(55.3,58.0)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="end"> + <text><tspan font-family="Arial" > 45</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M94.5,444.0 L94.5,435.0 M94.5,54.1 L94.5,63.1 '/> <g transform="translate(94.5,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >1 cpu</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M156.3,444.0 L156.3,435.0 M156.3,54.1 L156.3,63.1 '/> <g transform="translate(156.3,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >2 cpus</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M218.0,444.0 L218.0,435.0 M218.0,54.1 L218.0,63.1 '/> <g transform="translate(218.0,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >4 cpus</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M279.8,444.0 L279.8,435.0 M279.8,54.1 L279.8,63.1 '/> <g transform="translate(279.8,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >8 cpus</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M341.6,444.0 L341.6,435.0 M341.6,54.1 L341.6,63.1 '/> <g transform="translate(341.6,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >16 cpus</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M403.4,444.0 L403.4,435.0 M403.4,54.1 L403.4,63.1 '/> <g transform="translate(403.4,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >32 cpus</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M465.1,444.0 L465.1,435.0 M465.1,54.1 L465.1,63.1 '/> <g transform="translate(465.1,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >gpu</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M526.9,444.0 L526.9,435.0 M526.9,54.1 L526.9,63.1 '/> <g transform="translate(526.9,465.9)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >gpu(kernel only)</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,54.1 L63.6,444.0 L557.8,444.0 L557.8,54.1 L63.6,54.1 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g transform="translate(16.3,249.1) rotate(270)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >time(s)</tspan></text> + </g> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g transform="translate(310.7,31.0)" stroke="none" fill="black" font-family="Arial" font-size="12.00" text-anchor="middle"> + <text><tspan font-family="Arial" >bitonicSort benchmark</tspan></text> + </g> +</g> + <g id="gnuplot_plot_1" ><title>gnuplot_plot_1</title> +<g fill="none" color="white" stroke="black" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '79.0,444.0 110.0,444.0 110.0,85.1 79.0,85.1 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M79.0,444.0 L79.0,85.2 L109.9,85.2 L109.9,444.0 L79.0,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '140.8,444.0 171.8,444.0 171.8,241.7 140.8,241.7 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M140.8,444.0 L140.8,241.8 L171.7,241.8 L171.7,444.0 L140.8,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '202.6,444.0 233.6,444.0 233.6,340.3 202.6,340.3 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M202.6,444.0 L202.6,340.4 L233.5,340.4 L233.5,444.0 L202.6,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '264.4,444.0 295.4,444.0 295.4,389.1 264.4,389.1 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M264.4,444.0 L264.4,389.2 L295.3,389.2 L295.3,444.0 L264.4,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '326.1,444.0 357.1,444.0 357.1,415.0 326.1,415.0 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M326.1,444.0 L326.1,415.1 L357.0,415.1 L357.0,444.0 L326.1,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '387.9,444.0 418.9,444.0 418.9,427.7 387.9,427.7 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M387.9,444.0 L387.9,427.8 L418.8,427.8 L418.8,444.0 L387.9,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '449.7,444.0 480.7,444.0 480.7,396.9 449.7,396.9 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M449.7,444.0 L449.7,397.0 L480.6,397.0 L480.6,444.0 L449.7,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> + <g stroke='none' shape-rendering='crispEdges'> + <polygon fill = 'rgb(224, 255, 255)' points = '511.5,444.0 542.5,444.0 542.5,442.5 511.5,442.5 '/> + </g> + <path stroke='rgb( 0, 0, 0)' d='M511.5,444.0 L511.5,442.6 L542.4,442.6 L542.4,444.0 L511.5,444.0 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> + </g> +<g fill="none" color="black" stroke="currentColor" stroke-width="2.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +<g fill="none" color="black" stroke="black" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> + <path stroke='black' d='M63.6,54.1 L63.6,444.0 L557.8,444.0 L557.8,54.1 L63.6,54.1 Z '/></g> +<g fill="none" color="black" stroke="currentColor" stroke-width="1.00" stroke-linecap="butt" stroke-linejoin="miter"> +</g> +</g> +</svg> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/fig/bitonicSort.xbb Sun Feb 04 20:50:16 2018 +0900 @@ -0,0 +1,8 @@ +%%Title: fig/bitonicSort.pdf +%%Creator: extractbb 20170318 +%%BoundingBox: 0 0 600 480 +%%HiResBoundingBox: 0.000000 0.000000 600.000000 480.000000 +%%PDFVersion: 1.5 +%%Pages: 1 +%%CreationDate: Sat Feb 3 22:27:55 2018 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/fig/semaphoreSequence.xbb Sun Feb 04 20:50:16 2018 +0900 @@ -0,0 +1,8 @@ +%%Title: fig/semaphoreSequence.pdf +%%Creator: extractbb 20170318 +%%BoundingBox: 0 0 1120 869 +%%HiResBoundingBox: 0.000000 0.000000 1120.000000 869.000000 +%%PDFVersion: 1.3 +%%Pages: 1 +%%CreationDate: Sun Feb 4 15:57:13 2018 +
--- a/paper/interface.tex Sun Feb 04 17:21:26 2018 +0900 +++ b/paper/interface.tex Sun Feb 04 20:50:16 2018 +0900 @@ -13,6 +13,9 @@ % inteface の実装の際は Code Gear に代入して書く % C++ で言うとCode Gearは virtual % Impl の説明いれてない +% Interface 抜きのプログラミングも可能だが, 通常な言語だとアセンブラで書いてるような感覚(決まった位置にデータを書き出す) +% Interface はコールフレームの性質を持っている(入出力に使われている変数はInterface で定義する必要がある) +% 図のput の位置を直す \chapter{Gears OS のモジュール化} Gears OS は stub Code Gear という Meta Code Gear で Context という全ての Code Gear と Data Gear を持った Meta Data Gear から値を取りだし、ノーマルレベルの Code Gear に値を渡す。
--- a/paper/parallelism_gears.tex Sun Feb 04 17:21:26 2018 +0900 +++ b/paper/parallelism_gears.tex Sun Feb 04 20:50:16 2018 +0900 @@ -1,6 +1,8 @@ % Todo % 並列処理 の全体的な説明 % 構成のセクションいるかしら? +% par goto をコンパイルタイミングでflowを解析し(モデル検査で)処理が軽い場合は並列ではなく call にするみたいな最適化 +% taskManager の初期化のコードはいらない \chapter{Gears OSの並列処理} Gears OS では実行の Task を Code Gear と Input/Output Data Gear の組で表現する。 @@ -47,11 +49,8 @@ \item TaskManager(shutdown)の終了処理 \end{itemize} -\coderef{createTaskManager} に TaskManager Interface を実装した Data Gear の初期化部分を示す。 TaskManager は初期化の際に、指定した数の Worekr を生成する。 -その際CPU、GPU の数を指定することができ、指定した分の CPUWorker と GPUWorker が createWorker 関数 (\coderef{createTaskManager} 27-46行目) で生成される。 - -\lstinputlisting[caption=TaskManager の初期化, label=code:createTaskManager]{./src/createTaskManager.cbc} +その際CPU、GPU の数を指定することができ、指定した分の CPUWorker と GPUWorker が生成される。 TaskManager は \figref{sendTask}に示すように spawn を呼び出した際、実行する Task の Input Data Gear が用意されているかを判断する。 Input Data Gear が全て用意されている場合、その Task を Worker の Queue に送信する。
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/semaphoreInterface.h Sun Feb 04 20:50:16 2018 +0900 @@ -0,0 +1,8 @@ +typedef struct Semaphore<Impl>{ + union Data* semaphore; + __code next(...); + + // method + __code p(Impl* semaphore, __code next(...)); + __code v(Impl* semaphore, __code next(...)); +} Semaphore;
--- a/paper/src/workerRun.cbc Sun Feb 04 17:21:26 2018 +0900 +++ b/paper/src/workerRun.cbc Sun Feb 04 20:50:16 2018 +0900 @@ -1,4 +1,4 @@ -__code getTaskCPUWorker(struct Context* context, struct CPUWorker* cpuWorker, struct Context* task, struct Worker* worker) { +__code getTaskCPUWorker(struct CPUWorker* cpuWorker, struct Context* task, struct Worker* worker) { if (!task) { goto worker->shutdown(); // end thread } @@ -7,10 +7,3 @@ task->next = C_odgCommitCPUWorker; // commit outputDG after task exec goto meta(task, taskCg); // switch task context } - -__code getTaskCPUWorker_stub(struct Context* context) { - CPUWorker* cpuWorker = (CPUWorker*)GearImpl(context, Worker, worker); - Worker* worker = &Gearef(context,Worker)->worker->Worker; - struct Context* task = &Gearef(context, Queue)->data->Context; - goto getTaskCPUWorker(context, cpuWorker, task, worker); -}