27 lines
709 B
Python
27 lines
709 B
Python
import os
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
# IO: This loads the timings for you
|
|
threads, timings = [], []
|
|
for file in os.listdir('timings'):
|
|
with open(f'timings/{file}', 'r') as f:
|
|
n, t = f.read().strip().split(',')
|
|
if n != 'None':
|
|
threads.append(int(n))
|
|
timings.append(float(t))
|
|
threads = np.array(threads)
|
|
timings = np.array(timings)
|
|
|
|
|
|
|
|
print('This is the data I loaded: threads =', threads, ', timings =',timings)
|
|
|
|
fig, axs = plt.subplots()
|
|
axs.scatter(threads,timings, marker='X')
|
|
axs.set_title("How Fast is my CPU...really")
|
|
axs.set_xlabel("Number of Threads Used")
|
|
axs.set_ylabel("Run Time")
|
|
|
|
plt.savefig('threads_v_timings.png', dpi=300)
|