-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_busc.py
43 lines (36 loc) · 1.32 KB
/
run_busc.py
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
import subprocess as sp
import re
import sys
import os
def get_filter_size(fname):
with open(fname, 'r') as f:
p = "Filter size: (\d+) bytes"
return int(re.search(p, f.read()).group(1))
bits_per_tag = int(sys.argv[1])
workload = sys.argv[1]
num_insert = 200000
num_lookup = 1000000
output_dir = "output"
pattern = "./%s %d %d %d %s > %s"
print workload
# Run ACF
program, acn = "test_split_cf_adaptive_%d" % (bits_per_tag), "acf"
result = "%s/%s_%d-busc.result" % (output_dir, acn, bits_per_tag)
sp.call(pattern % (program, num_insert, num_lookup, 0, workload, result), shell=True)
print "\tacf done."
mem_budget = get_filter_size(result)
# Run CF
program, acn = "test_big_cf_%d" % (bits_per_tag), "cf"
result = "%s/%s_%d-busc.result" % (output_dir, acn, bits_per_tag)
sp.call(pattern % (program, num_insert, num_lookup, mem_budget, workload, result), shell=True)
print "\tcf done."
# Run SBF
program, acn = "split_bloom.py", "sbf"
result = "%s/%s_%d-busc.result" % (output_dir, acn, bits_per_tag)
sp.call(pattern % (program, num_insert, num_lookup, mem_budget, workload, result), shell=True)
print "\tsbf done."
# Run BF
program, acn = "big_bloom.py", "bf"
result = "%s/%s_%d-busc.result" % (output_dir, acn, bits_per_tag)
sp.call(pattern % (program, num_insert, num_lookup, mem_budget, workload, result), shell=True)
print "\tbf done."