update log paths
This commit is contained in:
+9
-14
@@ -30,39 +30,34 @@ def build_benchmark():
|
||||
|
||||
plt.figure(figsize=(12, 5))
|
||||
|
||||
# График времени
|
||||
plt.subplot(1, 2, 1)
|
||||
plt.plot(thread_counts, times, "o-", color="blue", label="Фактическое время")
|
||||
plt.xlabel("Кол-во потоков (0 = посл.)")
|
||||
plt.ylabel("Время выполнения (сек)")
|
||||
plt.title("Зависимость времени от потоков")
|
||||
plt.xlabel("Потоки")
|
||||
plt.ylabel("Время (сек)")
|
||||
plt.title("Время выполнения")
|
||||
plt.grid(True)
|
||||
plt.legend()
|
||||
|
||||
# График ускорения
|
||||
plt.subplot(1, 2, 2)
|
||||
t_seq = times[0]
|
||||
speedup = [t_seq / x if x > 0 else 1 for x in times]
|
||||
plt.plot(thread_counts, speedup, "s-", color="green", label="Ускорение (S)")
|
||||
plt.plot(thread_counts, speedup, "s-", color="green", label="Ускорение")
|
||||
plt.plot(
|
||||
thread_counts,
|
||||
[x if x > 0 else 1 for x in thread_counts],
|
||||
"--",
|
||||
color="red",
|
||||
alpha=0.5,
|
||||
label="Идеал",
|
||||
)
|
||||
plt.xlabel("Кол-во потоков")
|
||||
plt.ylabel("S = T(послед) / T(паралл)")
|
||||
plt.title("График масштабируемости (Speedup)")
|
||||
plt.legend()
|
||||
plt.xlabel("Потоки")
|
||||
plt.ylabel("Ускорение S")
|
||||
plt.title("Масштабируемость")
|
||||
plt.grid(True)
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig("out/performance_results.png")
|
||||
print("Графики сохранены в out/performance_results.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.makedirs("out", exist_ok=True)
|
||||
if not os.path.exists("out"):
|
||||
os.makedirs("out")
|
||||
build_benchmark()
|
||||
|
||||
Reference in New Issue
Block a user