annotate src/parallel_execution/Todo @ 430:35b37fe8d3a7

Add size member in struct Meta
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 09 Oct 2017 17:46:42 +0900
parents 0c113f8e5a3f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
394
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
1 Tue Aug 1 19:32:55 JST 2017
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
2
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
3 DataGear の待ち合わせ
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
4 DataGear の Commit
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
5
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
6 これらは、stubとgoto meta の部分で行う
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
7
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
8 どれに対して行うかを実行時あるいはコンパイル時に指定する必要がある
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
9
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
10 一つの解決策は、 typedefのときにannotution してあげる
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
11 もう一つの解決策は, Data Gear の allocation 時に指定する
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
12 Code Gearのプロトタイプのなかで指定する事も考えられる
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
13
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
14 par goto時に渡す continuation で同期をとっても良い, このときにはこのcontinuation を作成するinterfaceを作る必要がある
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
15
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
16 実行時に指定してしまうと、毎回フラグのチェックが必要になる。
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
17 これを abstract model checking を事前に行うことで, static なコードに置き換える事はできる
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
18
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
19 例題としては, chat、dining philosophers, map reduce
0c113f8e5a3f Update todo
innparusu
parents: 324
diff changeset
20
324
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
21 Fri Apr 14 18:44:09 JST 2017
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
22 struct B {
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
23 A a;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
24 .....
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
25 }
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
26 struct A {
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
27 __code init(..., __code next(A a, ...));
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
28 }
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
29 par goto A->init(a);
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
30 // meta level
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
31 task->code = C_init_A;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
32 task->data[idg] = ...;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
33 task->data[idg + 1] = ...;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
34 task->data[odg] = ...;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
35 task->next = C_writeToa;
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
36 goto meta(context, context->TaskManager->spawn)
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
37
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
38 // lambda version?
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
39 par goto A->init(\A -> a = A)
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
40
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
41 // meta level
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
42 par goto A->init(next = \A -> a = A)
d9887056ae5b Update Todo and Add comment to perl script
one
parents: 322
diff changeset
43
321
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
44 Wed Mar 1 18:25:36 JST 2017
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
45
322
366baa247572 Use generate_stub for queue_test
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 321
diff changeset
46 parallel_executtion/test/ を .cbc に書き直す
321
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
47 rb_tree の stub をできるだけ取り外す
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
48 synchornizedQueue の meta部分を分離する
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
49 synchronizedQueue のバグをとる
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
50 GPU のバグとり
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
51 cbc++...?
a9a6d571fa80 Update todo
innparusu
parents: 265
diff changeset
52
263
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
53 Sat Jan 28 16:10:28 JST 2017
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
54
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
55 stackからpopした後、呼び出される continuation は出力を受けとる。
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
56 出力を受けとる stub を生成する必要がある。
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
57 なので、CodeGear が、そのような interface で定義されたものかどうかを調べる必要がある。
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
58 Stackのnext(やisEmpty)に代入された時点でわかる。なので、あまり自明な見つける方法がない。
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
59 引数の異なるnextは異なる名前を持つべきか? 持たなくてもできるが...
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
60
264
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
61 goto next(data, ...); 引数で渡された continuation に移動
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
62 goto nodeStack->push(newNode, replaceNode1); Interface の呼び出し。(ここで replaceNode1 が stack の戻り値を受けることがわかる。
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
63 goto replaceNode(traverse, traverse->current, newNode); 普通のgoto
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
64 goto rotateTree->next(...); DataGearに格納された continuation
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
65
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
66 などをチェックする必要がある。これらの型チェックは CbC level では行われない。(CbCはmeta levelだから)
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
67
265
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
68 戻り値の部分は interface に記述させるという手もあるな。
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
69
264
cd6ea4c7f6a5 add Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 263
diff changeset
70
234
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
71 Sun Jan 22 20:11:28 JST 2017
263
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
72
234
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
73 TaskManagerから必要なCPUWorkerを生成する
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
74 WorkerはcreateWorker時に新しくthreadを作る
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
75
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
76 TaskManager->createTaskで新しいContextを生成する
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
77 この時点でWorkerを番号で指定する
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
78 このContextにGearefで値を設定していく
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
79 待ち合わせ用のDSを設定する
47588c28f189 TaskManager
mir3636
parents: 224
diff changeset
80 taskManager->spawnでWorkerにcontextを送る
263
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
81
224
578f283efb4a Add Todo
one
parents: 223
diff changeset
82 Fri Jan 13 17:47:40 JST 2017
263
18b43cdc8ee5 fix Todo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 234
diff changeset
83
224
578f283efb4a Add Todo
one
parents: 223
diff changeset
84 Task は contextを直接使うことにする
578f283efb4a Add Todo
one
parents: 223
diff changeset
85 DS には, まっているcontextをListを作る
578f283efb4a Add Todo
one
parents: 223
diff changeset
86 context に実行中断中のCS の番号をいれるフィールドを用意する
578f283efb4a Add Todo
one
parents: 223
diff changeset
87 待っているDS のcount
578f283efb4a Add Todo
one
parents: 223
diff changeset
88 createTaskの手順
578f283efb4a Add Todo
one
parents: 223
diff changeset
89 新しくcontextを作る
578f283efb4a Add Todo
one
parents: 223
diff changeset
90 allocate 用のheap も用意
578f283efb4a Add Todo
one
parents: 223
diff changeset
91 もとのcontextを全部copyする or 必要なものだけcopyする
578f283efb4a Add Todo
one
parents: 223
diff changeset
92 待ち合わせのDS群を指定する
578f283efb4a Add Todo
one
parents: 223
diff changeset
93 終わったあとの行き先を指定する(default は task_exit)
578f283efb4a Add Todo
one
parents: 223
diff changeset
94 exception の行き先も必要な指定する
578f283efb4a Add Todo
one
parents: 223
diff changeset
95 待っているDSが全部揃っていたら active Queueに入れる
578f283efb4a Add Todo
one
parents: 223
diff changeset
96 task の実行
578f283efb4a Add Todo
one
parents: 223
diff changeset
97 taskの実行後、 goto meta する直前で code gear commit を呼んで, Reader list を消化する
578f283efb4a Add Todo
one
parents: 223
diff changeset
98 複数から参照されるDSは一旦localに書き出して, その後atomic に書き出す
578f283efb4a Add Todo
one
parents: 223
diff changeset
99 複数から参照されるDSは何かしら宣言が必要
578f283efb4a Add Todo
one
parents: 223
diff changeset
100 つまり DS には 一つ一つ owner がいる
578f283efb4a Add Todo
one
parents: 223
diff changeset
101
175
00107b452a04 add Todo
mir3636
parents:
diff changeset
102 Mon Nov 28 17:39:39 JST 2016
00107b452a04 add Todo
mir3636
parents:
diff changeset
103
00107b452a04 add Todo
mir3636
parents:
diff changeset
104 Task,TaskManager,Workerのインターフェースの実装を作成する
00107b452a04 add Todo
mir3636
parents:
diff changeset
105 Taskを一旦Treeに入れずに直接Queueに入れる
00107b452a04 add Todo
mir3636
parents:
diff changeset
106
00107b452a04 add Todo
mir3636
parents:
diff changeset
107 Task
00107b452a04 add Todo
mir3636
parents:
diff changeset
108 CodeGen
223
8d2519c3a36e Add input data gear example
one
parents: 175
diff changeset
109 IDataSeg
8d2519c3a36e Add input data gear example
one
parents: 175
diff changeset
110 IDataSeg
8d2519c3a36e Add input data gear example
one
parents: 175
diff changeset
111 ...
175
00107b452a04 add Todo
mir3636
parents:
diff changeset
112 idsCount
223
8d2519c3a36e Add input data gear example
one
parents: 175
diff changeset
113 nextTask(can be C_exit)
8d2519c3a36e Add input data gear example
one
parents: 175
diff changeset
114 ODataSeg?
175
00107b452a04 add Todo
mir3636
parents:
diff changeset
115
00107b452a04 add Todo
mir3636
parents:
diff changeset
116 TaskManager
00107b452a04 add Todo
mir3636
parents:
diff changeset
117 createWorker
00107b452a04 add Todo
mir3636
parents:
diff changeset
118 spawn (any,cpu,GPU)
00107b452a04 add Todo
mir3636
parents:
diff changeset
119 taskSend
00107b452a04 add Todo
mir3636
parents:
diff changeset
120 activeQueue
00107b452a04 add Todo
mir3636
parents:
diff changeset
121 shutdown
00107b452a04 add Todo
mir3636
parents:
diff changeset
122 deadlockDetectid
00107b452a04 add Todo
mir3636
parents:
diff changeset
123
00107b452a04 add Todo
mir3636
parents:
diff changeset
124 SynchronizedQueue * Workerの数だけ
00107b452a04 add Todo
mir3636
parents:
diff changeset
125
00107b452a04 add Todo
mir3636
parents:
diff changeset
126 Worker
00107b452a04 add Todo
mir3636
parents:
diff changeset
127 execute
00107b452a04 add Todo
mir3636
parents:
diff changeset
128 taskRecive
00107b452a04 add Todo
mir3636
parents:
diff changeset
129 shutdown