In [1]:
%pylab inline
In [21]:
import glob
import re
import pandas as pd
In [3]:
logs = glob.glob('Nearest.*')
In [25]:
labels = ['Cores', 'Points', 'Data Generation', 'Scatter and y-sort',
'NN Search (y)', 'x-sort', 'NN Search (x)', 'Iij & Cij',
'Cij Sort and Comm.', 'Local Reduction', 'Ci Computation',
'Final Sort', 'Total']
data = []
for l in logs:
with open(l) as f:
cdata = []
for line in f:
x = map(float, re.findall(r'[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?', line))
if len(x) == 2:
cdata.append(x[0])
cdata.append(x[1])
else:
cdata.append(x[0])
data.append(cdata)
In [26]:
print data[0]
In [49]:
df = pd.DataFrame(data, columns=labels)
In [37]:
df
Out[37]:
In [38]:
npts = [640, 1280, 2560, 5120, 10240, 20480, 81920, 163840]
ncores = [8, 16, 32, 64]
In [58]:
figsize(10,6)
for i in ncores:
s = df.query('Cores == {}'.format(i))
plot(s['Points'], s['Total'], 'o-', label='{}'.format(i))
legend(loc='best')
grid()
xlabel('Points')
ylabel('Time (s)')
title('Parallel Nearest Neighbor Search')
Out[58]:
In [91]:
df.iloc[:,2:-1].plot(kind='barh', stacked=True)
Out[91]:
In [88]:
df.iloc[7:8,2:-1]
Out[88]:
In [ ]: