Skip to content
Snippets Groups Projects
Verified Commit cb2e6214 authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Updated plot result

parent d0cf3f2a
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,8 @@ RESULT_APPEND_FILENAME = "result_and_speedup.png"
def plot(title1, xs1, ys1, title2, xs2, ys2, title3):
fig, ax = plt.subplots()
ax.plot(xs1, ys1, label=title1)
ax.plot(xs2, ys2, label=title2)
ax.loglog(xs1, ys1, label=title1, base=2)
ax.loglog(xs2, ys2, label=title2, base=2)
ax.set(xlabel="Number of tasks", ylabel='Time (in seconds)',
title=title3)
ax.grid()
......@@ -25,9 +25,9 @@ def plot(title1, xs1, ys1, title2, xs2, ys2, title3):
def plot_speedup(title1, xs1, ys1, title2, xs2, ys2, title3):
fig, ax = plt.subplots()
ax.plot(xs1, ys1, label=title1)
ax.plot(xs2, ys2, label=title2)
ax.plot(xs1, xs1, label="Ideal Speedup")
ax.loglog(xs1, ys1, label=title1, base=2)
ax.loglog(xs2, ys2, label=title2, base=2)
ax.loglog(xs1, xs1, label="Ideal Speedup", base=2)
ax.set(xlabel="Number of tasks", ylabel='Speedup',
title=title3)
ax.grid()
......@@ -93,13 +93,13 @@ def to_md_array(filename, xs, ys, stds, speedups, gpu):
def main():
version1, version2 = "OpenCL", "CUDA"
xs1, ys1, stds1, speedups1 = get_data("lattice_boltzmann/results/lbm-opencl-2021-07-25.csv")
xs2, ys2, stds2, speedups2 = get_data("lattice_boltzmann/results/lbm-cuda-2021-07-23.csv")
plot(version1, xs1, ys1, version2, xs2, ys2, TITLES[2][0])
plot_speedup(f"{version1} Speedup", xs1, speedups1, f"{version2} Speedup", xs2, speedups2, TITLES[2][1])
to_md_array("results_opencl.md", xs1, ys1, stds1, speedups1, gpu=True)
to_md_array("results_cuda.md", xs2, ys2, stds2, speedups2, gpu=True)
program, version1, version2, is_gpu = 0, "OpenCL", "CUDA", True
xs1, ys1, stds1, speedups1 = get_data("game_of_life/benchmark/results/gol-opencl-2021-07-20.csv")
xs2, ys2, stds2, speedups2 = get_data("game_of_life/benchmark/results/gol-cuda-2021-07-20.csv")
plot(version1, xs1, ys1, version2, xs2, ys2, TITLES[program][0])
plot_speedup(f"{version1} Speedup", xs1, speedups1, f"{version2} Speedup", xs2, speedups2, TITLES[program][1])
to_md_array("results1.md", xs1, ys1, stds1, speedups1, gpu=is_gpu)
to_md_array("results2.md", xs2, ys2, stds2, speedups2, gpu=is_gpu)
# Need ImageMagick
subprocess.run(["docker", "run", "-v", f"{os.getcwd()}:/imgs", "dpokidov/imagemagick", "+append",
f"/imgs/{RESULT_FILENAME}", f"/imgs/{RESULT_SPEEDUP_FILENAME}", f"/imgs/{RESULT_APPEND_FILENAME}"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment