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

did scaling plot with astro2 data

parent 8c47a230
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,16 @@ import math
scaling_result_dir = 'scaling_results'
filenames = [
'astro2_2500_systems.json',
'astro2_3000_systems.json',
]
result_jsons = []
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'))
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'))
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
......@@ -68,16 +75,19 @@ ax1.set_title(
)
)
ax1.plot([0, max(cpus)], [0, max(cpus)], label='100% scaling')
# ax1.plot([1, max(cpus)], [1, max(cpus)], label='100% scaling')
ax1.set_xlabel("Amount of cores used")
ax1.set_ylabel("Speed up ratio (time_linear/time_parallel)")
ax1.set_xlim(0, max(cpus) + 4)
# ax1.set_xlim(0, max(cpus) + 4)
# ax2.set_ylim(0, 1)
ax1.grid()
ax1.legend(loc=4)
ax1.set_xscale('log')
ax2.set_xscale('log')
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "png")))
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "pdf")))
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "eps")))
......
......@@ -32,7 +32,7 @@ for i in range(1, int(amount_of_cpus/stepsize) + 1 ):
# set some info
amt_repeats = 5
resolution = {'M_1': 5, 'per': 5}
resolution = {'M_1': 50, 'per': 60}
total_systems = int(np.prod([el for el in resolution.values()]))
result_dir = 'scaling_results'
testcase = 'linear vs MP batched'
......@@ -98,27 +98,27 @@ for repeat in range(amt_repeats):
result_dict['linear'] = linear_times
# #######################################################################################
# # MP runs
# mp_dict = {}
# for cpu_amt in cpu_list:
#######################################################################################
# MP runs
mp_dict = {}
for cpu_amt in cpu_list:
# mp_times = []
mp_times = []
# test_pop.set(amt_cores=cpu_amt)
test_pop.set(amt_cores=cpu_amt)
# #
# for repeat in range(amt_repeats):
# total_mp_start = time.time()
# evolve_mp_time = test_pop.evolve_population_mp_chunks()
# total_mp = time.time() - total_mp_start
#
for repeat in range(amt_repeats):
total_mp_start = time.time()
evolve_mp_time = test_pop.evolve_population_mp_chunks()
total_mp = time.time() - total_mp_start
# print("MP ({} nodes) run with {} systems: {} of which {} spent on evolving the systems".format(cpu_amt, total_systems, total_mp, evolve_mp_time))
# mp_times.append(total_mp)
print("MP ({} nodes) run with {} systems: {} of which {} spent on evolving the systems".format(cpu_amt, total_systems, total_mp, evolve_mp_time))
mp_times.append(total_mp)
# mp_dict[cpu_amt] = mp_times
mp_dict[cpu_amt] = mp_times
# result_dict['mp'] = mp_dict
result_dict['mp'] = mp_dict
# Write to file
with open('scaling_results/{}_{}_systems.json'.format(hostname, total_systems), 'w') as f:
......
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