Skip to content
Snippets Groups Projects
Commit 32a4a8f4 authored by David Hendriks's avatar David Hendriks
Browse files

Merge branch 'population' of gitlab.eps.surrey.ac.uk:ri0005/binary_c-python into population

parents 23200153 1edee19d
No related branches found
No related tags found
No related merge requests found
import matplotlib.pyplot as plt
import numpy as np
def amdahl(f,n):
return 1.0/((1-f) + (f/n))
cores = np.arange(1, 10, 0.1)
values_list = []
par_vals = np.arange(0, 1.1, 0.1)
for par_val in par_vals:
values = amdahl(par_val, cores)
values_list.append(values)
for values in values_list:
plt.plot(cores, values, 'b-')
plt.show()
\ No newline at end of file
......@@ -6,19 +6,22 @@ import numpy as np
import json
import math
scaling_result_dir = 'scaling_results'
def amdahl(f,n):
return 1.0/((1-f) + (f/n))
#################################
# Files
scaling_result_dir = 'scaling_results'
filenames = [
'astro2_2500_systems.json',
'astro2_3000_systems.json',
]
result_jsons = []
for filename in filenames:
result_jsons.append(os.path.join(os.path.abspath(scaling_result_dir), filename))
# result_jsons.append(os.path.join(os.path.abspath(scaling_result_dir), 'david-Lenovo-IdeaPad-S340-14IWL_100_systems.json'))
# result_jsons.append(os.path.join(os.path.abspath(scaling_result_dir), 'david-Lenovo-IdeaPad-S340-14IWL_2500_systems.json'))
#################################
# Plotting of the scaling results
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
for jsonfile in result_jsons:
......@@ -32,11 +35,7 @@ for jsonfile in result_jsons:
linear_mean = np.mean(linear_data)
linear_stdev = np.std(linear_data)
cpus = []
speedups = []
efficiencies = []
stddev_speedups = []
cpus, speedups, efficiencies, stddev_speedups = [], [], [], []
for amt_cpus in result_data['mp']:
# Get mp data
mp_data = result_data['mp'][amt_cpus]
......@@ -69,6 +68,25 @@ for jsonfile in result_jsons:
# x_position_shift += 0.1
# Do Amdahls law fitting
# cores = np.arange(1, 48, 0.1)
# values_list = []
# par_step = 0.005
# par_vals = np.arange(.95, 1, par_step)
# for par_val in par_vals:
# values = amdahl(par_val, cores)
# values_list.append(values)
# for i, values in enumerate(values_list):
# ax1.plot(cores, values, label="par_val={}".format(par_vals[i]))
#################################
# Adding plot make up
ax1.set_title(
"Speed up ratio vs amount of cores for different amounts of systems on {}".format(
'name_testcase'
......@@ -83,6 +101,15 @@ ax1.set_ylabel("Speed up ratio (time_linear/time_parallel)")
# ax1.set_xlim(0, max(cpus) + 4)
# ax2.set_ylim(0, 1)
ax1.grid()
ax1.legend(loc=4)
ax1.set_xscale('log')
......
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