Commit e35a3f5c authored by lmeinen's avatar lmeinen
Browse files

comput speedup relative to sequential implementation

parent e20e6b5e
......@@ -128,9 +128,6 @@ def plot_by_size(df: DataFrame, size: int, multi_node: bool):
# type of current df
t = df['type'].iloc[0]
if 'Sequential' in t:
return 0
print("\nGenerating {} plots for size {}...".format(t, size))
if multi_node:
......@@ -185,8 +182,8 @@ def plot_by_size(df: DataFrame, size: int, multi_node: bool):
print("--> Storing results to {}".format(filename))
# function to save and show the plot
plt.savefig("./{}".format(filename)
plt.close()
plt.savefig("./{}".format(filename))
plt.clf()
# save list of points in graph1 or graph2
fill_graphs(size, t, pts, multi_node)
......@@ -206,7 +203,7 @@ def plot_by_size(df: DataFrame, size: int, multi_node: bool):
for idx, i in enumerate(y):
if (y[idx] + diffs[idx] > top_margin):
top_margin = y[idx]+diffs[idx]
plt.ylim(bottom=0, top = top_margin * 1.1)
plt.ylim(bottom=0, top=top_margin * 1.1)
# naming the x axis
if multi_node:
plt.xlabel('processes')
......@@ -220,7 +217,7 @@ def plot_by_size(df: DataFrame, size: int, multi_node: bool):
print("--> Storing results to {}".format(filename2))
plt.savefig("./{}/{}/{}".format(PLOTS_DIR, CI_DIR, filename2))
# function to save and show the plot
plt.close()
plt.clf()
def plot_speedup_summary_graphs():
......@@ -232,19 +229,27 @@ def plot_speedup_summary_graphs():
print("\nGenerating speedup summary plots...")
for size, experiments in graphs.items():
base_time = None
if 'single-node' in experiments.items():
measurements = experiments['single-node']
for t, points in measurements:
if 'sequential' in t.lower() and points:
# speedup relative to sequential execution time
base_time = points[0][1]
for node_setup, measurements in experiments.items():
if measurements:
print(
"----- Processing for size {} in {} setup -----".format(size, node_setup))
# Base time is slowest implementation on 1 (or 4 on multi-node) thread
min_threads = 2 if node_setup == 'single-node' else 4
base_time = 0
for _, points in measurements:
for x, y in points:
if x == min_threads and y > base_time:
base_time = y
if not base_time:
# Base time is slowest implementation on 1 (or 4 on multi-node) thread
min_threads = 2 if node_setup == 'single-node' else 4
base_time = 0
for _, points in measurements:
for x, y in points:
if x == min_threads and y > base_time:
base_time = y
for t, points in measurements:
x, y = zip(*points)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment