# HG changeset patch # User Tatsuki IHA # Date 1477392603 -32400 # Node ID 3d6b9e5ae73019af5ac5c962776a51853006fcbb # Parent fe6ea065e36ad184881b229ca2dbb2208c38e0b3 Update diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_08_02/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_08_02/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,41 @@ +title: Gears OS +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +# 今週 +- 研究関連は進んでないです +- プロ1の最終レポートの勉強会をしました + +# プロ1 +- 前期はずっと Python + - C は プロ2 でやるそうです +- 関数 +- 基本構文 + - if + - for + - while +- スコープ +- doctest をつかったユニットテスト +- docstring を使ったコメント、document + +# プロ1 +- KISS原則とDRY 原則 +- 再帰 +- File I/O +- Tuples, List, Dictionaries, String +- Functions Objects + - higher order function +- IDE(PyCharm) + - JetBrains 製なので UI はほぼ intelliJ +- PyCharm を使った Debug +- 例外 +- Assertion +- Version Control + +# 最終レポート勉強会 +- 巡回セールスマン問題を力技で解く + - 全ての順路の列挙して最小を探す +- 楽しく13時間 +- 最初は15名くらいいたけど、 最終的には2~3名程度に diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_08_23/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_08_23/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,19 @@ +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 によって依存関係が決定し、それにそって並列実行を行う +- 現在のGears OS は 依存関係がある並列処理を行うことが出来ない。 今研究ではGears OS の依存関係の解決を目標とする + +# いろいろ +- 楽しいの夏休みだった +- PD が終わった +- ワークショップどうしよう + +# ワークショップ +- M1 主催で研究計画書かしてよろしく! +- M1 が思ったより少ないので M2 もよろしく! diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_09_13/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_09_13/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,50 @@ +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 によって依存関係が決定し、それにそって並列実行を行う +- 現在のGears OS は 依存関係がある並列処理を行うことが出来ない。 今研究ではGears OS の依存関係の解決を目標とする + +# 夏休みイベント +- ワークショップどうしよう + +# ワークショップ +- M1 主催で研究計画書かしてよろしく! +- M1 が思ったより少ないので M2 もよろしく! + +# Dependency は? +- 絶賛デバッグ中 +- ``context->next`` を結構多用してるので直す +- 実行する CS + +``` c +__code add(struct Context* context, struct Integer* input1, struct Integer* input2, struct Integer* output) { + output->value = input1->value + input2->value; + printf("%d + %d = %d\n", input1->value, input2->value, output->value); + goto meta(context, context->next); +} + +__code add_stub(struct Context* context) { + goto add(context, + (struct Integer*)((struct Task*)(context->data[Element]->element.data))->iargs[0], + (struct Integer*)((struct Task*)(context->data[Element]->element.data))->iargs[1], + (struct Integer*)((struct Task*)(context->data[Element]->element.data))->oargs[0]); +} + +// こう書きたい? +// input と output の区別を付けたい +// + +__code add(struct Integer* input1, struct Integer* input2) { + output->value = input1->value + input2->value; + printf("%d + %d = %d\n", input1->value, input2->value, output->value); + goto next +} +``` + +# 来週 +- 東京にいます diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_09_30/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_09_30/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,8 @@ +title: B4 ワークショップ! +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +# とりあえず目に付いた点 +- 計画概要が研究概要になってる人が多い diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_10_04/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_10_04/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,102 @@ +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 によって依存関係が決定し、それにそって並列実行を行う + +# 今週やってたこと +- red black Tree の stack_push, pop の取り除き +- コーディングルールを確認 + +# rbTree +- staskに積まれるnodeを ``traverse->nodeStack`` に格納する +- nodeStack は element なので next をもつ + +``` +struct Traverse { + enum Code next; + enum Code rotateNext; + struct Node* current; // reading node of original tree + struct Node* newNode; // writing node of new tree + struct Element* nodeStack; + int result; +} traverse; +``` + +# rbTree +``` +__code replaceNode(struct Context* context, struct Traverse* traverse, struct Node* oldNode, struct Node* newNode, struct Element* element) { + *newNode = *oldNode; + element->next = traverse->nodeStack; + element->data = (union Data* )newNode; + traverse->nodeStack = element; + // goto replaceNode1(struct Traverse* traverse, struct Node* node, struct Node* oldNode, struct Node* newNode, +struct Node* newnewNode, int result) + goto meta(context, Replace1); +} + +__code replaceNode_stub(struct Context* context) { + struct Allocate* allocate = &context->data[Allocate]->allocate; + allocate->size = sizeof(struct Element); + allocator(context); + struct Element* element = &context->data[context->dataNum]->element; + goto replaceNode(context, + &context->data[Traverse]->traverse, + context->data[Traverse]->traverse.current, + context->data[Traverse]->traverse.newNode, + element); +} +``` + +``` +__code replaceNode(struct Context* context, struct Traverse* traverse, struct Node* oldNode, struct Node* newNode, int result) { + *newNode = *oldNode; + stack_push(context->node_stack, &newNode); + if (result == EQ) { + newNode->value = context->data[Node]->node.value; + // go to stack clear + stack_pop(context->code_stack, &context->next); + goto meta(context, context->next); + } else if (result == GT) { + traverse->current = oldNode->right; + newNode->right = context->heap; // allocator(context,struct Node) + } else { + traverse->current = oldNode->left; + newNode->left = context->heap; + } + + allocator(context); + + if (traverse->current) { + compare(context, traverse, traverse->current->key, context->data[Node]->node.key); + goto meta(context, Replace); + } + goto meta(context, Insert); +} + +__code replaceNode_stub(struct Context* context) { + goto replaceNode(context, + &context->data[Traverse]->traverse, + context->data[Traverse]->traverse.current, + &context->data[context->dataNum]->node, // new Node + context->data[Traverse]->traverse.result); + +} +``` + + +# いろいろ +- 引数 + - ``__code code1(struct Node* +node)`` みたいに新しく allocate するものは+ を付ける +- stack と queue の api が欲しい + - Stack interface & Queue interface を用意してそこに operatorの csの番号を持たせる(popとかpushに) + - データ構造の生成時に interface の cs の番号を送ることで データ構造が持つ型によって実行する CS を変える + - とりあえず保留にしとこう +- allocate + - allocate はやっぱり CS であるべきだよね + - allocate で作ったものをどう参照するか +- DS + - enum DataType を union Data の要素につける diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_10_18/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_10_18/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,21 @@ +title: プロ4 +author: Tatsuki IHA +profile: +lang: Japanese +code-engine: coderay + +# 今週 +- 研究関連はしてない +- プログラミング4 +- jenkins の設定(昨日) + +# プロ4 +- チームが多かった(8ぐらいいた) +- 1人チーム? が3つほど +- Twitter がほとんどで Facebook, Line が一チームずつ +- db のrelationまでやってるチームが 1,2つ +- Wordpress に書き込み権限がなかったので, とりあえず slack で報告してもらうことに(まだ来てない) + +# プロ4 +- とりあえず今週はやるかどうかわからないので, 2週を目処に web サービスとスマホアプリの連携 と 自分たちがやりたいことを mindmap にまとめてくると言う課題を出しました +- 1人チームで環境構築さえできてない人もいたので, 強制的にチームを決めて方が良いかもしれない diff -r fe6ea065e36a -r 3d6b9e5ae730 2016/2016_10_25/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2016/2016_10_25/slide.md Tue Oct 25 19:50:03 2016 +0900 @@ -0,0 +1,122 @@ +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 によって依存関係が決定し、それにそって並列実行を行う +- 現在の Gears では Stack や Queue の operatation の API が存在しなため, 記述が困難になっている. そのため, この研究では Gears OS における API の記述方法を設計し, 実装する + +## 今週 +- rb_tree をとりあえず error はとりました + - 動いてない +- Jenkins の update をしました 2.17 -> 2.26 + - yum で jenkins を入れてたので yum update jenkins で update できました + +## StackInterface +- ``struct Stack`` は 実際の Stack の実装(StackSelf)と push, pop, isEmpty を設定 + +``` c +struct Stack { + union StackSelf* stack; + union Data* data; + enum Code push; + enum Code pop; + enum Code isEmpty; + enum Code next; +} stack; +union StackSelf { + struct SingleLinkedStack { + struct Stack i; + struct Element* top; + } singleLinekedStack; + struct ArrayStack { + int size; + int limit; + struct Element* array; + } arrayStack; +}; +``` + +## push continuation +- push を継続する際は ``stack->data`` を入れて ``stack->push`` を呼び出す + +``` c +__code put(struct Context* context, struct Stack* nodeStack, struct Tree* tree, struct Node* node, struct Traverse* traverse, struct Node* root, struct Node* newNode) { + .... + traverse->current = root; + // traverse->result = traverse->compare(traverse->current, node); + traverse->result = compare(traverse->current, node); + *traverse->newNode = *traverse->current; + nodeStack->data = (union Data*)newNode; // set push data + nodeStack->next = Replace1; + goto meta(context, nodeStack->push); + // goto traverse->nodeStack->push(newNode, replaceNode1, traverse, node); +} +``` + +## compare function +- compare は コメントに沿って node 2つを取って, return する形にしました + +``` c +void compare(struct Context* context, struct Traverse* traverse, int key1, int key2) { + if (key1 == key2) { + traverse->result = EQ; + } else if (key1 < key2) { + traverse->result = GT; + } else { + traverse->result = LT; + } +} +``` + +``` c +enum Relational compare(struct Node* node1, struct Node* node2) { + int key1 = node1->key; + int key2 = node2->key; + if (key1 == key2) { + return EQ; + } else if (key1 < key2) { + return GT; + } else { + return LT; + } +} +``` + +## pop operation +- まだ例の部分を書いてない +- `stack->data` に pop した値を入れる感じになりそう + +``` c +__code popSingleLinkedStack(struct Context* context, struct SingleLinkedStack* stack, union Data* data, enum Code next) { + data = stack->top->data; + stack->top = stack->top->next; + goto meta(context, next); +} + +__code popSingleLinkedStack_stub(struct Context* context) { + goto popSingleLinkedStack(context, + &context->data[Stack]->stack.stack, + context->data[Stack]->stack.data, + context->data[Stack]->stack.next); +} +``` + +## わかってない +- Stack 等の初期化をどこでやるか? +- 今のところ initContext に書いている +- でも create~~stack はあるから多分これを呼ぶ + +``` c +__code createSingleLinkedStack(struct Context* context, enum Code next) { + struct SingleLinkedStack* stack = allocate(context, SignleLinkedStack); + stack->top = NULL; + stack->i.push = PushSingleLinkedStack; + stack->i.pop = PopsingleLinkedStack; + stack->i.isEmpty = _; + goto meta(context, next); +} +```