-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.h
358 lines (323 loc) · 10.2 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
#ifndef _CONFIG_H_
#define _CONFIG_H_
/***********************************************/
// Simulation + Hardware
/***********************************************/
#define NODE_CNT 2
#define THREAD_CNT 4
#define REM_THREAD_CNT THREAD_CNT
#define SEND_THREAD_CNT THREAD_CNT
#define CORE_CNT 8
// PART_CNT should be at least NODE_CNT
#define PART_CNT NODE_CNT
#define CLIENT_NODE_CNT NODE_CNT
#define CLIENT_THREAD_CNT 4
#define CLIENT_REM_THREAD_CNT 2
#define CLIENT_SEND_THREAD_CNT 2
#define CLIENT_RUNTIME false
#define LOAD_METHOD LOAD_MAX
#define LOAD_PER_SERVER 100
// Replication
#define REPLICA_CNT 0
// AA (Active-Active), AP (Active-Passive)
#define REPL_TYPE AP
// each transaction only accesses only 1 virtual partition. But the lock/ts manager and index are not aware of such partitioning. VIRTUAL_PART_CNT describes the request distribution and is only used to generate queries. For HSTORE, VIRTUAL_PART_CNT should be the same as PART_CNT.
#define VIRTUAL_PART_CNT PART_CNT
#define PAGE_SIZE 4096
#define CL_SIZE 64
#define CPU_FREQ 2.6
// enable hardware migration.
#define HW_MIGRATE false
// # of transactions to run for warmup
#define WARMUP 0
// YCSB or TPCC or PPS
#define WORKLOAD YCSB
// print the transaction latency distribution
#define PRT_LAT_DISTR false
#define STATS_ENABLE true
#define TIME_ENABLE true //STATS_ENABLE
#define FIN_BY_TIME true
#define MAX_TXN_IN_FLIGHT 100
#define SERVER_GENERATE_QUERIES false
/***********************************************/
// Memory System
/***********************************************/
// Three different memory allocation methods are supported.
// 1. default libc malloc
// 2. per-thread malloc. each thread has a private local memory
// pool
// 3. per-partition malloc. each partition has its own memory pool
// which is mapped to a unique tile on the chip.
#define MEM_ALLIGN 8
// [THREAD_ALLOC]
#define THREAD_ALLOC false
#define THREAD_ARENA_SIZE (1UL << 22)
#define MEM_PAD true
// [PART_ALLOC]
#define PART_ALLOC false
#define MEM_SIZE (1UL << 30)
#define NO_FREE false
/***********************************************/
// Message Passing
/***********************************************/
#define TPORT_TYPE TCP
#define TPORT_PORT 17000
#define SET_AFFINITY true
#define TPORT_TYPE TCP
#define TPORT_PORT 17000
#define SET_AFFINITY true
#define MAX_TPORT_NAME 128
#define MSG_SIZE 128 // in bytes
#define HEADER_SIZE sizeof(uint32_t)*2 // in bits
#define MSG_TIMEOUT 5000000000UL // in ns
#define NETWORK_TEST false
#define NETWORK_DELAY_TEST false
#define NETWORK_DELAY 0UL
#define MAX_QUEUE_LEN NODE_CNT * 2
#define PRIORITY_WORK_QUEUE false
#define PRIORITY PRIORITY_ACTIVE
#define MSG_SIZE_MAX 4096
#define MSG_TIME_LIMIT 0
/***********************************************/
// Concurrency Control
/***********************************************/
// WAIT_DIE, NO_WAIT, TIMESTAMP, MVCC, CALVIN, MAAT
#define CC_ALG TIMESTAMP
#define ISOLATION_LEVEL SERIALIZABLE
#define YCSB_ABORT_MODE false
// all transactions acquire tuples according to the primary key order.
#define KEY_ORDER false
// transaction roll back changes after abort
#define ROLL_BACK true
// per-row lock/ts management or central lock/ts management
#define CENTRAL_MAN false
#define BUCKET_CNT 31
#define ABORT_PENALTY 10 * 1000000UL // in ns.
#define ABORT_PENALTY_MAX 5 * 100 * 1000000UL // in ns.
#define BACKOFF true
// [ INDEX ]
#define ENABLE_LATCH false
#define CENTRAL_INDEX false
#define CENTRAL_MANAGER false
#define INDEX_STRUCT IDX_HASH
#define BTREE_ORDER 16
// [TIMESTAMP]
#define TS_TWR false
#define TS_ALLOC TS_CLOCK
#define TS_BATCH_ALLOC false
#define TS_BATCH_NUM 1
// [MVCC]
// when read/write history is longer than HIS_RECYCLE_LEN
// the history should be recycled.
#define HIS_RECYCLE_LEN 10
#define MAX_PRE_REQ MAX_TXN_IN_FLIGHT * NODE_CNT//1024
#define MAX_READ_REQ MAX_TXN_IN_FLIGHT * NODE_CNT//1024
#define MIN_TS_INTVL 10 * 1000000UL // 10ms
// [OCC]
#define MAX_WRITE_SET 10
#define PER_ROW_VALID false
// [VLL]
#define TXN_QUEUE_SIZE_LIMIT THREAD_CNT
// [CALVIN]
#define SEQ_THREAD_CNT 4
/***********************************************/
// Logging
/***********************************************/
#define LOG_COMMAND false
#define LOG_REDO false
#define LOGGING false
#define LOG_BUF_MAX 10
#define LOG_BUF_TIMEOUT 10 * 1000000UL // 10ms
/***********************************************/
// Benchmark
/***********************************************/
// max number of rows touched per transaction
#define MAX_ROW_PER_TXN 64
#define QUERY_INTVL 1UL
#define MAX_TXN_PER_PART 500000
#define FIRST_PART_LOCAL true
#define MAX_TUPLE_SIZE 1024 // in bytes
#define GEN_BY_MPR false
// ==== [YCSB] ====
// SKEW_METHOD:
// ZIPF: use ZIPF_THETA distribution
// HOT: use ACCESS_PERC of the accesses go to DATA_PERC of the data
#define SKEW_METHOD ZIPF
#define DATA_PERC 100
#define ACCESS_PERC 0.03
#define INIT_PARALLELISM 8
#define SYNTH_TABLE_SIZE 65536
#define ZIPF_THETA 0.3
#define TXN_WRITE_PERC 0.0
#define TUP_WRITE_PERC 0.0
#define SCAN_PERC 0
#define SCAN_LEN 20
#define PART_PER_TXN PART_CNT
#define PERC_MULTI_PART MPR
#define REQ_PER_QUERY 10
#define FIELD_PER_TUPLE 10
#define CREATE_TXN_FILE false
#define STRICT_PPT 0
// ==== [TPCC] ====
// For large warehouse count, the tables do not fit in memory
// small tpcc schemas shrink the table size.
#define TPCC_SMALL false
#define MAX_ITEMS_SMALL 10000
#define CUST_PER_DIST_SMALL 2000
#define MAX_ITEMS_NORM 100000
#define CUST_PER_DIST_NORM 3000
#define MAX_ITEMS_PER_TXN 15
// Some of the transactions read the data but never use them.
// If TPCC_ACCESS_ALL == fales, then these parts of the transactions
// are not modeled.
#define TPCC_ACCESS_ALL false
#define WH_UPDATE true
#define NUM_WH PART_CNT
// % of transactions that access multiple partitions
#define MPR 1.0
#define MPIR 0.01
#define MPR_NEWORDER 20 // In %
enum TPCCTable {TPCC_WAREHOUSE,
TPCC_DISTRICT,
TPCC_CUSTOMER,
TPCC_HISTORY,
TPCC_NEWORDER,
TPCC_ORDER,
TPCC_ORDERLINE,
TPCC_ITEM,
TPCC_STOCK};
enum TPCCTxnType {TPCC_ALL,
TPCC_PAYMENT,
TPCC_NEW_ORDER,
TPCC_ORDER_STATUS,
TPCC_DELIVERY,
TPCC_STOCK_LEVEL};
extern TPCCTxnType g_tpcc_txn_type;
//#define TXN_TYPE TPCC_ALL
#define PERC_PAYMENT 0.0
#define FIRSTNAME_MINLEN 8
#define FIRSTNAME_LEN 16
#define LASTNAME_LEN 16
#define DIST_PER_WH 10
// PPS (Product-Part-Supplier)
#define MAX_PPS_PARTS_PER 10
#define MAX_PPS_PART_KEY 10000
#define MAX_PPS_PRODUCT_KEY 1000
#define MAX_PPS_SUPPLIER_KEY 1000
#define MAX_PPS_PART_PER_PRODUCT 10
#define MAX_PPS_PART_PER_SUPPLIER 10
#define MAX_PPS_PART_PER_PRODUCT_KEY 10
#define MAX_PPS_PART_PER_SUPPLIER_KEY 10
#define PERC_PPS_GETPART 0.00
#define PERC_PPS_GETSUPPLIER 0.00
#define PERC_PPS_GETPRODUCT 0.0
#define PERC_PPS_GETPARTBYSUPPLIER 0.0
#define PERC_PPS_GETPARTBYPRODUCT 0.2
#define PERC_PPS_ORDERPRODUCT 0.6
#define PERC_PPS_UPDATEPRODUCTPART 0.2
#define PERC_PPS_UPDATEPART 0.0
enum PPSTxnType {PPS_ALL = 0,
PPS_GETPART,
PPS_GETSUPPLIER,
PPS_GETPRODUCT,
PPS_GETPARTBYSUPPLIER,
PPS_GETPARTBYPRODUCT,
PPS_ORDERPRODUCT,
PPS_UPDATEPRODUCTPART,
PPS_UPDATEPART
};
/***********************************************/
// DEBUG info
/***********************************************/
#define WL_VERB true
#define IDX_VERB false
#define VERB_ALLOC true
#define DEBUG_LOCK false
#define DEBUG_TIMESTAMP false
#define DEBUG_SYNTH false
#define DEBUG_ASSERT false
#define DEBUG_DISTR false
#define DEBUG_ALLOC false
#define DEBUG_RACE false
#define DEBUG_TIMELINE false
#define DEBUG_BREAKDOWN false
#define DEBUG_LATENCY false
/***********************************************/
// MODES
/***********************************************/
// QRY Only do query operations, no 2PC
// TWOPC Only do 2PC, no query work
// SIMPLE Immediately send OK back to client
// NOCC Don't do CC
// NORMAL normal operation
#define MODE NORMAL_MODE
/***********************************************/
// Constant
/***********************************************/
// INDEX_STRUCT
#define IDX_HASH 1
#define IDX_BTREE 2
// WORKLOAD
#define YCSB 1
#define TPCC 2
#define PPS 3
#define TEST 4
// Concurrency Control Algorithm
#define NO_WAIT 1
#define WAIT_DIE 2
#define DL_DETECT 3
#define TIMESTAMP 4
#define MVCC 5
#define HSTORE 6
#define HSTORE_SPEC 7
#define OCC 8
#define VLL 9
#define CALVIN 10
#define MAAT 11
#define WDL 12
// TIMESTAMP allocation method.
#define TS_MUTEX 1
#define TS_CAS 2
#define TS_HW 3
#define TS_CLOCK 4
// MODES
// NORMAL < NOCC < QRY_ONLY < SETUP < SIMPLE
#define NORMAL_MODE 1
#define NOCC_MODE 2
#define QRY_ONLY_MODE 3
#define SETUP_MODE 4
#define SIMPLE_MODE 5
// SKEW METHODS
#define ZIPF 1
#define HOT 2
// PRIORITY WORK QUEUE
#define PRIORITY_FCFS 1
#define PRIORITY_ACTIVE 2
#define PRIORITY_HOME 3
// Replication
#define AA 1
#define AP 2
// Load
#define LOAD_MAX 1
#define LOAD_RATE 2
// Transport
#define TCP 1
#define IPC 2
// Isolation levels
#define SERIALIZABLE 1
#define READ_COMMITTED 2
#define READ_UNCOMMITTED 3
#define NOLOCK 4
// Stats and timeout
#define BILLION 1000000000UL // in ns => 1 second
#define MILLION 1000000UL // in ns => 1 second
#define STAT_ARR_SIZE 1024
#define PROG_TIMER 10 * BILLION // in s
#define BATCH_TIMER 0
#define SEQ_BATCH_TIMER 5 * 1 * MILLION // ~5ms -- same as CALVIN paper
#define DONE_TIMER 1 * 60 * BILLION // ~1 minutes
#define WARMUP_TIMER 1 * 60 * BILLION // ~1 minutes
#define SEED 0
#define SHMEM_ENV false
#define ENVIRONMENT_EC2 true
#endif