Mercurial > hg > Game > Cerium
annotate example/word_count/main.cc @ 1727:e99dc86d39e2 draft
minor fix
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 30 Oct 2013 19:05:38 +0900 |
parents | 1755ae347fce |
children | 6bd9a57eb44d |
rev | line source |
---|---|
1584 | 1 #include <stdio.h> |
393 | 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> | |
1544
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
9 #include <sys/time.h> |
393 | 10 #include "TaskManager.h" |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
11 #include "SchedTask.h" |
393 | 12 #include "Func.h" |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
13 #include "WordCount.h" |
393 | 14 |
1268 | 15 /* ;TODO |
16 * PS3でCPU数が2以上の時に、あまりが計算されてない | |
17 */ | |
18 | |
400 | 19 extern void task_init(); |
1544
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
20 void TMend(TaskManager *); |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
21 static double st_time; |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
22 static double ed_time; |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
23 int all = 0; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
24 int use_task_array = 1; |
1039
e8ef7f5f22f6
add TaskCreater test funciton..
yutaka@localhost.localdomain
parents:
1021
diff
changeset
|
25 int use_task_creater = 0; |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
26 int use_compat = 0; |
967
daab1b74b32d
add anum option in WordCount
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
950
diff
changeset
|
27 int array_task_num = 8; |
970
1a4849b2acad
change pipeline and TaskArray fast
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents:
968
diff
changeset
|
28 int spe_num = 1; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
29 CPU_TYPE spe_cpu = SPE_ANY; |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
30 const char *usr_help_str = "Usage: ./word_count [-a -c -s] [-cpu spe_num] [-g] [-file filename]\n"; |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
31 |
1544
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
32 static double |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
33 getTime() { |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
34 struct timeval tv; |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
35 gettimeofday(&tv, NULL); |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
36 return tv.tv_sec + (double)tv.tv_usec*1e-6; |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
37 } |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
38 |
393 | 39 typedef struct { |
40 caddr_t file_mmap; | |
41 off_t size; | |
42 } st_mmap_t; | |
43 | |
44 /*与えられたsizeをfix_byte_sizeの倍数にする(丸め込むっていうのかな?)*/ | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
45 static int |
393 | 46 fix_byte(int size,int fix_byte_size) |
47 { | |
48 size = (size/fix_byte_size)*fix_byte_size + ((size%fix_byte_size)!= 0)*fix_byte_size; | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
49 |
393 | 50 return size; |
51 } | |
52 | |
53 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
54 static st_mmap_t |
393 | 55 my_mmap(char *filename) |
56 { | |
57 | |
58 /*マッピングだよ!*/ | |
59 int fd = -1; | |
60 int map = MAP_PRIVATE; | |
61 st_mmap_t st_mmap; | |
62 struct stat sb; | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
63 |
393 | 64 if ((fd=open(filename,O_RDONLY,0666))==0) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
65 fprintf(stderr,"can't open %s\n",filename); |
393 | 66 } |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
67 |
393 | 68 if (fstat(fd,&sb)) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
69 fprintf(stderr,"can't fstat %s\n",filename); |
393 | 70 } |
71 | |
72 printf("file size %d\n",(int)sb.st_size); | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
73 |
393 | 74 /*sizeをページングサイズの倍数にあわせる*/ |
75 st_mmap.size = fix_byte(sb.st_size,4096); | |
76 | |
394 | 77 printf("fix 4096byte file size %d\n",(int)st_mmap.size); |
393 | 78 |
79 st_mmap.file_mmap = (char*)mmap(NULL,st_mmap.size,PROT_READ,map,fd,(off_t)0); | |
80 if (st_mmap.file_mmap == (caddr_t)-1) { | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
81 fprintf(stderr,"Can't mmap file\n"); |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
82 perror(NULL); |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
83 exit(0); |
393 | 84 } |
85 | |
86 return st_mmap; | |
87 | |
88 } | |
89 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
90 static void |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
91 run_tasks(SchedTask *manager, WordCount *w, int task_count, HTaskPtr t_next, int size) |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
92 { |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
93 |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
94 if (task_count < array_task_num) { |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
95 array_task_num = task_count; |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
96 if (task_count<=0) return; |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
97 } |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
98 |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
99 for (int i = 0; i < task_count; i += array_task_num) { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
100 |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
101 HTask *task_array; |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
102 if (use_task_array) { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
103 int task_num = (w->size+size-1)/size; |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
104 if (task_num>array_task_num) task_num = array_task_num; |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
105 task_array = manager->create_task_array(TASK_EXEC,task_num,0,1,1); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
106 if (!all) { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
107 t_next->wait_for(task_array); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
108 } else { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
109 w->t_print->wait_for(task_array); |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
110 } |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
111 } |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
112 |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
113 Task *t_exec = 0; |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
114 HTask *h_exec = 0; |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
115 for (int j = 0; j < array_task_num; j++) { |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
116 int i = w->task_spwaned++; |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
117 if (w->size < size) size = w->size; |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
118 int length = size/sizeof(char); |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
119 if (size==0) break; |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
120 if (use_task_array) { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
121 t_exec = task_array->next_task_array(TASK_EXEC,t_exec); |
1727 | 122 t_exec->set_param(0,&length); |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
123 t_exec->set_inData(0,w->file_mmap + i*w->division_size, size); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
124 t_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
125 } else if (use_compat) { |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
126 h_exec = manager->create_task(TASK_EXEC); |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
127 h_exec->set_inData(0,w->file_mmap + i*w->division_size, size); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
128 h_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size); |
1021 | 129 |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
130 t_next->wait_for(h_exec); |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
131 |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
132 h_exec->set_cpu(SPE_ANY); |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
133 h_exec->spawn(); |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
134 } else { |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
135 h_exec = manager->create_task(TASK_EXEC, |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
136 (memaddr)(w->file_mmap + i*w->division_size), size, |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
137 (memaddr)(w->o_data + i*w->out_size), w->division_out_size); |
1727 | 138 h_exec->set_param(0,&length); |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
139 t_next->wait_for(h_exec); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
140 h_exec->set_cpu(SPE_ANY); |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
141 h_exec->spawn(); |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
142 } |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
143 w->size -= size; |
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
144 w->task_num--; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
145 } |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
146 if (use_task_array) { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
147 task_array->spawn_task_array(t_exec->next()); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
148 task_array->set_cpu(SPE_ANY); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
149 task_array->spawn(); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
150 } else { |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
151 //if (!all) t_next->wait_for(h_exec); |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
152 } |
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
153 } |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
154 } |
393 | 155 |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
156 /** |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
157 * このTaskは、PPE上で実行されるので、並列に実行されることはない |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
158 * 二つ実行されていて、Task が足りなくなることがないようにしている。 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
159 */ |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
160 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
161 SchedDefineTask1(RUN_TASK_BLOCKS,run16); |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
162 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
163 static int |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
164 run16(SchedTask *manager, void *in, void *out) |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
165 { |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
166 WordCount *w = *(WordCount **)in; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
167 |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
168 if (w->task_num < w->task_blocks) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
169 // last case |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
170 while (w->size >= w->division_size) |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
171 run_tasks(manager,w,w->task_num, w->t_print, w->division_size); |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
172 // remaining data |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
173 while (w->size>0) |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
174 run_tasks(manager,w,1, w->t_print, w->size); |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
175 // printf("run16 last %d\n",w->task_num); |
949 | 176 } else { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
177 HTaskPtr t_next = manager->create_task(RUN_TASK_BLOCKS, |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
178 (memaddr)&w->self,sizeof(memaddr),0,0); |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
179 w->t_print->wait_for(t_next); |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
180 |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
181 run_tasks(manager,w, w->task_blocks, t_next, w->division_size); |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
182 |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
183 t_next->spawn(); |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
184 // printf("run16 next %d\n",w->task_num); |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
185 } |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
186 return 0; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
187 } |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
188 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
189 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
190 static int blocks = 48; |
1123 | 191 //static int blocks = 31 * 6 * 24; |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
192 static int division = 16; // in Kbyte |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
193 |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
194 static void |
400 | 195 run_start(TaskManager *manager, char *filename) |
393 | 196 { |
197 HTaskPtr t_print; | |
198 | |
199 st_mmap_t st_mmap; | |
200 st_mmap = my_mmap(filename); | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
201 WordCount *w = (WordCount*)manager->allocate(sizeof(WordCount)); |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
202 // bzero(w,sizeof(WordCount)); |
393 | 203 |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
204 //w->task_blocks = blocks; |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
205 w->self = w; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
206 w->task_spwaned = 0; |
393 | 207 |
208 /*sizeはdivision_sizeの倍数にしている。*/ | |
949 | 209 w->size = w->file_size = st_mmap.size; |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
210 w->file_mmap = st_mmap.file_mmap; |
949 | 211 printf("w %lx\n",(long)w); |
393 | 212 |
213 /* 1task分のデータサイズ(byte) */ | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
214 if (w->size >= 1024*division) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
215 w->division_size = 1024 * division;/*16kbyte*/ |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
216 } else { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
217 w->division_size = w->size; |
393 | 218 } |
219 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
220 printf("dvision_size %d\n",w->division_size); |
393 | 221 |
222 /* "word num" and "line num" */ | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
223 w->status_num = 2; |
393 | 224 /* taskの数 */ |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
225 w->task_num = w->size / w->division_size; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
226 w->task_num = w->task_num + (w->division_size*w->task_num < w->size); |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
227 int out_task_num = w->task_num; |
394 | 228 |
968 | 229 if(!all) { |
230 w->task_blocks = blocks; | |
231 } else { | |
232 w->task_blocks = w->task_num; | |
233 } | |
234 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
235 w->out_task_num = out_task_num; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
236 printf("task_num %d\n",w->task_num); |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
237 printf("out_task_num %d\n",w->out_task_num); |
394 | 238 |
1007 | 239 /* out用のdivision_size. statusが2つなので、あわせて16byteになるように、long long(4byte)を使用 */ |
393 | 240 |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
241 w->division_out_size = sizeof(unsigned long long)*4; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
242 int out_size = w->division_out_size*out_task_num; |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
243 w->o_data = (unsigned long long *)manager->allocate(out_size); |
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
244 w->out_size = 4; |
393 | 245 printf("out size %d\n",out_size); |
246 | |
247 /*各SPEの結果を合計して出力するタスク*/ | |
248 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
249 t_print = manager->create_task(TASK_PRINT, |
1542
9ccfdc408d51
fix gpu word count.but not count line num.
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1538
diff
changeset
|
250 (memaddr)&w->self,sizeof(memaddr),0,0); |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
251 w->t_print = t_print; |
783 | 252 |
1694
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
253 // for(int i = 0;i<4;i++) { |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
254 // /* Task を task_blocks ずつ起動する Task */ |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
255 // /* serialize されていると仮定する... */ |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
256 HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS, |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
257 (memaddr)&w->self,sizeof(memaddr),0,0); |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
258 t_print->wait_for(t_exec); |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
259 t_exec->iterate(4); |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
260 // t_exec->spawn(); |
1755ae347fce
use iterate for multiply
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1688
diff
changeset
|
261 // } |
393 | 262 t_print->spawn(); |
263 } | |
264 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
265 static char* |
393 | 266 init(int argc, char **argv) |
267 { | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
268 |
394 | 269 char *filename = 0; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
270 |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
271 for (int i = 1; argv[i]; ++i) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
272 if (strcmp(argv[i], "-file") == 0) { |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
273 filename = argv[i+1]; i++; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
274 } else if (strcmp(argv[i], "-division") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
275 division = atoi(argv[i+1]); |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
276 i++; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
277 } else if (strcmp(argv[i], "-block") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
278 blocks = atoi(argv[i+1]); |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
279 i++; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
280 } else if (strcmp(argv[i], "-a") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
281 // create task all at once |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
282 all = 1; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
283 } else if (strcmp(argv[i], "-c") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
284 use_task_array = 0; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
285 use_compat = 1; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
286 } else if (strcmp(argv[i], "-s") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
287 use_task_array = 0; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
288 use_compat = 0; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
289 } else if (strcmp(argv[i], "-t") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
290 use_task_creater = 1; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
291 use_task_array = 0; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
292 use_compat = 0; |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
293 } else if (strcmp(argv[i], "-anum") == 0) { |
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
294 array_task_num = atoi(argv[i+1]); |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
295 i++; |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
296 } /*else if (strcmp(argv[i], "-g") == 0 ) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
297 spe_cpu = GPU_0; |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
298 } else if (strcmp(argv[i], "-cpu") == 0) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
299 spe_num = atoi(argv[i+1]); |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
300 i++; |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
301 if (spe_num==0) spe_num = 1; |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
302 } else { |
1679
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
303 fprintf(stderr,"%s\n",usr_help_str); |
ff43dc274ec9
word_count fix for GPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1678
diff
changeset
|
304 exit (0); |
1688
705f09f646ac
remove spe_num roop
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1684
diff
changeset
|
305 }*/ |
393 | 306 } |
400 | 307 if (filename==0) { |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
308 puts(usr_help_str); |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
309 exit(1); |
400 | 310 } |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
311 |
393 | 312 return filename; |
313 } | |
314 | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
315 |
393 | 316 int |
400 | 317 TMmain(TaskManager *manager, int argc, char *argv[]) |
393 | 318 { |
319 | |
394 | 320 char *filename = 0; |
321 filename = init(argc, argv); | |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
322 |
393 | 323 if (filename < 0) { |
1538
fac06524090b
add gpu task wordcount. But not work print
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1351
diff
changeset
|
324 return -1; |
393 | 325 } |
326 | |
327 task_init(); | |
400 | 328 run_start(manager, filename); |
1544
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
329 st_time = getTime(); |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
330 manager->set_TMend(TMend); |
393 | 331 return 0; |
332 } | |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
333 |
1544
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
334 void |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
335 TMend(TaskManager *manager) |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
336 { |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
337 ed_time = getTime(); |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
338 printf("Time: %0.6f\n",ed_time-st_time); |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
339 } |
5c4e3f0d372a
many_task add task array
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
1542
diff
changeset
|
340 |
946
852ed17d8af1
unify word count examples....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
797
diff
changeset
|
341 /* end */ |