]> mj.ucw.cz Git - libucw.git/blob - ucw/sorter/config.c
The big move. Step #1: Move whole lib/ to ucw/.
[libucw.git] / ucw / 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 "ucw/lib.h"
11 #include "ucw/conf.h"
12 #include "ucw/fastbuf.h"
13 #include "ucw/sorter/common.h"
14
15 uns sorter_trace;
16 uns sorter_trace_array;
17 u64 sorter_bufsize = 65536;
18 uns sorter_debug;
19 uns sorter_min_radix_bits;
20 uns sorter_max_radix_bits;
21 uns sorter_add_radix_bits;
22 uns sorter_min_multiway_bits;
23 uns sorter_max_multiway_bits;
24 uns sorter_threads;
25 u64 sorter_thread_threshold = 1048576;
26 u64 sorter_thread_chunk = 4096;
27 u64 sorter_radix_threshold = 4096;
28 struct fb_params sorter_fb_params;
29 struct fb_params sorter_small_fb_params;
30 u64 sorter_small_input;
31
32 static struct cf_section sorter_config = {
33   CF_ITEMS {
34     CF_UNS("Trace", &sorter_trace),
35     CF_UNS("TraceArray", &sorter_trace_array),
36     CF_SECTION("FileAccess", &sorter_fb_params, &fbpar_cf),
37     CF_SECTION("SmallFileAccess", &sorter_fb_params, &fbpar_cf),
38     CF_U64("SmallInput", &sorter_small_input),
39     CF_U64("SortBuffer", &sorter_bufsize),
40     CF_UNS("Debug", &sorter_debug),
41     CF_UNS("MinRadixBits", &sorter_min_radix_bits),
42     CF_UNS("MaxRadixBits", &sorter_max_radix_bits),
43     CF_UNS("AddRadixBits", &sorter_add_radix_bits),
44     CF_UNS("MinMultiwayBits", &sorter_min_multiway_bits),
45     CF_UNS("MaxMultiwayBits", &sorter_max_multiway_bits),
46     CF_UNS("Threads", &sorter_threads),
47     CF_U64("ThreadThreshold", &sorter_thread_threshold),
48     CF_U64("ThreadChunk", &sorter_thread_chunk),
49     CF_U64("RadixThreshold", &sorter_radix_threshold),
50     CF_END
51   }
52 };
53
54 static void CONSTRUCTOR sorter_init_config(void)
55 {
56   cf_declare_section("Sorter", &sorter_config, 0);
57 }