-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tree_experiments_rqsize.py
95 lines (75 loc) · 3.38 KB
/
run_tree_experiments_rqsize.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
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
import sys
import os
sys.path.insert(1, 'internals/')
import create_graphs as graph
if len(sys.argv) == 1 or sys.argv[1] == '-h':
print("Usage: python3 run_tree_experiments_rqsize.py [num_keys] [update_threads] [rq_threads] [small_rq_threads] [rqsizelist] [outputfile] [num_repeats] [runtime] [JVM memory size] [zipf]")
print("For example: python3 run_tree_experiments_rqsize.py 10000 4 4 0 [8,256] graph.png 1 1 1G 0")
exit(0)
num_keys = sys.argv[1]
update_threads = sys.argv[2]
rq_threads = sys.argv[3]
small_rq_threads = sys.argv[4]
rqsizes = sys.argv[5][1:-1].split(',')
graphfile = sys.argv[6]
repeats = int(sys.argv[7])*2
runtime = sys.argv[8]
JVM_mem_size = sys.argv[9]
batch_size = "1"
node_bind = "none"
zipf = float(sys.argv[10])
graphs_only = False
inc_update = ""
if "-g" in sys.argv:
graphs_only = True
if "-inc-update" in sys.argv:
inc_update = " -inc-update "
ins=50
rmv=50
th = int(update_threads)+int(rq_threads)+int(small_rq_threads)
key_range = int(int(num_keys) * (int(ins) + int(rmv)) / int(ins))
graphtitle = str(num_keys) + "keys-" + str(update_threads) + "up-" + str(rq_threads) + "rq-" + str(small_rq_threads) + "smallrq" + inc_update
if zipf == 0:
graphtitle += "-uniform"
else:
graphtitle += "-" + str(zipf) + "zipf"
benchmark_name = graphtitle.replace(':','-').replace(' ', '-')
graphtitle = graphtitle.replace('-1leafsize','')
memory_results_file = "java/results/" + benchmark_name + ".memory.out"
throughput_results_file = "java/results/" + benchmark_name + ".throughput.csv"
# print(results_file_name)
datastructures = ["VcasChromaticBSTBBF", "VcasChromaticBSTSLRT", "VcasChromaticBSTSteamLF", "VcasChromaticBSTEpoch", "VcasChromaticBSTDLRT"]
# print(datastructures)
# "VcasChromaticBatchBSTSteamFast -param-64", "VcasChromaticBatchBSTSteamScan -param-64",
# "ChromaticBatchBST -param-64", "BatchBST -param-64"
if node_bind == "":
numactl = "numactl -i all "
elif node_bind == "none":
numactl = ""
else:
numactl = "numactl --membind=" + node_bind + " --cpunodebind=" + node_bind + " "
cmdbase = "java -server -Xss515m -Xms" + JVM_mem_size + " -Xmx" + "64G" + " -Xbootclasspath/a:'java/lib/scala-library.jar:java/lib/deuceAgent.jar' -jar java/build/experiments_instr.jar "
if not graphs_only:
# delete previous results
os.system("rm -rf java/build/*.csv")
os.system("rm -rf java/build/*.csv_stdout")
os.system("rm -rf java/build/*.out")
i = 0
for ds in datastructures:
for rqsize in rqsizes:
i = i+1
tmp_results_file = "java/build/data-trials" + str(i) + ".out"
zipf_param = ""
if zipf != 0:
zipf_param = " -zipf"
cmd = numactl + cmdbase + str(th) + " " + str(repeats) + " " + runtime + " " + ds + " -ins" + str(ins) + " -del" + str(rmv) + " -rq0 -rqsize" + str(rqsize) + " -rqers" + rq_threads + " -smallrqers" + small_rq_threads + " -keys" + str(key_range) + zipf_param + " -prefill -memoryusage -file-java/build/data-trials" + str(i) + ".csv" + inc_update + " -verbose " + " >> " + tmp_results_file
f = open(tmp_results_file, "w")
f.write(cmd + '\n')
f.close()
print(cmd)
if os.system(cmd) != 0:
print("error: script terminated early")
exit(1)
os.system("cat java/build/data-*.out > " + memory_results_file)
os.system("cat java/build/data-*.csv > " + throughput_results_file)
graph.plot_java_rqsize_memory_graphs(throughput_results_file, memory_results_file, graphfile, graphtitle)