Mercurial > hg > Game > Cerium
annotate example/regex_mas/main.cc @ 1680:e44e5a18392c draft
fix regex_mas.
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 06 Aug 2013 05:00:04 +0900 |
parents | 342c36d5582e |
children | 7bc7780e8ece |
rev | line source |
---|---|
1598 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 #include <sys/mman.h> | |
5 #include <sys/types.h> | |
6 #include <sys/stat.h> | |
7 #include <fcntl.h> | |
8 #include <unistd.h> | |
9 #include <sys/time.h> | |
10 #include "TaskManager.h" | |
11 #include "SchedTask.h" | |
12 #include "Func.h" | |
13 #include "WordCount.h" | |
14 | |
1680
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
15 #define EXTRA_LENGTH 4 //多く取ってくる文字数(search word length - 1) |
1630 | 16 |
1598 | 17 /* ;TODO |
18 * PS3でCPU数が2以上の時に、あまりが計算されてない | |
19 */ | |
20 | |
21 extern void task_init(); | |
22 void TMend(TaskManager *); | |
1645
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
23 static double st_time; |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
24 static double ed_time; |
1598 | 25 int all = 0; |
26 int use_task_array = 1; | |
27 int use_task_creater = 0; | |
28 int use_compat = 0; | |
29 int array_task_num = 8; | |
30 int spe_num = 1; | |
1662 | 31 unsigned char *search_word; |
1598 | 32 CPU_TYPE spe_cpu = SPE_ANY; |
33 const char *usr_help_str = "Usage: ./word_count [-a -c -s] [-cpu spe_num] [-file filename]\n"; | |
34 | |
1645
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
35 static double |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
36 getTime() { |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
37 struct timeval tv; |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
38 gettimeofday(&tv, NULL); |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
39 return tv.tv_sec + (double)tv.tv_usec*1e-6; |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
40 } |
1598 | 41 |
42 typedef struct { | |
43 caddr_t file_mmap; | |
44 off_t size; | |
45 } st_mmap_t; | |
46 | |
47 static void simple_task_creater(int in_total_size, int out_total_size, | |
48 int command, int in_data_size, int out_data_size, | |
49 void *in_data, void *out_data, SchedTask *manager, | |
50 HTask *wait_i, HTask *wait_me) { | |
51 int in_task_size = 0; | |
52 int out_task_size = 0; | |
53 | |
54 if (in_total_size != 0) { | |
55 in_task_size = in_total_size / in_data_size; | |
56 if (in_total_size != in_task_size * in_data_size) { | |
57 printf("mismatch of in_total_size and in_data_size\n"); | |
58 } | |
59 } | |
60 | |
61 if (out_total_size != 0) { | |
62 out_task_size = out_total_size / out_data_size; | |
63 if (out_total_size != out_task_size * out_data_size) { | |
64 printf("mismatch of out_total_size and out_data_size\n"); | |
65 } | |
66 } | |
67 | |
68 /*in, out の大きい方に合わせるのがいいかな? Taskの数は1Task分に使うデータの大きいほうを取るような仕様がいいかな*/ | |
69 int task_num = (in_task_size > out_task_size) ? in_task_size : out_task_size; | |
70 | |
71 if (task_num == 0) task_num = 1; | |
72 | |
73 /*spe分あればいいのかな?*/ | |
74 | |
75 int array_num = spe_num; | |
76 if (task_num < array_num) { | |
77 array_num = task_num; | |
78 } | |
79 | |
80 | |
81 HTaskPtr *task_array = (HTask**)manager->allocate(sizeof(HTask*)*array_num); | |
82 TaskPtr *t_exec = (Task**)manager->allocate(sizeof(Task*)*array_num); | |
83 | |
84 int array_length = task_num / array_num; | |
85 int rest = task_num % array_num; | |
86 | |
87 int index = 0; | |
88 | |
89 for (int k = 0; k < array_num; k++) { | |
90 | |
91 task_array[k] = manager->create_task_array(command,array_length,0,1,1); | |
92 t_exec[k] = 0; | |
93 | |
94 if (wait_me != 0) { | |
95 wait_me->wait_for(task_array[k]); | |
96 } | |
97 if (wait_i != 0) { | |
98 task_array[k]->wait_for(wait_i); | |
99 } | |
100 | |
101 } | |
102 | |
103 int length = in_data_size/sizeof(char); | |
104 for (int j = 0; j < array_length; j++) { | |
105 for (int k = 0; k < array_num; k++) { | |
106 | |
107 t_exec[k] = task_array[k]->next_task_array(command,t_exec[k]); | |
108 t_exec[k]->set_param(0,(memaddr)length); | |
109 t_exec[k]->set_inData(0,(char*)in_data + index*in_data_size, in_data_size); | |
110 t_exec[k]->set_outData(0,(char*)out_data + index*out_data_size, out_data_size); | |
111 index++; | |
112 | |
113 } | |
114 } | |
115 | |
116 for (int k = 0; k < array_num; k++) { | |
117 task_array[k]->spawn_task_array(t_exec[k]->next()); | |
118 task_array[k]->set_cpu(spe_cpu); | |
119 task_array[k]->spawn(); | |
120 } | |
121 | |
122 for (int k = 0; k < rest; k++) { | |
123 HTaskPtr t_exec = manager->create_task(command); | |
124 t_exec->set_param(0,(memaddr)length); | |
1610 | 125 int offset = length*k; |
126 t_exec->set_param(1,(memaddr)offset); | |
1598 | 127 t_exec->set_inData(0,(char*)in_data + index*in_data_size, in_data_size); |
128 t_exec->set_outData(0,(char*)out_data + index*out_data_size, out_data_size); | |
129 | |
130 index++; | |
131 | |
132 if (wait_me != 0) { | |
133 wait_me->wait_for(t_exec); | |
134 } | |
135 if (wait_i != 0) { | |
136 t_exec->wait_for(wait_i); | |
137 } | |
138 | |
139 t_exec->set_cpu(spe_cpu); | |
140 t_exec->spawn(); | |
141 | |
142 } | |
143 | |
144 | |
145 } | |
146 | |
147 | |
148 /*与えられたsizeをfix_byte_sizeの倍数にする(丸め込むっていうのかな?)*/ | |
149 static int | |
150 fix_byte(int size,int fix_byte_size) | |
151 { | |
152 size = (size/fix_byte_size)*fix_byte_size + ((size%fix_byte_size)!= 0)*fix_byte_size; | |
153 | |
154 return size; | |
155 } | |
156 | |
157 | |
158 static st_mmap_t | |
159 my_mmap(char *filename) | |
160 { | |
161 | |
162 /*マッピングだよ!*/ | |
163 int fd = -1; | |
164 int map = MAP_PRIVATE; | |
165 st_mmap_t st_mmap; | |
166 struct stat sb; | |
167 | |
168 if ((fd=open(filename,O_RDONLY,0666))==0) { | |
169 fprintf(stderr,"can't open %s\n",filename); | |
170 } | |
171 | |
172 if (fstat(fd,&sb)) { | |
173 fprintf(stderr,"can't fstat %s\n",filename); | |
174 } | |
175 | |
176 /*sizeをページングサイズの倍数にあわせる*/ | |
1647 | 177 st_mmap.size = fix_byte(sb.st_size,4096); |
1598 | 178 |
179 st_mmap.file_mmap = (char*)mmap(NULL,st_mmap.size,PROT_READ,map,fd,(off_t)0); | |
180 if (st_mmap.file_mmap == (caddr_t)-1) { | |
181 fprintf(stderr,"Can't mmap file\n"); | |
182 perror(NULL); | |
183 exit(0); | |
184 } | |
185 | |
186 return st_mmap; | |
187 | |
188 } | |
189 | |
190 static void | |
191 run_tasks(SchedTask *manager, WordCount *w, int task_count, HTaskPtr t_next, int size) | |
192 { | |
193 | |
194 if (task_count < array_task_num) { | |
195 array_task_num = task_count; | |
196 if (task_count<=0) return; | |
197 } | |
198 | |
199 if (use_task_creater) { | |
200 simple_task_creater(w->file_size, w->division_out_size * w->task_num, TASK_EXEC, w->division_size, w->division_out_size, | |
201 w->file_mmap, w->o_data, manager, w->t_print, 0); | |
202 } | |
203 | |
204 if (use_task_array) { | |
205 | |
206 int spl = spe_num * array_task_num; | |
207 int loop = (task_count + spl - 1) / spl; | |
208 | |
209 for (int i = 0; i < loop; i += 1) { | |
210 | |
1676 | 211 if (w->task_num < spe_num) spe_num = w->task_num; |
1598 | 212 |
213 // ここから | |
214 HTask **task_array = (HTask**)manager->allocate(sizeof(HTask*)*spe_num); | |
215 Task **t_exec = (Task**)manager->allocate(sizeof(Task*)*spe_num); | |
216 | |
217 for (int k = 0; k < spe_num; k++) { | |
218 task_array[k] = manager->create_task_array(TASK_EXEC,array_task_num,1,1,1); | |
219 t_exec[k] = 0; | |
220 if (all) { | |
221 w->t_print->wait_for(task_array[k]); | |
222 } else { | |
223 t_next->wait_for(task_array[k]); | |
224 } | |
225 } | |
226 | |
227 for (int j = 0; j < array_task_num; j++) { | |
228 for (int k = 0; k < spe_num; k++) { | |
229 | |
230 int a = w->task_spwaned++; | |
231 | |
232 if (w->size < size) size = w->size; | |
1680
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
233 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
234 int set_one_task_length = size/sizeof(char); |
1634
c0841aa109a8
add number of match position.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1630
diff
changeset
|
235 const int ONE_TASK_LENGTH = w->division_size; |
c0841aa109a8
add number of match position.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1630
diff
changeset
|
236 const int ONE_LOOP_LENGTH = array_task_num*spe_num*ONE_TASK_LENGTH; |
c0841aa109a8
add number of match position.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1630
diff
changeset
|
237 const int ARRAY_LENGTH_SIZE = spe_num * ONE_TASK_LENGTH; |
c0841aa109a8
add number of match position.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1630
diff
changeset
|
238 int offset = ONE_LOOP_LENGTH * i + ARRAY_LENGTH_SIZE*j + ONE_TASK_LENGTH*k; |
1680
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
239 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
240 t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]); |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
241 t_exec[k]->set_param(0,(memaddr)offset); |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
242 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
243 /*set_inDataで多めに文字を取ってきているが、 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
244 *Exec.ccに文字列検索をさせるときにはset_param(1)で |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
245 *設定した文字列しか検索してくれないようになっている。 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
246 */ |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
247 if(size != w->size){ //最後のタスクかどうかの判定 |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
248 t_exec[k]->set_param(1,(memaddr)set_one_task_length + EXTRA_LENGTH); |
1662 | 249 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH); |
1647 | 250 }else{ |
1680
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
251 t_exec[k]->set_param(1,(memaddr)set_one_task_length); |
1662 | 252 t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size); |
1647 | 253 } |
1662 | 254 t_exec[k]->set_outData(0,w->o_data + a*w->out_size, w->division_out_size); |
255 | |
1598 | 256 w->size -= size; |
257 w->task_num--; | |
258 } | |
259 } | |
260 for (int k = 0; k < spe_num; k++) { | |
261 task_array[k]->spawn_task_array(t_exec[k]->next()); | |
262 task_array[k]->set_cpu(spe_cpu); | |
263 task_array[k]->spawn(); | |
264 } | |
265 | |
266 } | |
267 | |
268 return; | |
269 | |
270 } | |
271 | |
272 for (int i = 0; i < task_count; i += array_task_num) { | |
273 | |
274 HTask *h_exec = 0; | |
275 for (int j = 0; j < array_task_num; j++) { | |
276 int i = w->task_spwaned++; | |
277 if (w->size < size) size = w->size; | |
278 int length = size/sizeof(char); | |
279 if (size==0) break; | |
280 | |
281 if (use_compat) { | |
282 h_exec = manager->create_task(TASK_EXEC); | |
283 h_exec->set_param(0,(memaddr)length); | |
284 h_exec->set_inData(0,w->file_mmap + i*w->division_size, size); | |
285 h_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size); | |
286 | |
287 | |
288 if (all) { | |
289 w->t_print->wait_for(h_exec); | |
290 } else { | |
291 t_next->wait_for(h_exec); | |
292 } | |
293 | |
294 h_exec->set_cpu(spe_cpu); | |
295 h_exec->spawn(); | |
296 | |
297 } else { | |
298 h_exec = manager->create_task(TASK_EXEC, | |
299 (memaddr)(w->file_mmap + i*w->division_size), size, | |
300 (memaddr)(w->o_data + i*w->out_size), w->division_out_size); | |
301 | |
302 if (all) { | |
303 w->t_print->wait_for(h_exec); | |
304 } else { | |
305 t_next->wait_for(h_exec); | |
306 } | |
307 | |
308 h_exec->set_cpu(spe_cpu); | |
309 h_exec->spawn(); | |
310 } | |
311 w->size -= size; | |
312 w->task_num--; | |
313 } | |
314 | |
315 } | |
316 | |
317 } | |
318 | |
319 /** | |
320 * このTaskは、PPE上で実行されるので、並列に実行されることはない | |
321 * 二つ実行されていて、Task が足りなくなることがないようにしている。 | |
322 */ | |
323 | |
324 SchedDefineTask1(RUN_TASK_BLOCKS,run16); | |
325 | |
326 static int | |
327 run16(SchedTask *manager, void *in, void *out) | |
328 { | |
329 WordCount *w = *(WordCount **)in; | |
330 | |
331 if (w->task_num < w->task_blocks) { | |
332 // last case | |
333 while (w->size >= w->division_size) | |
334 run_tasks(manager,w,w->task_num, w->t_print, w->division_size); | |
335 // remaining data | |
336 while (w->size>0) | |
337 run_tasks(manager,w,1, w->t_print, w->size); | |
338 // printf("run16 last %d\n",w->task_num); | |
339 } else { | |
340 HTaskPtr t_next = manager->create_task(RUN_TASK_BLOCKS, | |
341 (memaddr)&w->self,sizeof(memaddr),0,0); | |
342 w->t_print->wait_for(t_next); | |
343 | |
344 run_tasks(manager,w, w->task_blocks, t_next, w->division_size); | |
345 | |
346 t_next->spawn(); | |
347 // printf("run16 next %d\n",w->task_num); | |
348 } | |
349 return 0; | |
350 } | |
351 | |
352 | |
353 static int blocks = 48; | |
354 //static int blocks = 31 * 6 * 24; | |
355 static int division = 16; // in Kbyte | |
356 | |
357 static void | |
358 run_start(TaskManager *manager, char *filename) | |
359 { | |
360 HTaskPtr t_print; | |
361 | |
362 st_mmap_t st_mmap; | |
363 st_mmap = my_mmap(filename); | |
364 WordCount *w = (WordCount*)manager->allocate(sizeof(WordCount)); | |
365 // bzero(w,sizeof(WordCount)); | |
366 | |
367 //w->task_blocks = blocks; | |
368 w->self = w; | |
369 w->task_spwaned = 0; | |
370 | |
371 /*sizeはdivision_sizeの倍数にしている。*/ | |
372 w->size = w->file_size = st_mmap.size; | |
373 w->file_mmap = st_mmap.file_mmap; | |
374 /* 1task分のデータサイズ(byte) */ | |
375 if (w->size >= 1024*division) { | |
376 w->division_size = 1024 * division;/*16kbyte*/ | |
377 } else { | |
378 w->division_size = w->size; | |
379 } | |
380 | |
1680
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
381 /* exec output only "match_num" */ |
e44e5a18392c
fix regex_mas.
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1676
diff
changeset
|
382 w->status_num = 1; |
1598 | 383 /* taskの数 */ |
384 w->task_num = w->size / w->division_size; | |
385 w->task_num = w->task_num + (w->division_size*w->task_num < w->size); | |
386 int out_task_num = w->task_num; | |
387 | |
388 if(!all) { | |
389 w->task_blocks = blocks; | |
390 } else { | |
391 w->task_blocks = w->task_num; | |
392 } | |
393 | |
394 w->out_task_num = out_task_num; | |
395 | |
396 /* out用のdivision_size. statusが2つなので、あわせて16byteになるように、long long(4byte)を使用 */ | |
397 | |
1660
8b50b1ee068e
change result position to match_num.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1655
diff
changeset
|
398 w->division_out_size = sizeof(unsigned long long)*1; |
1598 | 399 int out_size = w->division_out_size*out_task_num; |
400 w->o_data = (unsigned long long *)manager->allocate(out_size); | |
1660
8b50b1ee068e
change result position to match_num.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1655
diff
changeset
|
401 w->out_size = 1; |
1598 | 402 |
403 /*各SPEの結果を合計して出力するタスク*/ | |
404 | |
405 t_print = manager->create_task(TASK_PRINT, | |
406 (memaddr)&w->self,sizeof(memaddr),0,0); | |
407 w->t_print = t_print; | |
408 | |
409 for(int i = 0;i<20;i++) { | |
410 /* Task を task_blocks ずつ起動する Task */ | |
411 /* serialize されていると仮定する... */ | |
412 HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS, | |
413 (memaddr)&w->self,sizeof(memaddr),0,0); | |
414 t_print->wait_for(t_exec); | |
415 t_exec->spawn(); | |
416 } | |
417 | |
418 t_print->spawn(); | |
419 } | |
420 | |
421 static char* | |
422 init(int argc, char **argv) | |
423 { | |
424 | |
425 char *filename = 0; | |
426 | |
427 for (int i = 1; argv[i]; ++i) { | |
428 if (strcmp(argv[i], "-file") == 0) { | |
429 filename = argv[i+1]; | |
430 } else if (strcmp(argv[i], "-division") == 0) { | |
431 division = atoi(argv[i+1]); | |
432 } else if (strcmp(argv[i], "-block") == 0) { | |
433 blocks = atoi(argv[i+1]); | |
434 } else if (strcmp(argv[i], "-a") == 0) { | |
435 // create task all at once | |
436 all = 1; | |
437 } else if (strcmp(argv[i], "-c") == 0) { | |
438 use_task_array = 0; | |
439 use_compat = 1; | |
440 } else if (strcmp(argv[i], "-s") == 0) { | |
441 use_task_array = 0; | |
442 use_compat = 0; | |
443 } else if (strcmp(argv[i], "-t") == 0) { | |
444 use_task_creater = 1; | |
445 use_task_array = 0; | |
446 use_compat = 0; | |
447 } else if (strcmp(argv[i], "-anum") == 0) { | |
448 array_task_num = atoi(argv[i+1]); | |
449 } else if (strcmp(argv[i], "-g") == 0 ) { | |
450 spe_cpu = GPU_0; | |
451 } else if (strcmp(argv[i], "-cpu") == 0) { | |
452 spe_num = atoi(argv[i+1]); | |
453 if (spe_num==0) spe_num = 1; | |
1645
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
454 } else if (strcmp(argv[i], "-sw") == 0) { |
1651 | 455 search_word = (unsigned char*)argv[i+1]; |
1598 | 456 } |
457 } | |
458 if (filename==0) { | |
459 puts(usr_help_str); | |
460 exit(1); | |
461 } | |
462 | |
463 return filename; | |
464 } | |
465 | |
466 | |
467 int | |
468 TMmain(TaskManager *manager, int argc, char *argv[]) | |
469 { | |
470 | |
471 char *filename = 0; | |
472 filename = init(argc, argv); | |
473 | |
474 if (filename < 0) { | |
475 return -1; | |
476 } | |
477 | |
478 task_init(); | |
479 run_start(manager, filename); | |
1645
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
480 st_time = getTime(); |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
481 manager->set_TMend(TMend); |
1598 | 482 return 0; |
483 } | |
484 | |
1645
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
485 void |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
486 TMend(TaskManager *manager) |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
487 { |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
488 ed_time = getTime(); |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
489 printf("Time: %0.6f\n",ed_time-st_time); |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
490 } |
4698c92bf2ca
Regex_mas implement time measurement.
Masa <e085726@ie.u-ryukyu.ac.jp>
parents:
1642
diff
changeset
|
491 |
1662 | 492 /* end */ |