-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.py
32 lines (24 loc) · 1.36 KB
/
compile.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
import subprocess as sp
import sys
if len(sys.argv) > 1:
br = [int(sys.argv[1])]
else:
br = [4, 8, 12, 16, 20, 24, 28, 32]
# Compile the programs
for bits in br:
# CF
sp.call("sed -i 's/const size_t bits_per_tag = .*/const size_t bits_per_tag = %d;/g' example/test_big_cf.cc" % bits, shell=True)
sp.call("make test_big_cf", shell=True)
sp.call("mv test_big_cf test_big_cf_%d" % (bits), shell=True)
sp.call("sed -i 's/size_t sht_max_buckets = .*/size_t sht_max_buckets = %d;/g' example/test_big_cf.cc" % 10, shell=True)
sp.call("make test_big_cf", shell=True)
sp.call("mv test_big_cf test_big_cf_%d_nc" % (bits), shell=True)
sp.call("sed -i 's/size_t sht_max_buckets = .*/size_t sht_max_buckets = %d;/g' example/test_big_cf.cc" % 0, shell=True)
#ACF
sp.call("sed -i 's/const size_t bits_per_tag = .*/const size_t bits_per_tag = %d;/g' example/test_split_cf_adaptive.cc" % bits, shell=True)
sp.call("make test_split_cf_adaptive", shell=True)
sp.call("mv test_split_cf_adaptive test_split_cf_adaptive_%d" % (bits), shell=True)
sp.call("sed -i 's/InsertNC(nc_hash/\/\/InsertNC(nc_hash/g' src/adaptive_cuckoofilter.h", shell=True)
sp.call("make test_split_cf_adaptive", shell=True)
sp.call("mv test_split_cf_adaptive test_split_cf_adaptive_%d_no_nc" % (bits), shell=True)
sp.call("sed -i 's/\/\/InsertNC(nc_hash/InsertNC(nc_hash/g' src/adaptive_cuckoofilter.h", shell=True)