# HG changeset patch # User Tatsuki IHA # Date 1490108328 -32400 # Node ID bf593e6958b1942cacb1bb285bf78adbe8980d8b # Parent 585dd2901c9e8e72d011e652077aa2f28c2efc76 Update diff -r 585dd2901c9e -r bf593e6958b1 2017/2017_01_10/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2017/2017_01_10/slide.md Tue Mar 21 23:58:48 2017 +0900 @@ -0,0 +1,49 @@ +title: Gears OS +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +## 研究目的 +- 当研究室では 処理の単位を Code Gear、 データの単位を Data Gear を用いて 信頼性が高い並列処理を行う Gears OS を開発している +- Gears OS では Task を Code Gear と実行するときに必要な Input Data Gear と出力するための Output Data Gear の組で表現される。 Input Data Gear/Output Data Gear によって依存関係が決定し、それにそって並列実行を行う. +- 依存関係の解決やモデル検査等の本論の計算を行うためのメタな計算を Meta Code Gear で行う. +- 現在の Gears では Stack や Queue の operatation の API が存在しなため, 記述が困難になっている. そのため, この研究では Gears OS における API の記述方法を設計し, 実装する + + +## 冬休み +- 寝正月 +- Gears の Queue と Stack のテストコードを動かす + - module 別のcontext の生成はうまく動いてます + - 動いた +- Gears Task 生成 & inqueue までは動いた +- next Worker 実装 + +## Worker実装 +- Worker 毎に Synchronized Queueをもたせる +- TaskManager から Worker の Queue にTask を入れる + +``` +__code taskSend(struct Context* context, TaskManager* taskManger, LoopCounter* loopCounter) { + if(loopCounter->i < taskManager->numWorker) { + taskManager->workers[i]->taskSend; + loopCounter->i++; + goto meta(context, taskManager->taskSend); + } + goto meta(context, TaskManager->next); +} +``` + +## Worker 実装 +- Worker側のtaskReceive +- task を receive するとQueue に task が入っているので, とりだして task を execute する + +``` +__code taskReceive(struct Context* context) { + queue->queue = (union Data*)worker->worker->Worker.tasks; + queue->next = worker->execute; + goto meta(context, queue->queue->Queue.take); +} +``` + +## diff -r 585dd2901c9e -r bf593e6958b1 2017/2017_01_17/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2017/2017_01_17/slide.md Tue Mar 21 23:58:48 2017 +0900 @@ -0,0 +1,22 @@ +title: Gears OS +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +## 研究目的 +- 当研究室では 処理の単位を Code Gear、 データの単位を Data Gear を用いて 信頼性が高い並列処理を行う Gears OS を開発している +- Gears OS では Task を Code Gear と実行するときに必要な Input Data Gear と出力するための Output Data Gear の組で表現される。 Input Data Gear/Output Data Gear によって依存関係が決定し、それにそって並列実行を行う. +- 依存関係の解決やモデル検査等の本論の計算を行うためのメタな計算を Meta Code Gear で行う. +- 現在の Gears では Stack や Queue の operatation の API が存在しなため, 記述が困難になっている. そのため, この研究では Gears OS における API の記述方法を設計し, 実装する + + +## 今週 +- task dependechy をどうするか? +- Worker 実装 + +## Task Dependenchy +- Task 毎に contextをもつ + - task の実行前のmeta に context を切り替える + +multiDisplay diff -r 585dd2901c9e -r bf593e6958b1 2017/2017_02_07/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2017/2017_02_07/slide.md Tue Mar 21 23:58:48 2017 +0900 @@ -0,0 +1,73 @@ +title: Gears OS +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +## 研究目的 +- 当研究室では 処理の単位を Code Gear、 データの単位を Data Gear を用いて 信頼性が高い並列処理を行う Gears OS を開発している +- Gears OS では Task を Code Gear と実行するときに必要な Input Data Gear と出力するための Output Data Gear の組で表現される。 Input Data Gear/Output Data Gear によって依存関係が決定し、それにそって並列実行を行う. +- 依存関係の解決やモデル検査等の本論の計算を行うためのメタな計算を Meta Code Gear で行う. +- 現在の Gears では Stack や Queue の operatation の API が存在しなため, 記述が困難になっている. そのため, この研究では Gears OS における API の記述方法を設計し, 実装する + + +## 今週 +- semaphore を作りました +- Synchornized Queue の 中身の数を semaphore で管理する +- odg_commit のコードを軽く書きました +- torqueを動かしました + +## semaphore の data Gearの構成 +- Cerium の Sem.c を参考に + +``` c +struct Semaphore { + union Data* semaphore; + enum Code p; + enum Code v; + enum Code next; +} Semaphore; +struct SemaphoreImpl { + int value; + pthread_mutex_t mutex; + pthread_cond_t cond; +} SemaphoreImpl; +``` + +## semaphore の実装 +- p命令は wait でループする必要があるため ループ用の cgも作る +- generate_stub でちゃんとstubが生成される形 + +``` c +Semaphore* createSemaphoreImpl(struct Context* context, int n) { + .... +} + +__code pOperationSemaphoreImpl(struct SemaphoreImpl* semaphore, __code next(...)) { + pthread_mutex_lock(&semaphore->mutex); + goto meta(context, C_pOperationSemaphoreImpl1); +} + +__code pOperationSemaphoreImpl1(struct SemaphoreImpl* semaphore, __code next(...)) { + if(semaphore->value == 0) { + pthread_cond_wait(&semaphore->cond, &semaphore->mutex); + goto meta(context, C_pOperationSemaphoreImpl1); + } + semaphore->value--; + pthread_mutex_unlock(&semaphore->mutex); + goto next(...); +} + +__code vOperationSemaphoreImpl(struct SemaphoreImpl* semaphore, __code next(...)) { + pthread_mutex_lock(&semaphore->mutex); + semaphore->value++; + pthread_cond_signal(&semaphore->cond); + pthread_mutex_unlock(&semaphore->mutex); + goto next(...); +} +``` + + +## twice スピードが出ない +- 単純にtime だとcpuを増やしてもスピードが出ない +- length の量を結構増やすと一応は早くなる diff -r 585dd2901c9e -r bf593e6958b1 2017/2017_03_21/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2017/2017_03_21/slide.md Tue Mar 21 23:58:48 2017 +0900 @@ -0,0 +1,23 @@ +title: OS 研究会 +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +## 研究会に出すもの(出せそうなもの?) +- Gears OS関連 + - Gears OS の言語support(generate stub とか generate context とか) + - Gears のコード記述 + - Gears のプログラミング + - GPU 対応 + - Task dependency の設計 + - Gears OSの並列処理 +- Jungle + - 分散version の測定が必要? + - disk 書き出し + - 複数implementation + - Jungle には同じデータが書き出される + - その同じデータの中にも複数のimplementationがある + +## Akatsuki +- Felica Devices(edy 対応で新しくしたモデル) は ちゃんとid 付いてました