changeset 1822:4251e9b607b4 draft

merge
author kkb
date Fri, 13 Dec 2013 17:13:53 +0900
parents d3e95fcd6f3e (current diff) ff4e06001518 (diff)
children 8be14797e5ce
files
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/example/fileread/d.txt	Fri Dec 13 17:13:20 2013 +0900
+++ b/example/fileread/d.txt	Fri Dec 13 17:13:53 2013 +0900
@@ -1,4 +1,4 @@
-abaacabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaababcaa
+firstabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaababcaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabababcabb
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
--- a/example/fileread/main.cc	Fri Dec 13 17:13:20 2013 +0900
+++ b/example/fileread/main.cc	Fri Dec 13 17:13:53 2013 +0900
@@ -91,9 +91,9 @@
         read->set_param(0,(long)task_number);  //生成するTaskが何番目か
         read->set_param(1,(long)DIVISION_SIZE);  //1つのタスクが読み込む量
         if(left_size <= DIVISION_SIZE){
-            read->set_param(2,(long)left_size);  //生成するTaskが何番目か
+            read->set_param(2,(long)left_size);
         }else{
-            read->set_param(2,(long)DIVISION_SIZE);  //生成するTaskが何番目か
+            read->set_param(2,(long)DIVISION_SIZE);
         }
         read->spawn();
 
--- a/example/fileread/ppe/Read.cc	Fri Dec 13 17:13:20 2013 +0900
+++ b/example/fileread/ppe/Read.cc	Fri Dec 13 17:13:53 2013 +0900
@@ -23,10 +23,12 @@
     long read_size = (long)s->get_param(2);
 
     char text[(long)read_size];
+    text[(long)read_size + 1] = '\0';
 
-    lseek(*fd, division_size* task_number,SEEK_SET);   //lseekでどこから読み込むのか指定
-    read(*fd,text,(long)read_size);
+    //lseek(*fd, division_size* task_number,SEEK_SET);   //lseekでどこから読み込むのか指定
+    //read(*fd,text,(long)read_size);
 
+    pread(*fd, text, (long)read_size , division_size*task_number);
     s->printf("[start task No. %d]\n",task_number);
     s->printf("%s\n",text);