changeset 1784:a9ff87220a68 draft

minor fix
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Fri, 29 Nov 2013 16:07:12 +0900
parents 803dfdd1c741
children ae8e90890961
files example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc
diffstat 2 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/main.cc	Fri Nov 29 13:54:12 2013 +0900
+++ b/example/regex_mas/main.cc	Fri Nov 29 16:07:12 2013 +0900
@@ -140,16 +140,13 @@
 
                     t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]);
 
-                    t_exec[k]->set_param(0,(unsigned long long)w->search_word_len);
                     if(size != w->size){ //最後のタスクかどうかの判定
-                        t_exec[k]->set_param(1,(unsigned long long)w->division_size + w->extra_len);
                         t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, w->division_size + w->extra_len);
                     }else{
-                        t_exec[k]->set_param(1,(unsigned long long)w->division_size);
                         t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, w->division_size);
                     }
                     t_exec[k]->set_inData(1,w->search_word, w->search_word_len);
-                    t_exec[k]->set_inData(2,w->BMskip_table, sizeof(int)*256);
+                    t_exec[k]->set_inData(2,w->BMskip_table, 256);
 
                     t_exec[k]->set_outData(0,w->o_data + a*w->out_size, w->division_out_size);
                     w->size -= size;
@@ -393,13 +390,9 @@
 
     filename = init(argc, argv);
 
-    if ((filename < 0) || (sword < 0)) {
-        return -1;
-    }
-
     int sw_len = strlen((const char*)sword);
-    unsigned char *search_word = (unsigned char*)manager->allocate(sizeof(char)*sw_len);
-    strcpy((char*)search_word, (const char*)sword);
+    unsigned char *search_word = (unsigned char*)manager->allocate(sw_len);
+    memcpy(search_word, (const char*)sword, sw_len + 1);
 
     task_init();
     st_time = getTime();
--- a/example/regex_mas/ppe/Exec.cc	Fri Nov 29 13:54:12 2013 +0900
+++ b/example/regex_mas/ppe/Exec.cc	Fri Nov 29 16:07:12 2013 +0900
@@ -34,13 +34,14 @@
 {
     //set_inData
     unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0);
-    //unsigned char *search_word = (unsigned char*)s->get_input(rbuf,1);
-    unsigned char search_word[] = "doing";
+    unsigned char *search_word = (unsigned char*)s->get_input(rbuf,1);
+    //unsigned char search_word[] = "doing";
     int *skip_table = (int *)s->get_input(rbuf,2);
+    int length = (int)s->get_inputSize(0);
+    int sw_len = (int)s->get_inputSize(1);
     //set_param
-    int length = (int)s->get_inputSize(0);
     s->printf("length %d\n",length);
-    int sw_len = (int)s->get_inputSize(1);
+    s->printf("sw_len %d\n",sw_len);
 
     unsigned long long *o_data = (unsigned long long*)wbuf;