changeset 1982:455e620ad2b2 draft

fix
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Sat, 15 Mar 2014 16:06:03 +0900
parents 8403130d65ad
children c3b4083c4467
files example/bm_search/Makefile.def example/bm_search/main.cc
diffstat 2 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/example/bm_search/Makefile.def	Thu Mar 13 03:08:43 2014 +0900
+++ b/example/bm_search/Makefile.def	Sat Mar 15 16:06:03 2014 +0900
@@ -1,4 +1,4 @@
-TARGET = regex
+TARGET = bm_search
 
 # include/library path
 # ex  macosx
--- a/example/bm_search/main.cc	Thu Mar 13 03:08:43 2014 +0900
+++ b/example/bm_search/main.cc	Sat Mar 15 16:06:03 2014 +0900
@@ -31,7 +31,6 @@
 int spe_num = 1;
 int block_read_flag = 0;
 int DIVISION_SIZE = 4*4096;
-int READ_DIVISION_SIZE = 4*4096 * 1024;
 
 unsigned char *sword = 0;
 int task_count = 0;
@@ -71,8 +70,7 @@
         fprintf(stderr,"can't fstat %s\n",filename);
     }
 
-    //w->file_mmap = (char*)mmap(NULL,w->read_filesize,PROT_READ,map,fd,(off_t)0);
-    madvise(w->file_mmap, w->read_filesize, POSIX_MADV_NORMAL);
+    //madvise(w->file_mmap, w->read_filesize, POSIX_MADV_NORMAL);
     w->file_mmap = (char*)mmap(NULL,w->read_filesize,PROT_READ,map,fd,(off_t)0);
 
     if (st_mmap.file_mmap == (caddr_t)-1) {
@@ -172,7 +170,7 @@
     t_read->set_param(0,w->fd);
 
     if (w->task_num < w->task_blocks) {
-        t_read->set_param(1,w->task_spawned*w->division_size);
+        t_read->set_param(1,w->task_spawned*w->division_size); // front blocked read position
         t_read->set_outData(0, w->file_mmap + w->task_spawned * w->division_size, w->task_blocks * w->division_size);
 
         // last case
@@ -182,7 +180,7 @@
         while (w->size>0)
             run_tasks(manager,w,1,t_read,w->t_print, w->size);
 
-        t_read->set_param(2,w->task_spawned*w->division_size);
+        t_read->set_param(2,w->task_spawned*w->division_size); // end blocked read position
         t_read->spawn();
     } else {
         HTaskPtr t_next = manager->create_task(BREAD_RUN_TASK_BLOCKS,