# HG changeset patch # User ikkun # Date 1487142971 -32400 # Node ID df7a469596bd12eac60b11a4ad0f17e0ad228f08 # Parent 094f2573edf1cdae67a8b719ee924522f7de825a fix diff -r 094f2573edf1 -r df7a469596bd paper/.DS_Store Binary file paper/.DS_Store has changed diff -r 094f2573edf1 -r df7a469596bd paper/main.aux --- a/paper/main.aux Wed Feb 15 05:27:08 2017 +0900 +++ b/paper/main.aux Wed Feb 15 16:16:11 2017 +0900 @@ -4,47 +4,47 @@ \@writefile{lot}{\addvspace {10\p@ }} \newlabel{chap:introduction}{{1}{1}} \citation{cbc-lola} -\citation{opencl} -\citation{cuda} \@writefile{toc}{\contentsline {chapter}{\numberline {第2章}GearsOS}{2}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} \@writefile{toc}{\contentsline {section}{\numberline {2.1}Continuation Baseed C}{2}} \@writefile{lof}{\contentsline {figure}{\numberline {2.1}{\ignorespaces gotoによる Code Segment 間の接続}}{2}} \newlabel{fig:cbc_goto}{{2.1}{2}} -\@writefile{toc}{\contentsline {section}{\numberline {2.2}Code Gear と Data Gear}{2}} +\citation{opencl} +\citation{cuda} +\@writefile{toc}{\contentsline {section}{\numberline {2.2}Code Gear と Data Gear}{3}} \@writefile{toc}{\contentsline {section}{\numberline {2.3}並列性}{3}} \@writefile{toc}{\contentsline {section}{\numberline {2.4}柔軟性}{3}} -\@writefile{toc}{\contentsline {section}{\numberline {2.5}Gears でのMeta computation の実行}{3}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第3章}Gears OSの構成}{4}} +\@writefile{toc}{\contentsline {section}{\numberline {2.5}Gears でのMeta computation の実行}{4}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第3章}Gears OSの構成}{5}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {3.1}TaskManager}{4}} -\@writefile{toc}{\contentsline {section}{\numberline {3.2}Worker}{4}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第4章}GPGPU}{5}} +\@writefile{toc}{\contentsline {section}{\numberline {3.1}TaskManager}{5}} +\@writefile{toc}{\contentsline {section}{\numberline {3.2}Worker}{5}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第4章}GPGPU}{6}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {4.1}GPGPUとは}{5}} -\@writefile{lof}{\contentsline {figure}{\numberline {4.1}{\ignorespaces Gears OS による GPGPU}}{6}} -\newlabel{fig:gpgpu}{{4.1}{6}} -\@writefile{toc}{\contentsline {section}{\numberline {4.2}CUDAでの実行}{6}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第5章}GPU 実装}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {4.1}GPGPUとは}{6}} +\@writefile{lof}{\contentsline {figure}{\numberline {4.1}{\ignorespaces Gears OS による GPGPU}}{7}} +\newlabel{fig:gpgpu}{{4.1}{7}} +\@writefile{toc}{\contentsline {section}{\numberline {4.2}CUDAとは}{7}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第5章}GPU 実装}{8}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {5.1}GPUWoker の実装}{7}} -\@writefile{toc}{\contentsline {section}{\numberline {5.2}CUDATwiceの実装}{7}} -\@writefile{toc}{\contentsline {section}{\numberline {5.3}CMake}{7}} -\@writefile{toc}{\contentsline {section}{\numberline {5.4}性能評価}{7}} -\@writefile{toc}{\contentsline {section}{\numberline {5.5}比較}{7}} -\@writefile{toc}{\contentsline {chapter}{\numberline {第6章}今後の課題}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {5.1}GPUWoker の実装}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {5.2}CUDATwiceの実装}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {5.3}CMake}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {5.4}性能評価}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {5.5}比較}{8}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第6章}今後の課題}{9}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {6.1}GPU並列実行}{8}} +\@writefile{toc}{\contentsline {section}{\numberline {6.1}GPU並列実行}{9}} \citation{*} \bibstyle{junsrt} \bibdata{reference} -\@writefile{toc}{\contentsline {chapter}{\numberline {第7章}結論}{9}} +\@writefile{toc}{\contentsline {chapter}{\numberline {第7章}結論}{10}} \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {7.1}まとめ}{9}} -\@writefile{toc}{\contentsline {section}{\numberline {7.2}今後の課題}{9}} +\@writefile{toc}{\contentsline {section}{\numberline {7.1}まとめ}{10}} +\@writefile{toc}{\contentsline {section}{\numberline {7.2}今後の課題}{10}} diff -r 094f2573edf1 -r df7a469596bd paper/main.dvi Binary file paper/main.dvi has changed diff -r 094f2573edf1 -r df7a469596bd paper/main.lof --- a/paper/main.lof Wed Feb 15 05:27:08 2017 +0900 +++ b/paper/main.lof Wed Feb 15 16:16:11 2017 +0900 @@ -3,7 +3,7 @@ \contentsline {figure}{\numberline {2.1}{\ignorespaces gotoによる Code Segment 間の接続}}{2} \addvspace {10\p@ } \addvspace {10\p@ } -\contentsline {figure}{\numberline {4.1}{\ignorespaces Gears OS による GPGPU}}{6} +\contentsline {figure}{\numberline {4.1}{\ignorespaces Gears OS による GPGPU}}{7} \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } diff -r 094f2573edf1 -r df7a469596bd paper/main.log --- a/paper/main.log Wed Feb 15 05:27:08 2017 +0900 +++ b/paper/main.log Wed Feb 15 16:16:11 2017 +0900 @@ -1,4 +1,4 @@ -This is e-pTeX, Version 3.14159265-p3.6-141210-2.6 (utf8.euc) (TeX Live 2015) (preloaded format=platex 2015.11.28) 15 FEB 2017 04:09 +This is e-pTeX, Version 3.14159265-p3.6-141210-2.6 (utf8.euc) (TeX Live 2015) (preloaded format=platex 2015.11.28) 15 FEB 2017 11:11 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -177,45 +177,19 @@ LaTeX Warning: Citation `cbc-lola' on page 2 undefined on input line 102. File: ./pic/cbc_goto.pdf Graphic file (type pdf) -<./pic/cbc_goto.pdf> - -LaTeX Warning: Citation `opencl' on page 2 undefined on input line 121. - - -LaTeX Warning: Citation `cuda' on page 2 undefined on input line 121. - -[2 +<./pic/cbc_goto.pdf> [2 ] -LaTeX Warning: Reference `fig:CG_Flexibility' on page 3 undefined on input line - 146. - -[3] -第 3 章 - -LaTeX Warning: Reference `src:sync_enqueue' on page 4 undefined on input line 1 -61. - - -LaTeX Warning: Reference `src:sync_enqueue' on page 4 undefined on input line 1 -62. +LaTeX Warning: Citation `opencl' on page 3 undefined on input line 121. -! Package Listings Error: File `./src/sync_enqueue(.c)' not found. - -Type X to quit or to proceed, -or enter new name. (Default extension: c) +LaTeX Warning: Citation `cuda' on page 3 undefined on input line 121. -Enter file name: -! Undefined control sequence. -\\lst@inputlisting ...}}\reserved@a }\lst@doendpe - \@newlistfalse \ignorespaces -l.164 ...e, caption=Enqueue]{./src/sync_enqueue.c} - -? +[3] [4] +第 3 章 -LaTeX Warning: Reference `src:sync_dequeue' on page 4 undefined on input line 1 +LaTeX Warning: Reference `src:sync_dequeue' on page 5 undefined on input line 1 81. @@ -231,7 +205,7 @@ l.184 ...e, caption=GetTask]{./src/sync_dequeue.c} ? -[4 +[5 ] 第 4 章 @@ -244,22 +218,22 @@ (Font) Font shape `OMS/cmsy/m/n' tried instead on input line 203. File: pic/gearsos.pdf Graphic file (type pdf) - [5 + [6 -] [6] +] [7] 第 5 章 -[7 +[8 ] 第 6 章 -[8 +[9 ] 第 7 章 No file main.bbl. -[9 +[10 -] [10 +] [11 ] (./main.aux) @@ -267,12 +241,12 @@ ) Here is how much of TeX's memory you used: - 2112 strings out of 493777 - 29303 string characters out of 6151333 + 2109 strings out of 493777 + 29253 string characters out of 6151333 122772 words of memory out of 5000000 - 5590 multiletter control sequences out of 15000+600000 + 5588 multiletter control sequences out of 15000+600000 14180 words of font info for 55 fonts, out of 8000000 for 9000 929 hyphenation exceptions out of 8191 - 26i,5n,40p,573b,313s stack positions out of 5000i,500n,10000p,200000b,80000s + 26i,4n,40p,573b,313s stack positions out of 5000i,500n,10000p,200000b,80000s -Output written on main.dvi (14 pages, 25052 bytes). +Output written on main.dvi (15 pages, 25208 bytes). diff -r 094f2573edf1 -r df7a469596bd paper/main.pdf Binary file paper/main.pdf has changed diff -r 094f2573edf1 -r df7a469596bd paper/main.tex --- a/paper/main.tex Wed Feb 15 05:27:08 2017 +0900 +++ b/paper/main.tex Wed Feb 15 16:16:11 2017 +0900 @@ -116,7 +116,7 @@ \caption{gotoによる Code Segment 間の接続} \label{fig:cbc_goto} \end{figure} - +\newpage \section{Code Gear と Data Gear} Code Gear はプログラムの実行コードそのものであり、OpenCL\cite{opencl}/CUDA\cite{cuda} の kernel に相当する。 @@ -139,31 +139,30 @@ %並列性と柔軟性は2つともSegment毎に分けられていることで成り立つわけだから、説明する際に2つでSegmentによって分けられるって事説明するのか?同じ事説明してるけど % 並列処理するの問題、並列化刷ることによって依存関係のあるプログラムがあると並列化出来ない、ということだけど、依存関係ってもっとわかりやすく言うとなに?->要するに、Aの処理を行うにはBの処理を施した値を使わないといけないとかそういうこと、逆に依存関係が無い処理は同時に並列処理していいわけだけど、ソレはつまりここでいう並列性とは、並列化し易いとかそういうことでいいんだろうか、 依存関係の無い形、Gearという分けられた単位にはほかとの依存関係は無い、わけではなくて、あるけど、  処理毎に分けることによって、依存している物を明確にしているって言うところが強みである。 -Code Gear は Task を実行するのに必要な Input Data Gear と Task を実行し出力される Output Data Gear の組によって +Code Gear が処理するのに必要な Input Data Gear と処理の実行後に出力される Output Data Gear の組を Task と呼び、Code Gear は接続する Task 以外とは依存関係がなく、1つの Code Gear の中で処理の依存関係が解決しているため、変更なしに並列処理の Thread に乗せることが出来る。 +%Code Gear を複数Threadに分けて並列処理刷る図を入れてもいいかも + \section{柔軟性} %プログラムの処理が Gearという単位で分けられて記述されているって言うけど、プログラムの処理ってなに?という疑問を持つのが一般的だと思われ -Code Gear Data Gear はCbCを用いて記述されており、その特徴としてプログラムの処理が Gear という単位で分けられて記述されていることである。\\ -また Gear の処理の遷移には goto を用いており、この goto 先を変更することで容易に処理の順番を変更、もしくは新しい処理を追加することが出来る。図\ref{fig:CG_Flexibility}は Code Gear C と Code Gear D を入れ替えたものであり、この入れ替えを行う場合 Code Gear C を指していた goto の先を Code Gear D に書き換えるだけで済む。 +Code Gear Data Gear はCbCを用いて記述されており、処理の遷移には goto を用いた軽量継続によって移行している。 +また Code Gear は C の関数と同じ単位で分割されており、処理の遷移に用いられている goto の遷移先を変更することで、容易に処理の順番を変更や新しい処理を追加することが出来る +%図\ref{fig:CG_Flexibility}は Code Gear C と Code Gear D を入れ替えたものであり、この入れ替えを行う場合 Code Gear C を指していた goto の先を Code Gear D に書き換えるだけで済む。 + +\newpage %図で言うよりも goto の説明をしたほうがわかりやすいかも、gotoがどういったものでどういう事に使われているのか、これがわかればわかるのでは? \section{Gears でのMeta computation の実行} Gears OS では通常の処理を Computation、 Computation のための Computation を Meta Computation として扱う。 -Meta Computation の例として並列処理の依存関係の解決や、 OS が行うネットワーク管理、メモリ管理等の資源制御などが挙げられる。 -Gears OS では Meta Computation を Meta Code Gear、 Meta Data Gear で表現する。 -Meta Code Gear は通常の Code Gear 直後に遷移され、 Meta Computation を実行する。 -Meta Computation の実行後は通常の Code Gear で指定した Code Gear を実行する。 -つまり Code Gear の実行後は何かしらの Meta Code Gear を実行する。 +例として、 Code Gear が次に実行する Code Gear を goto で名前指定する。 +この継続処理に対してMeta Code Gear が名前を解釈して、処理を対応する Code Gear に引き渡す。 +これらは、従来の OS の Dynamic Loading Library や Command 呼び出しに対応する。 +名前と Code Gear へのポインタの対応は Meta Data Gear に格納される。 +この Meta Data Gear を Context と呼ぶことにする。 +これは従来の OS の Process や Thread を表す構造体に対応する。 \chapter{Gears OSの構成} - - -Code \ref{src:sync_enqueue} に CAS を使用した Task 挿入を示している。 -Code \ref{src:sync_enqueue} は 2つのCode Gear を定義しており、 putQueue3 は Queue に要素がある場合、 putQueue4 は Queue に要素がない場合の Task 挿入を示している。 - -\lstinputlisting[label=src:sync_enqueue, caption=Enqueue]{./src/sync_enqueue.c} - \section{TaskManager} Gears OS の TaskManager は WaitTaskQueue に入っている Task の依存関係を解決する。 Task には Input/Output Data Gear の情報が格納されている。 @@ -213,16 +212,17 @@ \begin{figure}[ht] \centering - \includegraphics[width=90mm]{pic/gearsos.pdf} + \includegraphics[width=120mm]{pic/gearsos.pdf} \caption{Gears OS による GPGPU} \label{fig:gpgpu} \end{figure} \newpage % CPUからGPUにTaskを振り分ける図があってもいい -\section{CUDAでの実行} +\section{CUDAとは} %CUDAの説明 -CUDA とは NVIDIA が提供している並列コンピューティングアーキテクチャで +CUDA とは NVIDIA 社が提供している並列コンピューティング用の統合開発環境で、並列プログラムの記述や、コンパイラ、ライブラリなど、また GPU といった並列コンピューティングを行うのに必要なサポートを提供しており、一般的にも広く使われているGPUの開発環境です。 + %helper_cuda.h cmakeは一つの言語のコンパイルしか出来ない、CbCはC言語としてコンパイル出来るが、C++の言語がCUDAのhelper_cuda.hなどには含まれる。 \chapter{GPU 実装} @@ -234,7 +234,9 @@ \section{CUDATwiceの実装} \section{CMake} - +CMakeはビルド自動化ツールであり、プログラムをコンパイル行う際にライブラリや動作環境によって様々な設定を行う必要がありますが、CMakeにはそれらのファイルやライブラリを探し出して実行することが出来ます。\\ +CMakeのビルドは2段階からなり、最初にビルドに必要なライブラリやファイルを探し、通常のビルド環境用のビルドファイルを作成し、次にビルドするファイルにあったビルドを行います。 +CMakeはWindows や Linux 等、複数のOS の環境に対応している他、 \section{性能評価} \section{比較} diff -r 094f2573edf1 -r df7a469596bd paper/main.toc --- a/paper/main.toc Wed Feb 15 05:27:08 2017 +0900 +++ b/paper/main.toc Wed Feb 15 16:16:11 2017 +0900 @@ -1,24 +1,24 @@ \contentsline {chapter}{\numberline {第1章}GearsOSでのGPU実行}{1} \contentsline {chapter}{\numberline {第2章}GearsOS}{2} \contentsline {section}{\numberline {2.1}Continuation Baseed C}{2} -\contentsline {section}{\numberline {2.2}Code Gear と Data Gear}{2} +\contentsline {section}{\numberline {2.2}Code Gear と Data Gear}{3} \contentsline {section}{\numberline {2.3}並列性}{3} \contentsline {section}{\numberline {2.4}柔軟性}{3} -\contentsline {section}{\numberline {2.5}Gears でのMeta computation の実行}{3} -\contentsline {chapter}{\numberline {第3章}Gears OSの構成}{4} -\contentsline {section}{\numberline {3.1}TaskManager}{4} -\contentsline {section}{\numberline {3.2}Worker}{4} -\contentsline {chapter}{\numberline {第4章}GPGPU}{5} -\contentsline {section}{\numberline {4.1}GPGPUとは}{5} -\contentsline {section}{\numberline {4.2}CUDAでの実行}{6} -\contentsline {chapter}{\numberline {第5章}GPU 実装}{7} -\contentsline {section}{\numberline {5.1}GPUWoker の実装}{7} -\contentsline {section}{\numberline {5.2}CUDATwiceの実装}{7} -\contentsline {section}{\numberline {5.3}CMake}{7} -\contentsline {section}{\numberline {5.4}性能評価}{7} -\contentsline {section}{\numberline {5.5}比較}{7} -\contentsline {chapter}{\numberline {第6章}今後の課題}{8} -\contentsline {section}{\numberline {6.1}GPU並列実行}{8} -\contentsline {chapter}{\numberline {第7章}結論}{9} -\contentsline {section}{\numberline {7.1}まとめ}{9} -\contentsline {section}{\numberline {7.2}今後の課題}{9} +\contentsline {section}{\numberline {2.5}Gears でのMeta computation の実行}{4} +\contentsline {chapter}{\numberline {第3章}Gears OSの構成}{5} +\contentsline {section}{\numberline {3.1}TaskManager}{5} +\contentsline {section}{\numberline {3.2}Worker}{5} +\contentsline {chapter}{\numberline {第4章}GPGPU}{6} +\contentsline {section}{\numberline {4.1}GPGPUとは}{6} +\contentsline {section}{\numberline {4.2}CUDAとは}{7} +\contentsline {chapter}{\numberline {第5章}GPU 実装}{8} +\contentsline {section}{\numberline {5.1}GPUWoker の実装}{8} +\contentsline {section}{\numberline {5.2}CUDATwiceの実装}{8} +\contentsline {section}{\numberline {5.3}CMake}{8} +\contentsline {section}{\numberline {5.4}性能評価}{8} +\contentsline {section}{\numberline {5.5}比較}{8} +\contentsline {chapter}{\numberline {第6章}今後の課題}{9} +\contentsline {section}{\numberline {6.1}GPU並列実行}{9} +\contentsline {chapter}{\numberline {第7章}結論}{10} +\contentsline {section}{\numberline {7.1}まとめ}{10} +\contentsline {section}{\numberline {7.2}今後の課題}{10}