changeset 1783:803dfdd1c741 draft

minor change
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 29 Nov 2013 13:54:12 +0900
parents 7245548995a8
children a9ff87220a68
files example/word_count/main.cc
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/example/word_count/main.cc	Tue Nov 26 18:57:06 2013 +0900
+++ b/example/word_count/main.cc	Fri Nov 29 13:54:12 2013 +0900
@@ -75,7 +75,7 @@
     st_mmap.size = fix_byte(sb.st_size,4096);
 
     printf("fix 4096byte file size %d\n",(int)st_mmap.size);
-
+    
     st_mmap.file_mmap = (char*)mmap(NULL,st_mmap.size,PROT_READ,map,fd,(off_t)0);
     if (st_mmap.file_mmap == (caddr_t)-1) {
         fprintf(stderr,"Can't mmap file\n");
@@ -115,11 +115,9 @@
         for (int j = 0; j < array_task_num; j++) {
             int i = w->task_spwaned++;
             if (w->size < size) size = w->size;
-            int length = size/sizeof(char);
             if (size==0) break;
             if (use_task_array) {
                 t_exec = task_array->next_task_array(TASK_EXEC,t_exec);
-                t_exec->set_param(0,&length);
                 t_exec->set_inData(0,w->file_mmap + i*w->division_size, size);
                 t_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size);
             } else if (use_compat) {
@@ -135,7 +133,6 @@
                 h_exec = manager->create_task(TASK_EXEC,
                                               (memaddr)(w->file_mmap + i*w->division_size), size,
                                               (memaddr)(w->o_data + i*w->out_size), w->division_out_size);
-                h_exec->set_param(0,&length);
                 t_next->wait_for(h_exec);
                 h_exec->set_cpu(spe_cpu);
                 h_exec->spawn();
@@ -249,16 +246,16 @@
     t_print = manager->create_task(TASK_PRINT,
                                    (memaddr)&w->self,sizeof(memaddr),0,0);
     w->t_print = t_print;
-
-    // for(int i = 0;i<4;i++) {
-    //     /* Task を task_blocks ずつ起動する Task */
-    //     /* serialize されていると仮定する... */
-    HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS,
+    
+    for(int i = 0;i<4;i++) {
+        /* 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->iterate(4);
-    //     t_exec->spawn();
-    // }
+        t_print->wait_for(t_exec);
+        //t_exec->iterate(4);
+        t_exec->spawn();
+    }
     t_print->spawn();
 }