plot multi-thread timings #1

Open
johannesme wants to merge 2 commits from johannesme/2024-heraklion-parallel-python:main into main
2 changed files with 10 additions and 2 deletions

3
.gitignore vendored
View file

@ -117,3 +117,6 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
# pngs
*.png

View file

@ -11,13 +11,18 @@ for file in os.listdir('timings'):
timings.append(float(t)) timings.append(float(t))
threads = np.array(threads) threads = np.array(threads)
timings = np.array(timings) timings = np.array(timings)
timings /= timings[np.where(threads == 1)[0][0]]
print('This is the data I loaded: threads =', threads, ', timings =',timings) print('This is the data I loaded: threads =', threads, ', timings =',timings)
fig, axs = plt.subplots() fig, axs = plt.subplots()
# CREATE YOUR PLOT HERE
# Remember to label your axis # Remember to label your axis
# Feel free to make it pretty # Feel free to make it pretty
axs.plot(threads, timings, '*')
axs.set_xlabel('number of threads')
axs.set_ylabel('relative processing time to single threading')
plt.savefig('threads_v_timings.png', dpi=300)
plt.savefig('threads_v_relative_timings.png', dpi=300)