# create legend methods = [] artists = [] for method in benchmarks.method2format: methods.append(method) artists.append( Line2D((0,0),(0,1), **benchmarks.method2format[method])) legend() #################### # COMPLEXITY #################### data = benchmarks.read('complexity.xml') all_methods = data['methods'] all_cores = data['cores'] all_tolerances = data['tolerances'] all_charges = data['charges'] timing = data['timing'] cores = 1 ixcor = all_cores.index(cores) tolerance = 1e-3 ixtol = all_tolerances.index(tolerance) figure('Complexity') for method in data['methods']: time_per_particle = \ timing[method][:, ixtol, ixcor] / all_charges
import benchmarks import matplotlib.pylab as plt from matplotlib.image import NonUniformImage import numpy tolerance = 1e-3 interpolation='bicubic' levels = numpy.arange(-4,4) all_charges, all_tolerances, all_cores, timing, speedup, efficiency = \ benchmarks.read('3d-periodic/bm_cloud_wall_jugene.xml') ixtol = all_tolerances.index(tolerance) charges = numpy.array(all_charges)[::-1] cores = numpy.array(all_cores) Z = numpy.log(timing['p2nfft'][:,ixtol,:]) plt.subplot(221) plt.imshow(Z, origin='lower', interpolation='nearest') cbar = plt.colorbar(ticks=levels) cbar.ax.set_yticklabels(10.0**levels) plt.xticks(numpy.arange(len(cores)), cores) plt.xlabel('#cores') plt.yticks(numpy.arange(len(charges)), charges[::-1]) plt.ylabel('#charges') plt.grid(True) plt.subplot(223) plt.contourf(Z, levels=levels, origin='lower', interpolation=interpolation) cbar = plt.colorbar(ticks=levels) cbar.ax.set_yticklabels(10.0**levels)
import benchmarks from matplotlib.pylab import * from numpy import * testcase = 'cloud_wall_scaling_jugene.xml' all_charges, all_tolerances, all_cores, timing = benchmarks.read(testcase) def plot_timing(testcase, charges, tolerance): ixcha = all_charges.index(charges) ixtol = all_tolerances.index(tolerance) methods = timing.keys() methods.sort() for method in methods: data = timing[method] if not all(isnan(data[ixcha, ixtol, :])): loglog(all_cores, data[ixcha, ixtol, :], label=method, **benchmarks.fmt(method)) # legend() xlabel('#cores') ylabel('Time [s]') def plot_efficiency(testcase, charges, tolerance): ixcha = all_charges.index(charges)
def create_legend(): # create legend methods = [] artists = [] for method in benchmarks.method2format: methods.append(method) artists.append( Line2D((0, 0), (0, 1), **benchmarks.method2format[method])) legend() #################### # COMPLEXITY #################### data = benchmarks.read('complexity.xml') all_methods = data['methods'] all_cores = data['cores'] all_tolerances = data['tolerances'] all_charges = data['charges'] timing = data['timing'] cores = 1 ixcor = all_cores.index(cores) tolerance = 1e-3 ixtol = all_tolerances.index(tolerance) figure('Complexity') for method in data['methods']: time_per_particle = \ timing[method][:, ixtol, ixcor] / all_charges
import benchmarks from matplotlib.pylab import * from numpy import * testcase = 'cloud_wall_scaling_jugene.xml' all_charges, all_tolerances, all_cores, timing = benchmarks.read(testcase) def plot_timing(testcase, charges, tolerance): ixcha = all_charges.index(charges) ixtol = all_tolerances.index(tolerance) methods = timing.keys() methods.sort() for method in methods: data = timing[method] if not all(isnan(data[ixcha,ixtol,:])): loglog(all_cores, data[ixcha,ixtol,:], label=method, **benchmarks.fmt(method)) # legend() xlabel('#cores') ylabel('Time [s]') def plot_efficiency(testcase, charges, tolerance): ixcha = all_charges.index(charges) ixtol = all_tolerances.index(tolerance) methods = timing.keys() methods.sort()
if minimal_time is None: print "No data for charges={} tolerance={}".format(charges, tolerance) return for method in methods: data = timing[method] if not all(isnan(data[ixcha,ixtol,:])): semilogx(all_cores, minimal_time/(data[ixcha,ixtol,:]*all_cores), label=method, **benchmarks.fmt(method)) # legend() xlim((1, charges/200.)) xlabel('#cores') ylabel('Efficiency') all_charges, all_tolerances, all_cores, timing = \ benchmarks.read('silica_melt_scaling_jugene.xml') sp = 1 for charges in all_charges: subplot(2, 3, sp) sp += 1 title('Jugene {} charges'.format(charges)) plot_efficiency(charges, 1e-3) subplot(231) legend() #tight_layout() show()
print "No data for charges={} tolerance={}".format(charges, tolerance) return for method in methods: data = timing[method] if not all(isnan(data[ixcha,ixtol,:])): semilogx(all_cores, minimal_time/(data[ixcha,ixtol,:]*all_cores), label=method, **benchmarks.fmt(method)) # legend() xlim((1, charges/200.)) xlabel('#cores') ylabel('Efficiency') all_charges, all_tolerances, all_cores, timing = \ benchmarks.read('silica_melt_scaling_juropa.xml') sp = 1 for charges in all_charges: subplot(2, 3, sp) sp += 1 title('Juropa, {} charges'.format(charges)) plot_efficiency(charges, 1e-3) # create legend methods = [] artists = [] for method in benchmarks.method2format: methods.append(method) artists.append( Line2D((0,0),(0,1),
return for method in methods: data = timing[method] if not all(isnan(data[ixcha, ixtol, :])): semilogx(all_cores, minimal_time / (data[ixcha, ixtol, :] * all_cores), label=method, **benchmarks.fmt(method)) # legend() xlim((1, charges / 200.)) xlabel('#cores') ylabel('Efficiency') all_charges, all_tolerances, all_cores, timing = \ benchmarks.read('silica_melt_scaling_jugene.xml') sp = 1 for charges in all_charges: subplot(2, 3, sp) sp += 1 title('Jugene {} charges'.format(charges)) plot_efficiency(charges, 1e-3) subplot(231) legend() #tight_layout() show()
import benchmarks import matplotlib.pylab as plt from matplotlib.image import NonUniformImage import numpy tolerance = 1e-3 interpolation = 'bicubic' levels = numpy.arange(-4, 4) all_charges, all_tolerances, all_cores, timing, speedup, efficiency = \ benchmarks.read('3d-periodic/bm_cloud_wall_jugene.xml') ixtol = all_tolerances.index(tolerance) charges = numpy.array(all_charges)[::-1] cores = numpy.array(all_cores) Z = numpy.log(timing['p2nfft'][:, ixtol, :]) plt.subplot(221) plt.imshow(Z, origin='lower', interpolation='nearest') cbar = plt.colorbar(ticks=levels) cbar.ax.set_yticklabels(10.0**levels) plt.xticks(numpy.arange(len(cores)), cores) plt.xlabel('#cores') plt.yticks(numpy.arange(len(charges)), charges[::-1]) plt.ylabel('#charges') plt.grid(True) plt.subplot(223) plt.contourf(Z, levels=levels, origin='lower', interpolation=interpolation) cbar = plt.colorbar(ticks=levels) cbar.ax.set_yticklabels(10.0**levels)
import benchmarks from matplotlib.pylab import * from numpy import * testcase = 'cloud_wall_scaling_juropa.xml' all_charges, all_tolerances, all_cores, timing = \ benchmarks.read(testcase) def plot_timing(charges, tolerance): ixcha = all_charges.index(charges) ixtol = all_tolerances.index(tolerance) methods = timing.keys() methods.sort() for method in methods: data = timing[method] if not all(isnan(data[ixcha,ixtol,:])): plt.loglog(all_cores, data[ixcha,ixtol,:], label=method, **benchmarks.fmt(method)) plt.legend() plt.xlim((1, charges/200.)) plt.xlabel('#cores') plt.ylabel('Time [s]') def plot_efficiency(charges, tolerance): ixcha = all_charges.index(charges) ixtol = all_tolerances.index(tolerance)
for method in methods: data = timing[method] if not all(isnan(data[ixcha, ixtol, :])): semilogx(all_cores, minimal_time / (data[ixcha, ixtol, :] * all_cores), label=method, **benchmarks.fmt(method)) # legend() xlim((1, charges / 200.)) xlabel('#cores') ylabel('Efficiency') all_charges, all_tolerances, all_cores, timing = \ benchmarks.read('silica_melt_scaling_juropa.xml') sp = 1 for charges in all_charges: subplot(2, 3, sp) sp += 1 title('Juropa, {} charges'.format(charges)) plot_efficiency(charges, 1e-3) # create legend methods = [] artists = [] for method in benchmarks.method2format: methods.append(method) artists.append(Line2D((0, 0), (0, 1), **benchmarks.method2format[method]))