In [47]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
plt.style.use('bmh')
pd.set_option('display.max_rows', 200)

In [51]:
df = pd.read_csv('timing.txt', sep='\t')
#print(df)

In [55]:
fig = plt.figure(figsize=(16,12))
for ncomm in df['Ncomm'].unique():
    for ncells in df['Ncells'].unique():
        for npart in df['Nparticles'].unique():
        #for npart in [99856]:
            mask = np.logical_and(df['Nparticles']==npart, np.logical_and(df['Ncomm']==ncomm, df['Ncells']==ncells))
            x = df[mask]['Nranks']
            y = df[mask]['Time']
            plt.plot(x, y, label='%s %s %s' % (ncomm, ncells, npart))
plt.legend()
plt.yscale('log')
plt.xscale('log')
plt.xlim(1,12)


Out[55]:
(1, 12)

In [13]:
for n in df['Ncomm'].unique():
    x = df[df['Ncomm']==n]['Nranks']
    y = df[df['Ncomm']==n]['Time']
    plt.plot(x, y, label=n)
plt.legend()


Out[13]:
Nparticles Ncells Nranks Time
0 19881 210 1 6.70221
1 19881 210 2 4.26774
2 19881 210 3 3.49359
3 19881 210 4 3.03752
4 19881 210 5 2.79173
5 19881 210 6 2.74210
6 19881 210 7 2.79696
7 19881 210 8 2.95650
8 19881 210 9 3.17641
9 19881 210 10 3.22525
10 19881 210 11 3.46706
11 19881 210 12 3.50533

In [18]:
dt = 0.006
Ndt = int(1/dt)
tmax = 5
1 + int(tmax / dt / Ndt)


Out[18]:
6

In [ ]: