In [1]:
import numpy as np
import matplotlib
import matplotlib.pylab as plt

In [2]:
import memory_analysis as mem

In [3]:
def plotMemory(filename, label=''):
    m = mem.readMemoryFile(filename)
    t = mem.consumptionTimeline(m)
    plt.plot(t[:, 0] / 1e9, t[:, 1], label=label)

In [15]:
#m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.purgenormal.txt')
#t = mem.consumptionTimeline(m)
#plt.plot(t[:, 0] / 1e9, t[:, 1], label='normal')

m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.nopurge.txt')
t2 = mem.consumptionTimeline(m2)
plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='nopurge')

m3 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.purgehigh.txt')
t3 = mem.consumptionTimeline(m3)
plt.plot(t3[:, 0] / 1e9, t3[:, 1], label='prio')

m3 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.txt')
t3 = mem.consumptionTimeline(m3)
plt.plot(t3[:, 0] / 1e9, t3[:, 1], label='with MPI')

plt.legend()
plt.show()

In [36]:
plt.figure()
for i in range(2):
    m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-%03d.txt' % i)
    t = np.cumsum(m[:, 1])
    plt.plot(m[:, 0], t)
m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-shared.txt')
t = np.cumsum(m[:, 1])
plt.plot(m[:, 0], t)
plt.show()

In [16]:
m3 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.txt')
t3 = mem.consumptionTimeline(m3)
plt.plot(t3[:, 0] / 1e9, t3[:, 1], label='with MPI')

plt.legend()
plt.show()

In [23]:
m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-000.txt')
t = mem.consumptionTimeline(m)
plt.plot(t[:, 0] / 1e9, t[:, 1], label='Shared memory')

m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.txt')
t = mem.consumptionTimeline(m)
plt.plot(t[:, 0] / 1e9, t[:, 1], label='MPI, no flush')

m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.cache.mpi.txt')
t = mem.consumptionTimeline(m)
plt.plot(t[:, 0] / 1e9, t[:, 1], label='MPI')

m = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.cache.nompi.txt')
t = mem.consumptionTimeline(m)
plt.plot(t[:, 0] / 1e9, t[:, 1], label='MPI no pack()')

plt.xlabel('Temps (s)')
plt.ylabel('Memoire (o)')
plt.legend(loc='lower right')

plt.show()

In [58]:
plt.figure()

#plt.plot(t[:, 0] / 1e9, t[:, 1], label='MPI, no flush')

#m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-000.txt')
#t2 = mem.consumptionTimeline(m2)
#plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='1 MPI')

#m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.isend.txt')
#t2 = mem.consumptionTimeline(m2)
#plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='Noeud 1, Isend')

m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-000.txt')
t2 = mem.consumptionTimeline(m2)
plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='2 MPI')

#m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-000.4.txt')
#t2 = mem.consumptionTimeline(m2)
#plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='4 MPI')

#m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-000.8.txt')
#t2 = mem.consumptionTimeline(m2)
#plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='8 MPI')


#m2 = mem.readMemoryFile('/Users/lize/data_these/cone_sphere/memory-001.txt')
#t2 = mem.consumptionTimeline(m2)
#plt.plot(t2[:, 0] / 1e9, t2[:, 1], label='Noeud 1, Issend')

plt.xlabel('Temps (s)')
plt.ylabel('Memoire (o)')
plt.legend(loc='lower right')

plt.show()

In [30]:
import pandas as pd

In [33]:
%time a = pd.read_csv('/Users/lize/data_these/cone_sphere/memory-000.shared.txt', delimiter=' ')


CPU times: user 2.91 s, sys: 188 ms, total: 3.1 s
Wall time: 3.1 s

In [32]:
%time np.genfromtxt('/Users/lize/data_these/cone_sphere/memory-000.shared.txt', delimiter=' ')


CPU times: user 38.9 s, sys: 1.73 s, total: 40.6 s
Wall time: 40.6 s
Out[32]:
array([[  0.00000000e+00,   3.76000000e+03],
       [  4.86500000e+04,   1.87200000e+03],
       [  1.32650000e+05,   1.87200000e+03],
       ..., 
       [  1.01649573e+11,  -2.78480000e+04],
       [  1.01649573e+11,  -2.78480000e+04],
       [  1.01649574e+11,  -2.78480000e+04]])

In [34]:
a.values


Out[34]:
array([[       48650,         1872],
       [      132650,         1872],
       [      580664,         3760],
       ..., 
       [101649572750,       -27848],
       [101649573266,       -27848],
       [101649573747,       -27848]])

In [61]:
(2700 * 13.4 + 2000 * 13 - 10000) / 1.5


Out[61]:
34786.666666666664

In [7]:
plt.figure()
plotMemory('/Users/lize/data_these/cone_sphere/memory-000.txt')
plotMemory('/Users/lize/data_these/cone_sphere/memory-000.runtime.txt')
plt.show()

In [7]:
a = np.genfromtxt('/Users/lize/data_these/cone_sphere/data_size.txt')

plt.figure()
plotMemory('/Users/lize/data_these/cone_sphere/memory-000.txt')

#plotMemory('/Users/lize/data_these/cone_sphere/data_read.txt')
#plotMemory('/Users/lize/data_these/cone_sphere/data_written.txt')

#plt.plot(a[:, 0] / 1e9, a[:, 1], 'r.', markersize=.1)
plt.ylim(ymin=0)

plt.show()

In [10]:
a = np.genfromtxt('/Users/lize/data_these/cone_sphere/data_size.txt')
a.shape


Out[10]:
(107702, 2)

In [21]:
plt.show()

In [26]:
plt.figure(figsize=(14,6))
plt.title(u'Consommation mémoire Assemblage + $LU$')
plt.xlabel("Temps (s)")
plt.ylabel(u"Mémoire (o)")
plotMemory('/Users/lize/data_these/cone_sphere/memory-eager.txt', 'Eager')
plotMemory('/Users/lize/data_these/cone_sphere/memory-prio-bad.txt', 'Prio')
plotMemory('/Users/lize/data_these/cone_sphere/memory-prio-good.txt', 'Prio + Added deps')
plt.ylim(ymin=0)
plt.legend()
plt.savefig('/Users/lize/data_these/cone_sphere/eager-prio-good.png', dpi=300)
#plt.show()

In [4]:
plt.figure(figsize=(14,6))
plt.title(u'Consommation mémoire Assemblage + $LU$, avec "flush"')
plt.xlabel("Temps (s)")
plt.ylabel(u"Mémoire (o)")
plotMemory('/Users/lize/data_these/cone_sphere/memory-shared.txt', 'no OOC flush')
plotMemory('/Users/lize/data_these/cone_sphere/memory-000.txt', 'OOC flush')
#plotMemory('/Users/lize/data_these/cone_sphere/memory-mpi-flush.txt', 'MPI, p = 2, avec flush')

#plotMemory('/Users/lize/data_these/cone_sphere/memory-prio-bad.txt', 'Prio')
#plotMemory('/Users/lize/data_these/cone_sphere/memory-prio-good.txt', 'Prio + Added deps')
plt.ylim(ymin=0)
plt.legend(loc='upper left')
plt.savefig('/Users/lize/data_these/cone_sphere/ooc-flush.png', dpi=300)
plt.show()

In [ ]: