Mercurial > hg > Members > kono > Cerium
changeset 950:e0908a8955cd
word count size fix for task array
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 02 Aug 2010 15:12:56 +0900 |
parents | 86aea6affe6c |
children | 97cae7f41e25 |
files | example/word_count/main.cc |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/example/word_count/main.cc Mon Aug 02 15:05:02 2010 +0900 +++ b/example/word_count/main.cc Mon Aug 02 15:12:56 2010 +0900 @@ -86,7 +86,9 @@ HTask *task_array; if (use_task_array) { - task_array = manager->create_task_array(TASK_EXEC,array_task_num,0,1,1); + int task_num = (w->size+size-1)/size; + if (task_num>array_task_num) task_num = array_task_num; + task_array = manager->create_task_array(TASK_EXEC,task_num,0,1,1); if (!all) t_next->wait_for(task_array); }