28 lines
631 B
Python
28 lines
631 B
Python
|
import pandas as pd
|
||
|
from matplotlib import pyplot
|
||
|
|
||
|
records = [
|
||
|
# (n_procs, time, description)
|
||
|
(1, 47.38, 'lc'),
|
||
|
(1, 44.36, 'mp'),
|
||
|
(2, 40.34, 'mp'),
|
||
|
(3, 46.79, 'mp'),
|
||
|
(4, 51.68, 'mp'),
|
||
|
(4, 51.63, 'mp'),
|
||
|
]
|
||
|
|
||
|
data = pd.DataFrame(records,
|
||
|
columns=('n_procs', 'time', 'description'))
|
||
|
|
||
|
fig, axes = pyplot.subplots()
|
||
|
axes.set_xlabel('# threads/processes')
|
||
|
axes.set_ylabel('time')
|
||
|
sub = data[data.description=='lc']
|
||
|
axes.plot(sub.n_procs, sub.time, 'ro')
|
||
|
sub = data[data.description=='mp']
|
||
|
axes.plot(sub.n_procs, sub.time, 'b--+')
|
||
|
|
||
|
axes.set_ylim(0, data.time.max() * 1.2)
|
||
|
|
||
|
pyplot.show()
|