finish lab06
This commit is contained in:
Binary file not shown.
BIN
lab06/diff.png
Normal file
BIN
lab06/diff.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
lab06/dyn.png
Normal file
BIN
lab06/dyn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
36
lab06/plot_scaling.py
Normal file
36
lab06/plot_scaling.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import json
|
||||
import math
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas
|
||||
|
||||
# Path to the benchmark results JSON
|
||||
plot_diff = "./results/diff_theads.csv"
|
||||
plot_dyn = "./results/dyn_n.csv"
|
||||
|
||||
|
||||
data_diff = pandas.read_csv(plot_diff)
|
||||
data_dyn = pandas.read_csv(plot_dyn)
|
||||
|
||||
plt.figure(figsize=(8, 5))
|
||||
plt.plot(
|
||||
data_diff["threads"],
|
||||
data_diff["time"],
|
||||
color="blue",
|
||||
)
|
||||
plt.xlabel("threads")
|
||||
plt.ylabel("time")
|
||||
plt.grid(True)
|
||||
plt.tight_layout()
|
||||
plt.savefig("diff.png")
|
||||
|
||||
plt.figure(figsize=(8, 5))
|
||||
plt.plot(
|
||||
data_dyn["max_n"],
|
||||
data_dyn["time"],
|
||||
color="red",
|
||||
)
|
||||
plt.xlabel("n")
|
||||
plt.ylabel("time")
|
||||
plt.grid(True)
|
||||
plt.tight_layout()
|
||||
plt.savefig("dyn.png")
|
||||
@@ -1,13 +1,13 @@
|
||||
threads,max_n,time
|
||||
1,10000000,374.345
|
||||
2,10000000,617.139
|
||||
3,10000000,742.098
|
||||
4,10000000,839.706
|
||||
5,10000000,931.158
|
||||
6,10000000,947.318
|
||||
7,10000000,995.98
|
||||
8,10000000,1009.99
|
||||
9,10000000,1102.99
|
||||
10,10000000,1072.84
|
||||
11,10000000,1127.79
|
||||
12,10000000,1134.81
|
||||
1,10000000,372.132
|
||||
2,10000000,597.529
|
||||
3,10000000,970.832
|
||||
4,10000000,1073.46
|
||||
5,10000000,1227.53
|
||||
6,10000000,1275.92
|
||||
7,10000000,1373.25
|
||||
8,10000000,1367.9
|
||||
9,10000000,1402.15
|
||||
10,10000000,1471.25
|
||||
11,10000000,1475.36
|
||||
12,10000000,1520.45
|
||||
|
||||
|
Reference in New Issue
Block a user