Mercurial > hg > Game > Cerium
diff example/word_count_test/main.cc @ 666:f02b3338b91b draft
simplify word_count
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 03 Dec 2009 02:11:31 +0900 |
parents | 77d9e3bc25b2 |
children | ae1d1eebf9ff |
line wrap: on
line diff
--- a/example/word_count_test/main.cc Thu Dec 03 01:16:34 2009 +0900 +++ b/example/word_count_test/main.cc Thu Dec 03 02:11:31 2009 +0900 @@ -129,6 +129,7 @@ static int blocks = 192; +static int division = 16; // in Kbyte static void run_start(TaskManager *manager, char *filename) @@ -148,10 +149,9 @@ w->file_mmap = st_mmap.file_mmap; /* 1task分のデータサイズ(byte) */ - if (w->size >= 4096*4) { - w->division_size = 4096 * 4;/*16kbyte*/ - } - else { + if (w->size >= 1024*division) { + w->division_size = 1024 * division;/*16kbyte*/ + } else { w->division_size = w->size; } @@ -209,6 +209,8 @@ for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-file") == 0) { filename = argv[i+1]; + } else if (strcmp(argv[i], "-division") == 0) { + division = atoi(argv[i+1]); } else if (strcmp(argv[i], "-block") == 0) { blocks = atoi(argv[i+1]); }