changeset 1866:7b3aa1a31c3a draft

fix ( cannot wait for run16 )
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Wed, 25 Dec 2013 02:13:28 +0900
parents a009522ed6c6
children 7706faa6b0c9 14225fec047c
files example/fileread/FileRead.h example/fileread/main.cc example/fileread/ppe/Print.cc
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/example/fileread/FileRead.h	Tue Dec 24 23:52:54 2013 +0900
+++ b/example/fileread/FileRead.h	Wed Dec 25 02:13:28 2013 +0900
@@ -5,9 +5,11 @@
    long division_size;
    long task_number;
    long task_num;
+   long left_task_num;
    long filesize;
    long left_size;
    int task_blocks;
    char *read_text;
    CPU_TYPE cpu;
+   HTaskPtr t_print;
 } FileRead, *FileReadPtr;
--- a/example/fileread/main.cc	Tue Dec 24 23:52:54 2013 +0900
+++ b/example/fileread/main.cc	Wed Dec 25 02:13:28 2013 +0900
@@ -43,7 +43,6 @@
 
         if (i == fr->task_blocks / 2) wait = read;
 
-
         read->set_param(0,(long)fr->task_number);  //生成するTaskが何番目か
         read->set_param(1,(long)fr->division_size);  //1つのタスクが読み込む量
         if(fr->left_size <= fr->division_size){
@@ -120,7 +119,7 @@
 
     int fd = fr->fd;
     st_mmap.size = fr->filesize;
-    out = mmap(NULL,st_mmap.size,PROT_READ,map,fd,(off_t)0);
+    fr->read_text = (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");
 
@@ -128,9 +127,7 @@
         exit(0);
     }
 
-    //printf("%s\n",out);
-    printf("in mmap\n");
-
+    printf("in mmap mode\n");
     return 0;
 }
 
@@ -172,7 +169,7 @@
         run = manager->create_task(RUN_BLOCKS, (memaddr)&fr->self, sizeof(memaddr),fr->read_text,fr->filesize);
     }else {
         //my_mmap(filename, fd, fr);
-        run = manager->create_task(MMAP , (memaddr)&fr->self, sizeof(memaddr),fr->read_text,fr->filesize);
+        run = manager->create_task(MMAP , (memaddr)&fr->self, sizeof(memaddr),0,0);
     }
     t_print->wait_for(run);
     run->spawn();
--- a/example/fileread/ppe/Print.cc	Tue Dec 24 23:52:54 2013 +0900
+++ b/example/fileread/ppe/Print.cc	Wed Dec 25 02:13:28 2013 +0900
@@ -2,6 +2,7 @@
 #include "SchedTask.h"
 #include "Print.h"
 #include "Func.h"
+#include "FileRead.h"
 
 /* これは必須 */
 SchedDefineTask1(Print_task,print_task);
@@ -9,9 +10,9 @@
 static int
 print_task(SchedTask *s, void *rbuf, void *wbuf)
 {
-    //int task_id = (long)smanager->get_param(0);
+    FileReadPtr fr = (FileReadPtr)rbuf;
 
-    //smanager->printf("[%d] ppe Hello, World!!\n", task_id);
+    s->printf("%s\n in Print\n", fr->read_text);
 
     return 0;
 }