Mercurial > hg > Members > masakoha > masa
comparison Nov-2013/19th.html @ 0:c9b2998eb516
add slide
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 Dec 2013 15:25:07 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c9b2998eb516 |
---|---|
1 <!DOCTYPE html> | |
2 | |
3 <!-- | |
4 Google HTML5 slide template | |
5 | |
6 Authors: Luke Mahé (code) | |
7 Marcin Wichary (code and design) | |
8 | |
9 Dominic Mazzoni (browser compatibility) | |
10 Charles Chen (ChromeVox support) | |
11 | |
12 URL: http://code.google.com/p/html5slides/ | |
13 --> | |
14 | |
15 <html> | |
16 <head> | |
17 <title>2013-11-19</title> | |
18 | |
19 <meta charset='utf-8'> | |
20 <script | |
21 src='http://html5slides.googlecode.com/svn/trunk/slides.js'></script> | |
22 </head> | |
23 | |
24 <style> | |
25 /* Your individual styles here, or just use inline styles if that’s | |
26 what you want. */ | |
27 .slides article { background-image: none !important; background-color: white; } | |
28 | |
29 </style> | |
30 | |
31 <body style='display: none'> | |
32 | |
33 <section class='slides layout-regular template-default'> | |
34 | |
35 <!-- Your slides (<article>s) go here. Delete or comment out the | |
36 slides below.--> | |
37 | |
38 <article> | |
39 <h1> | |
40 Cerium Task Manager | |
41 <br> | |
42 による正規表現の実装 | |
43 </h1> | |
44 <p> | |
45 Masataka Kohagura | |
46 <br> | |
47 19th November , 2013 | |
48 </p> | |
49 </article> | |
50 | |
51 <article> | |
52 <h3> | |
53 研究目的 | |
54 </h3> | |
55 <p> | |
56 マルチコア CPU を最大限に活かすためには、並列プログラミングによる並列度を向上させなければならないが、実装が難しい。 | |
57 当研究室では Cerium Libraryを提供することによって並列プログラミングを容易にしているが、ファイル読み込み等のI/O部分に関してはまだ実装されていない。 | |
58 </p> | |
59 <p> | |
60 本研究ではその例題として正規表現を実装し、I/Oの並列化の設計・実装によって既存の正規表現の処理速度、処理効率を上げる。 | |
61 </p> | |
62 </article> | |
63 | |
64 <article> | |
65 <h3> | |
66 今週のしたこと | |
67 </h3> | |
68 <p> | |
69 ・検索文字列のハードコーディングの脱却<br> | |
70 (set_inData,get_input絡みでバグ??) | |
71 </p> | |
72 </article> | |
73 | |
74 <!-- | |
75 <article class='smaller'> | |
76 <h3>I/O並列化のシーケンス図(mmap)</h3> | |
77 <div align="center"> | |
78 <IMG SRC="mmap.png"> | |
79 </div> | |
80 <li> | |
81 codeがシンプル(readを書いて読み込まなくていいため) | |
82 </li> | |
83 <li> | |
84 memoryより大きなファイルは開けない | |
85 </li> | |
86 <li> | |
87 readの先読みがOS依存 | |
88 </li> | |
89 | |
90 </article> | |
91 --> | |
92 | |
93 | |
94 <article> | |
95 <h3> | |
96 WordCount.h | |
97 </h3> | |
98 <section><pre> | |
99 typedef struct wordCount { | |
100 struct wordCount *self; | |
101 int size; // remaining file size | |
102 int division_size; // for each word count task | |
103 (中略) | |
104 <font color="red"> unsigned char *search_word; | |
105 int search_word_len;</font> | |
106 HTaskPtr t_print; | |
107 } WordCount; | |
108 </pre></section> | |
109 </article> | |
110 | |
111 <article> | |
112 <h3> | |
113 main.cc(task生成部分) | |
114 </h3> | |
115 <section><pre> | |
116 run_tasks(SchedTask *manager,…) | |
117 { | |
118 … | |
119 if(size != w->size){ //最後のタスクかどうかの判定 | |
120 t_exec[k]->set_param(0,&set_one_task_length + EXTRA_LENGTH); | |
121 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH); | |
122 <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font> | |
123 }else{ | |
124 t_exec[k]->set_param(0,&set_one_task_length); | |
125 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size); | |
126 <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font> | |
127 } | |
128 … | |
129 } | |
130 </pre></section> | |
131 | |
132 </article> | |
133 | |
134 | |
135 <article> | |
136 <h3> | |
137 main.cc(task生成部分) | |
138 </h3> | |
139 <section><pre> | |
140 run_tasks(SchedTask *manager,…) | |
141 { | |
142 … | |
143 if(size != w->size){ //最後のタスクかどうかの判定 | |
144 t_exec[k]->set_param(0,&set_one_task_length + EXTRA_LENGTH); | |
145 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH); | |
146 <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font> | |
147 }else{ | |
148 t_exec[k]->set_param(0,&set_one_task_length); | |
149 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size); | |
150 <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font> | |
151 } | |
152 … | |
153 } | |
154 </pre></section> | |
155 | |
156 </article> | |
157 | |
158 <article> | |
159 <h3> | |
160 問題点 | |
161 </h3> | |
162 <li> | |
163 複数の文字列をタスクに渡そうとすると、最初に渡す文字列に関しては渡せるが、後に渡す文字列がうまく渡らない。 | |
164 </li> | |
165 <p>Exec.cc(get_input)</p> | |
166 <section><pre> | |
167 run(SchedTask *s, void *rbuf, void *wbuf) | |
168 { | |
169 unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0); | |
170 unsigned char *search_word = (unsigned char*)s->get_input(rbuf,1); | |
171 … | |
172 s->printf("[i_data]\n%s\n",i_data); | |
173 s->printf("[search_word]\n%s\n",search_word); | |
174 | |
175 return 0; | |
176 } | |
177 </pre></section> | |
178 | |
179 <p>result</p> | |
180 <section><pre> | |
181 (lldb) p i_data | |
182 (unsigned char *) $2 = 0x000000010202ca00 "aaa bbb …" | |
183 (lldb) p search_word | |
184 (unsigned char *) $3 = 0x000000010202ca00 "aaa bbb …" | |
185 </pre></section> | |
186 <li>文字列を複数受け取ろうとすると、index(1)のアドレスがindex(0)のアドレスと同じ場所を示す</li> | |
187 <li>この時のi_data sizeは8byte、search_word sizeは6Byteである。</li> | |
188 <li>i_data size = search_word sizeにしても同様</li> | |
189 | |
190 </article> | |
191 | |
192 </body> | |
193 </html> |