%pylab inline
font = {'family' : 'normal',
'size' : 16}
matplotlib.rc('font', **font)
hpc = numpy.loadtxt('numa/hpc.txt')
aws = numpy.loadtxt('numa/aws.txt')
x = hpc[:,0] / (1e9/4.0)
plot(x, hpc[:,1] / 60, 'b-', label='total time')
plot(x, hpc[:,1] / 60, 'r.')
plot(x, hpc[:,2] / 60, 'b--', label='post allocation only')
plot(x, hpc[:,2] / 60, 'r*')
print x
axis(ymin=0)
xlabel('Memory size (GB)')
ylabel('Time (m) to do same task')
#axis(ymax=3600)
legend(loc='upper left')
savefig('/tmp/fig4.pdf')
x = hpc[:,0] / (1e9/4.0)
plot(x, hpc[:,1] / hpc[0,1], 'b-', label='total time')
plot(x, hpc[:,1] / hpc[0,1], 'r.')
plot(x, hpc[:,2] / hpc[0,2], 'b--', label='post allocation only')
plot(x, hpc[:,2] / hpc[0,2], 'r*')
print x
axis(ymin=0)
xlabel('Memory size (GB)')
ylabel('Lost time r due only to RAM acc')
#axis(ymax=40)
legend(loc='upper left')
savefig('/tmp/fig4b.pdf')
x = aws[:,0] / (1e9/4.0)
plot(x, aws[:,1], 'b-')
plot(x, aws[:,1], 'r.')
axis(ymin=0)
xlabel('Memory allocation (GB)')
ylabel('Time (s) to do standard task')
savefig('/tmp/fig3.pdf')