Mercurial > hg > Members > kono > Cerium
changeset 670:9eefc1b24c87
add header.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 03 Dec 2009 09:02:40 +0900 |
parents | 4af9d20cf3af |
children | f42b303044f7 |
files | TaskManager/Makefile.def example/word_count_test/WordCount.h example/word_count_test/main.cc |
diffstat | 3 files changed, 33 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Makefile.def Thu Dec 03 04:47:05 2009 +0900 +++ b/TaskManager/Makefile.def Thu Dec 03 09:02:40 2009 +0900 @@ -32,7 +32,7 @@ # SIMPLE_TASK=-DSIMPLE_TASK SIMPLE_TASK= -OPT = -O9 -g +OPT = -O9 # OPT = -g CC = g++
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/word_count_test/WordCount.h Thu Dec 03 09:02:40 2009 +0900 @@ -0,0 +1,19 @@ + +typedef struct wordCount { + struct wordCount *self; + int size; // remaining file size + int division_size; // for each word count task + int division_out_size; + int out_size; + int task_num; // remaining task count + int task_blocks; // spawn task one at a time + int status_num; + int task_spwaned; + unsigned long long *o_data; + unsigned long long *head_tail_flag; + int out_task_num; + int pad; + char * file_mmap; + HTaskPtr t_print; +} WordCount; +
--- a/example/word_count_test/main.cc Thu Dec 03 04:47:05 2009 +0900 +++ b/example/word_count_test/main.cc Thu Dec 03 09:02:40 2009 +0900 @@ -207,17 +207,20 @@ w->t_print = t_print; - /* Task を task_blocks ずつ起動する Task */ -#ifdef SIMPLE_TASK - HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS, - (memaddr)&w->self,sizeof(memaddr),0,0); -#else - HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS); - t_exec->set_param(0,(void*)w); -#endif - t_exec->spawn(); + for(int i = 0;i<1;i++) { + /* Task を task_blocks ずつ起動する Task */ + /* serialize されていると仮定する... */ + #ifdef SIMPLE_TASK + HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS, + (memaddr)&w->self,sizeof(memaddr),0,0); + #else + HTaskPtr t_exec = manager->create_task(RUN_TASK_BLOCKS); + t_exec->set_param(0,(void*)w); + #endif + t_exec->spawn(); + t_print->wait_for(t_exec); + } - t_print->wait_for(t_exec); t_print->spawn(); }