In [12]:
import sys,os
import numpy as np
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
#this works apparently only for savefig stuff
mpl.rcParams['figure.figsize']=(6.0,4.0) #(6.0,4.0)
mpl.rcParams['font.size']=10 #10
mpl.rcParams['savefig.dpi']=400 #72
mpl.rcParams['figure.subplot.bottom']=.1 #.125
plt.rc('font', family='serif')
plt.rc('text', usetex=True)
#inline Shit
%matplotlib inline
%config InlineBackend.figure_format='png'
%config InlineBackend.rc = {'figure.facecolor': 'white', 'figure.subplot.bottom': 0.125, 'figure.edgecolor': 'white', 'savefig.dpi': 400, 'figure.figsize': (12.0, 8.0), 'font.size': 10}
#GUi shit
%matplotlib tk
mpl.get_configdir()
Out[12]:
In [15]:
bodies = [10e3,100e3,500e3,1e6,10e6]
colors =['r','b','g','k','y']
for i, b in enumerate(bodies):
nB = b
typeSize = 8;
bytesPerState= (7+6)*typeSize
mbytesPerTimeStep = nB*bytesPerState + 1*typeSize;
print(mbytesPerTimeStep)
mbytesPerTimeStep / (1024*1024)
deltaT = 1/30
print("deltaT:", deltaT)
timeEnd = 10;
nTS = timeEnd/deltaT
print("nTS:", nTS)
# #Method 3
# deltaTList = np.linspace(0.001,0.04,300)
# bytesMethod3Total = (float(timeEnd)/deltaTList * (bytesPerState + 1*typeSize) * nB) / (1024**3)
# plt.plot(deltaTList,bytesMethod3Total, colors[i]+'-', label="One File per Body (nB: %d k)" % (nB/1000))
#Method 1/2
deltaTList = np.linspace(0.001,0.04,300)
bytesMethod3Total = (float(timeEnd)/deltaTList * mbytesPerTimeStep) / (1024**3)
plt.plot(deltaTList,bytesMethod3Total, colors[i]+'--', label="Single File (nB: %d k)" % (nB/1000))
ax = plt.gca()
ax.grid()
ax.minorticks_on()
ax.set_title("Data Consumption for Simulation")
ax.set_xlabel(r'$\Delta$T')
ax.set_ylabel("Gb of Data")
#ax.set_yscale('log')
ax.set_xscale('log')
ax.legend()
Out[15]:
In [20]:
plt.close('all')
bodies = [10e3,100e3,500e3,1e6,2e6]
colors =['r','b','g','k','y']
for i, b in enumerate(bodies):
nB = b
typeSize = 8;
bytesPerState= (7+6)*typeSize
mbytesPerTimeStep = nB*bytesPerState + 1*typeSize;
print(mbytesPerTimeStep)
mbytesPerTimeStep / (1024*1024)
deltaT = 1/30
print("deltaT:", deltaT)
timeEnd = 10;
nTS = timeEnd/deltaT
print("nTS:", nTS)
# #Method 3
# deltaTList = np.linspace(0.001,0.04,300)
# bytesMethod3Total = (float(timeEnd)/deltaTList * (bytesPerState + 1*typeSize) * nB) / (1024**3)
# plt.plot(deltaTList,bytesMethod3Total, colors[i]+'--', label="One File per Body (nB: %d k)" % (nB/1000))
#Method 1/2
deltaTList = np.linspace(0.001,0.04,300)
bytesMethod3Total = (float(timeEnd)/deltaTList * mbytesPerTimeStep) / (1024**3)
plt.plot(deltaTList,bytesMethod3Total, colors[i]+'-', label="Single File (nB: %d k)" % (nB/1000))
ax = plt.gca()
ax.grid()
ax.minorticks_on()
ax.set_title("Data Consumption for Simulation")
ax.set_xlabel(r'$\Delta$T')
ax.set_ylabel("Gb of Data")
#ax.set_yscale('log')
#ax.set_xscale('log')
ax.legend()
plt.show()
In [5]:
Out[5]:
In [5]: