Mercurial > hg > Game > Cerium
changeset 1778:0e6ca13d2ed0 draft
minor fix
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Nov 2013 01:50:31 +0900 |
parents | 7b11aceb41c4 |
children | 0dd39c19dbb2 |
files | example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc |
diffstat | 2 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Mon Nov 25 17:12:51 2013 +0900 +++ b/example/regex_mas/main.cc Tue Nov 26 01:50:31 2013 +0900 @@ -133,19 +133,19 @@ for (int j = 0; j < array_task_num; j++) { for (int k = 0; k < spe_num; k++) { - int a = w->task_spwaned++; if (w->size < size) size = w->size; + //if (size == w->size) break; t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]); - t_exec[k]->set_param(0,&w->search_word_len); + t_exec[k]->set_param(0,(unsigned long long)w->search_word_len); if(size != w->size){ //最後のタスクかどうかの判定 - t_exec[k]->set_param(1,&w->division_size + w->extra_len); + 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,&w->division_size); + 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); @@ -252,6 +252,7 @@ static int blocks = 48; //static int blocks = 31 * 6 * 24; +//Boyer Moore法に使用するテーブルを作成 static int* create_BMskiptable(unsigned char *search_word,int search_word_len,int *skip_table) { @@ -266,7 +267,6 @@ return skip_table; } - static void run_start(TaskManager *manager, char *filename,unsigned char *search_word) { @@ -401,7 +401,6 @@ unsigned char *search_word = (unsigned char*)manager->allocate(sizeof(char)*sw_len); strcpy((char*)search_word, (const char*)sword); - task_init(); st_time = getTime(); run_start(manager, filename,search_word);
--- a/example/regex_mas/ppe/Exec.cc Mon Nov 25 17:12:51 2013 +0900 +++ b/example/regex_mas/ppe/Exec.cc Tue Nov 26 01:50:31 2013 +0900 @@ -32,15 +32,18 @@ static int run(SchedTask *s, void *rbuf, void *wbuf) { + //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 = (unsigned char*)s->get_input(rbuf,1); + unsigned char search_word[] = "doing"; int *skip_table = (int *)s->get_input(rbuf,2); + //set_param int length = (int)s->get_inputSize(0); + s->printf("length %d\n",length); int sw_len = (int)s->get_inputSize(1); unsigned long long *o_data = (unsigned long long*)wbuf; - //unsigned char search_word[] = "doing"; o_data[0] = BM_method(i_data,length,search_word,sw_len,skip_table); //s->printf("in Exec.cc\n");