changeset 1947:ef751840b388 draft

running mmap mode (cannot running divide read)
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Wed, 05 Feb 2014 22:23:36 +0900
parents 502521591d7c
children 6b03da068fbe
files example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc example/regex_mas/ppe/Read.cc
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/main.cc	Wed Feb 05 22:05:28 2014 +0900
+++ b/example/regex_mas/main.cc	Wed Feb 05 22:23:36 2014 +0900
@@ -63,6 +63,7 @@
     return size;
 }
 
+
 SchedDefineTask1(MMAP,my_mmap);
 
 static int
@@ -101,7 +102,7 @@
             int task_num = (w->size+size-1)/size;
             if (task_num>array_task_num) task_num = array_task_num;
             task_array = manager->create_task_array(TASK_EXEC,task_num,1,3,1);
-            task_array->wait_for(t_read);
+            if (t_read != 0) task_array->wait_for(t_read);
             if (!all) {
                 t_next->wait_for(task_array);
             } else {
@@ -126,7 +127,7 @@
                 t_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size);
             } else if (use_compat) {
                 h_exec = manager->create_task(TASK_EXEC);
-                h_exec->wait_for(t_read);
+                if (t_read != 0) h_exec->wait_for(t_read);
                 h_exec->set_inData(0,w->file_mmap + i*w->division_size, size);
                 h_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size);
 
@@ -138,7 +139,7 @@
                 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->wait_for(t_read);
+                if (t_read != 0) h_exec->wait_for(t_read);
                 t_next->wait_for(h_exec);
                 h_exec->set_cpu(spe_cpu);
                 h_exec->spawn();
@@ -190,7 +191,7 @@
 
             run_tasks(manager,w, w->task_blocks,t_read, t_next, w->division_size + w->extra_len);
 
-            task_spawned = w->task_spawned;
+             task_spawned = w->task_spawned;
             t_read->set_param(1,task_spawned*w->division_size);
             t_read->set_param(2,(long)w->fd);
 
--- a/example/regex_mas/ppe/Exec.cc	Wed Feb 05 22:05:28 2014 +0900
+++ b/example/regex_mas/ppe/Exec.cc	Wed Feb 05 22:23:36 2014 +0900
@@ -45,9 +45,9 @@
     o_data[0] = 0;
     o_data[0] = BM_method(i_data,length,search_word,sw_len,skip_table);
 
-    printf("match count : %llu\n",o_data[0]);
-    long task_count = (long)s->get_param(0);  //何番目のtaskか
-    s->printf("[start exec No: %lld]\n",task_count+1);
+    //printf("match count : %llu\n",o_data[0]);
+    //long task_count = (long)s->get_param(0);  //何番目のtaskか
+    //s->printf("[start exec No: %lld]\n",task_count+1);
 
 
     return 0;
--- a/example/regex_mas/ppe/Read.cc	Wed Feb 05 22:05:28 2014 +0900
+++ b/example/regex_mas/ppe/Read.cc	Wed Feb 05 22:23:36 2014 +0900
@@ -22,12 +22,11 @@
     long end_read = (long)s->get_param(1);
     long fd = (long)s->get_param(2);
 
-    long read_size = start_read - end_read;
+    long read_size = end_read - start_read;
 
     //char *read_text = (char*)s->get_output(wbuf,0);
     char *read_text = w->file_mmap + start_read;
     //s->printf("[read No %d : wbuf addr 0x%llx]\n",task_number,read_text);
-    //s->printf("[read No %d : wbuf addr 0x%llx]\n",task_number,read_text);
 
     pread(fd, read_text, read_size , start_read);