Mercurial > hg > Game > Cerium
changeset 1859:3ddcd27d4dc2 draft
recover t_print->wait_for(t_exec) & change *fd to fd in ppe/Read.cc
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 23 Dec 2013 00:02:53 +0900 |
parents | 45139c74dad1 |
children | d250caefe0ff |
files | example/regex_mas/main.cc example/regex_mas/ppe/Read.cc |
diffstat | 2 files changed, 9 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Sun Dec 22 23:25:46 2013 +0900 +++ b/example/regex_mas/main.cc Mon Dec 23 00:02:53 2013 +0900 @@ -132,6 +132,7 @@ fr->fd = fd; fr->cpu = spe_cpu; fr->task_blocks = 16; + fr->task_number = 0; fr->filesize = sb.st_size; fr->left_size = fr->filesize; fr->division_size = 1024 * division; @@ -140,7 +141,7 @@ //HTaskPtr run = manager->create_task(RUN_READ_BLOCKS, (memaddr)&fr->self, sizeof(memaddr),0,0); run = manager->create_task(RUN_READ_BLOCKS, (memaddr)&fr->self, sizeof(memaddr),0,0); - //run->spawn(); + run->spawn(); st_mmap.file_mmap = fr->read_text; @@ -366,18 +367,15 @@ (memaddr)&w->self,sizeof(memaddr),0,0); w->t_print = t_print; - // for(int i = 0;i<2;i++) { - /* Task を task_blocks ずつ起動する Task */ - /* serialize されていると仮定する... */ + /* Task を task_blocks ずつ起動する Task */ + /* serialize されていると仮定する... */ HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS, (memaddr)&w->self,sizeof(memaddr),0,0); - //t_print->wait_for(t_exec); - //t_exec->wait_for(run); - //run->spawn(); + + t_exec->wait_for(run); + t_print->wait_for(t_exec); t_exec->iterate(2); - // t_exec->spawn(); - // } t_print->spawn(); }
--- a/example/regex_mas/ppe/Read.cc Sun Dec 22 23:25:46 2013 +0900 +++ b/example/regex_mas/ppe/Read.cc Mon Dec 23 00:02:53 2013 +0900 @@ -16,7 +16,7 @@ static int task_read(SchedTask *s, void *rbuf, void *wbuf) { - int *fd = (int *)s->get_input(rbuf,0); ///ファイルディスクリプタの受取 + long fd = (long)s->get_input(rbuf,0); ///ファイルディスクリプタの受取 long task_number = (long)s->get_param(0); //何番目のtaskか long division_size = (long)s->get_param(1); @@ -28,7 +28,7 @@ //char text[(long)read_size]; text[(long)read_size + 1] = '\0'; - pread(*fd, text, (long)read_size , division_size*task_number); + pread(fd, text, (long)read_size , division_size*task_number); readtext = text;