]> mj.ucw.cz Git - libucw.git/blob - lib/sorter/config.c
Redefined RadixThreshold to bound the array size instead of the number
[libucw.git] / lib / sorter / config.c
1 /*
2  *      UCW Library -- Universal Sorter: Configuration
3  *
4  *      (c) 2007 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include "lib/lib.h"
11 #include "lib/conf.h"
12 #include "lib/fastbuf.h"
13 #include "lib/sorter/common.h"
14
15 uns sorter_trace;
16 uns sorter_stream_bufsize = 65536;
17 u64 sorter_bufsize = 65536;
18 uns sorter_debug;
19 uns sorter_min_radix_bits;
20 uns sorter_max_radix_bits;
21 uns sorter_min_multiway_bits;
22 uns sorter_max_multiway_bits;
23 uns sorter_threads;
24 uns sorter_thread_threshold = 1048576;
25 uns sorter_thread_chunk = 4096;
26 uns sorter_radix_threshold = 4096;
27 struct fb_params sorter_fb_params;
28
29 static struct cf_section sorter_config = {
30   CF_ITEMS {
31     CF_UNS("Trace", &sorter_trace),
32     CF_UNS("StreamBuffer", &sorter_stream_bufsize),
33     CF_SECTION("FileAccess", &sorter_fb_params, &fbpar_cf),
34     CF_U64("SortBuffer", &sorter_bufsize),
35     CF_UNS("Debug", &sorter_debug),
36     CF_UNS("MinRadixBits", &sorter_min_radix_bits),
37     CF_UNS("MaxRadixBits", &sorter_max_radix_bits),
38     CF_UNS("MinMultiwayBits", &sorter_min_multiway_bits),
39     CF_UNS("MaxMultiwayBits", &sorter_max_multiway_bits),
40     CF_UNS("Threads", &sorter_threads),
41     CF_UNS("ThreadThreshold", &sorter_thread_threshold),
42     CF_UNS("ThreadChunk", &sorter_thread_chunk),
43     CF_UNS("RadixThreshold", &sorter_radix_threshold),
44     CF_END
45   }
46 };
47
48 static void CONSTRUCTOR sorter_init_config(void)
49 {
50   cf_declare_section("Sorter", &sorter_config, 0);
51 }