# HG changeset patch # User Shinji KONO # Date 1259798560 -32400 # Node ID 9eefc1b24c87c09c1c3388525ae101a67907291d # Parent 4af9d20cf3af7d2107991202f82a9d86bacef491 add header. diff -r 4af9d20cf3af -r 9eefc1b24c87 TaskManager/Makefile.def --- 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++ diff -r 4af9d20cf3af -r 9eefc1b24c87 example/word_count_test/WordCount.h --- /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; + diff -r 4af9d20cf3af -r 9eefc1b24c87 example/word_count_test/main.cc --- 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(); }