Skip to content

Commit 9611855

Browse files
committed
Test
1 parent 7e7a4ee commit 9611855

File tree

5 files changed

+101
-437
lines changed

5 files changed

+101
-437
lines changed

CMakePresets.json

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
"CMAKE_BUILD_TYPE": "Release"
3838
}
3939
},
40+
{
41+
"name": "x64-release-debug-info",
42+
"displayName": "x64 RelWithDebInfo",
43+
"inherits": "x64-debug",
44+
"cacheVariables": {
45+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
46+
}
47+
},
4048
{
4149
"name": "x86-debug",
4250
"displayName": "x86 Debug",

plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self):
3838
else:
3939
values = list(impls.values())
4040
avgs = list(map(lambda l: statistics.mean(first(l.values.values())), values))
41-
std = list(map(lambda l: statistics.stdev(first(l.values.values())), values))
41+
std = list(map(lambda l: 0, values))
4242
plt.errorbar(list(map(int, impls.keys())), avgs, yerr=std, label=list(values[0].values.keys())[0], fmt="-o", capsize=3, ecolor="black")
4343
plt.xlabel("Blocks per window per thread")
4444
plt.title("Relaxed-FIFO Window Size Comparison")

plot_fill.py

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import csv
2+
import matplotlib.pyplot as plt
3+
import sys
4+
import statistics
5+
6+
def first(x):
7+
return next(iter(x))
8+
9+
class impl:
10+
def __init__(self):
11+
self.values = { }
12+
13+
impls = { }
14+
15+
for i in range(2):
16+
file = sys.argv[1] if len(sys.argv) == 2 else input("Please enter the .csv data file: ")
17+
18+
with open(file) as file:
19+
lines = csv.reader(file)
20+
for row in lines:
21+
name = row[0] + str(i)
22+
if name not in impls:
23+
impls[name] = impl()
24+
x = int(row[1])
25+
y = 10**9 / int(row[3])
26+
if (x not in impls[name].values):
27+
impls[name].values[x] = [y]
28+
else:
29+
impls[name].values[x].append(y)
30+
31+
32+
if len(list(impls.values())[0].values) > 1:
33+
for k, v in impls.items():
34+
values = v.values.values()
35+
avgs = list(map(statistics.mean, values))
36+
std = list(map(statistics.stdev, values)) if len(first(values)) > 1 else 0
37+
plt.errorbar(v.values.keys(), avgs, yerr=std, label=k, fmt="-o", capsize=3, ecolor="black")
38+
plt.xlabel("Processors")
39+
plt.title("Fill throughput")
40+
else:
41+
values = list(impls.values())
42+
avgs = list(map(lambda l: statistics.mean(first(l.values.values())), values))
43+
std = list(map(lambda l: statistics.stdev(first(l.values.values())), values))
44+
plt.errorbar(list(map(int, impls.keys())), avgs, yerr=std, label=list(values[0].values.keys())[0], fmt="-o", capsize=3, ecolor="black")
45+
plt.xlabel("Blocks per window per thread")
46+
plt.title("Relaxed-FIFO Window Size Comparison")
47+
48+
plt.xscale("log", base = 2)
49+
plt.ylabel("Iterations per second")
50+
plt.grid()
51+
plt.legend()
52+
plt.show()

relaxed_concurrent_fifo/main.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ int main() {
175175
std::cout << "Running in debug mode!" << std::endl;
176176
#endif // NDEBUG
177177

178-
//test_consistency<8, 512, 1 << 17, 1 << 20>(0.5);
178+
//test_consistency<8, 512, 1 << 17, 1 << 20>(0);
179179

180180
std::vector<size_t> processor_counts;
181-
for (size_t i = 1; i <= std::thread::hardware_concurrency(); i *= 2) {
181+
for (size_t i = 1; i <= std::thread::hardware_concurrency() - 1; i *= 2) {
182182
processor_counts.emplace_back(i);
183183
}
184184

185185
constexpr int OVERRIDE_CHOICE = 0;
186-
constexpr int TEST_ITERATIONS = 5;
186+
constexpr int TEST_ITERATIONS = 1;
187187
constexpr int TEST_TIME_SECONDS = 5;
188188

189189
int input;
@@ -220,5 +220,8 @@ int main() {
220220
run_benchmark("empty", instances, {1}, processor_counts, TEST_ITERATIONS, 0);
221221
}
222222

223+
std::cout << "Done" << std::endl;
224+
std::this_thread::sleep_for(std::chrono::hours(44444444));
225+
223226
return 0;
224227
}

0 commit comments

Comments
 (0)