示例#1
0
               ylabel='Parallel efficiency w.r.t. %d cores' % nprocs[0],
               xaxis='np',
               xlabel=xlabel,
               xticklabels=args.parallel,
               groups=groups,
               regions=regions,
               kinds='semilogx',
               axis='tight',
               title='',
               labels=labels,
               transform=efficiency,
               ymin=0)


if __name__ == '__main__':
    p = parser(description="Performance benchmark for 2D eigenmode test.")
    p.add_argument('mode',
                   choices=('strong', 'error', 'comparison'),
                   nargs='?',
                   default='scaling',
                   help='determines type of plot to generate')
    p.add_argument('--dim',
                   type=int,
                   default=3,
                   help='problem dimension to plot')
    p.add_argument('-N',
                   '--size',
                   type=int,
                   nargs='+',
                   default=[32],
                   help='mesh sizes to plot')
示例#2
0
            self.plot(figsize=self.figsize, format='pdf', figname='PropCC_%s'%region,
                      xaxis='opt_level', xvals=opt_level, xticklabels=opt_str,
                      xlabel='Compiler configuration', groups=groups, regions=[region],
                      kinds='bar', title='Performance: %s'%region, legend={'loc': 'best'})

    def plot_parallel_scaling(self, nthreads):
        groups = ['compiler', 'opt_level', 'affinity']
        for region in self.profileregions:
            self.plot(figsize=self.figsize, format='pdf', figname='PropOMP_%s'%region,
                      xaxis='nthreads', xticklabels=nthreads, xlabel='Number of threads',
                      regions=[region], groups=groups, xmax=nthreads[-1], trendline='Perfect speedup',
                      kinds='loglog', title='Performance: %s'%region, legend={'loc': 'best'})


if __name__ == '__main__':
    p = parser(description="Performance benchmark plotter for 3D Propagator test.")
    p.add_argument('--basename', type=str, nargs='+',
                   help='Name of test used for benchmarking')
    p.add_argument('--compiler', type=str, nargs='+',
                   help='Compilers to compare')
    p.add_argument('--opt_level', type=int, nargs='+',
                   help='Compiler optimisation levels to compare')
    p.add_argument('--affinity', type=str, nargs='+',
                   help='Parallel thread affintiy setting used')
    args = p.parse_args()
    basename = args.basename or ['test3d']
    compiler = args.compiler or ['g++', 'clang', 'icpc']
    opt_level = args.opt_level or [2, 3]
    nthreads = args.parallel or [1]
    affinity = args.affinity or ['close']
示例#3
0
        'diffusion RHS': {
            'marker': 'v'
        },
        'advection solve': {
            'marker': 's'
        },
        'diffusion solve': {
            'marker': 'D'
        }
    }
    profilegraph = {'format': 'svg,pdf', 'node_threshold': 2.0}
    profileregions = regions


if __name__ == '__main__':
    p = parser(description="Plot results for advection-diffusion benchmark")
    p.add_argument('-d',
                   '--degree',
                   type=int,
                   nargs='+',
                   help='polynomial degrees to plot')
    p.add_argument('-m',
                   '--size',
                   type=int,
                   nargs='+',
                   help='mesh sizes to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    args = p.parse_args()
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    degrees = args.degree or [1, 2, 3]
示例#4
0
from pybench import parser, Benchmark
import pylab as plt


class PlutoPlot(Benchmark):
    """
    example: python tests/pluto_plot.py -ts "2 4 8" "4 4 1000" "default" "nopluto"
    """

    figsize = (6, 4)


if __name__ == '__main__':
    p = parser(description="pluto performance benchmark for different tile sizes ")
    p.add_argument('-ts', '--tile_size', type=str, nargs='+',
                   help='tile sizes to plot')

    args = p.parse_args()
    ts = args.tile_size
    b = PlutoPlot(benchmark='pluto_tile_bench', resultsdir=args.resultsdir, plotdir=args.plotdir)

    b.combine_series([('tile_size', ts)], filename='pluto_tile_bench')

    res = []
    for data in b.result['timings'].values():
        del(data['total'])
        res.append(data.values()[0])

    labels_ = b.result['timings'].keys()
    labels = [x[0] for x in labels_]
示例#5
0
class Poisson(Benchmark):

    plotstyle = {'total': {'marker': '*'},
                 'mesh': {'marker': '+'},
                 'setup': {'marker': 'x'},
                 'matrix assembly': {'marker': '>'},
                 'rhs assembly': {'marker': '<'},
                 'solve': {'marker': 'D'}}
    method = 'poisson'
    benchmark = 'Poisson'
    profilegraph = {'format': 'svg,pdf',
                    'node_threshold': 2.0}
    profileregions = regions

if __name__ == '__main__':
    p = parser(description="Plot results for Poisson benchmark")
    p.add_argument('-d', '--degree', type=int, nargs='+',
                   help='polynomial degrees to plot')
    p.add_argument('-m', '--size', type=int, nargs='+',
                   help='mesh sizes to plot')
    p.add_argument('-v', '--variant', nargs='+',
                   help='variants to plot')
    p.add_argument('-b', '--base', type=int,
                   help='index of size to use as base for parallel efficiency')
    args = p.parse_args()
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    degrees = args.degree or [1, 2, 3]
    if args.sequential:
        b = Poisson(resultsdir=args.resultsdir, plotdir=args.plotdir)
        b.combine_series([('np', [1]), ('variant', variants),
示例#6
0
cells[0.026] = 62893912
vertices[0.577] = 66615
vertices[0.408] = 133342
vertices[0.316] = 223100
vertices[0.289] = 255050
vertices[0.204] = 498559
vertices[0.158] = 868981
vertices[0.144] = 1000124
vertices[0.102] = 2049232
vertices[0.072] = 4108380
vertices[0.051] = 8182936
vertices[0.036] = 16416447
vertices[0.026] = 31446948

if __name__ == '__main__':
    p = parser(description="Plot results for explicit wave benchmark")
    p.add_argument('-m', '--scale', type=float, nargs='+',
                   help='mesh scales to plot')
    p.add_argument('-v', '--variant', nargs='+',
                   help='variants to plot')
    p.add_argument('-b', '--base', type=int,
                   help='index of size to use as base for parallel efficiency')
    args = p.parse_args()
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    if args.sequential:
        b = Wave(resultsdir=args.resultsdir, plotdir=args.plotdir)
        b.combine_series([('np', [1]), ('scale', args.scale or scale),
                          ('variant', variants)])
        b.plot(xaxis='scale', regions=regions, xlabel='mesh size (cells)',
               xvalues=cells, kinds='plot,loglog', groups=groups,
示例#7
0
                      format='pdf',
                      figname='PropOMP_%s' % region,
                      xaxis='nthreads',
                      xticklabels=nthreads,
                      xlabel='Number of threads',
                      regions=[region],
                      groups=groups,
                      xmax=nthreads[-1],
                      trendline='Perfect speedup',
                      kinds='loglog',
                      title='Performance: %s' % region,
                      legend={'loc': 'best'})


if __name__ == '__main__':
    p = parser(
        description="Performance benchmark plotter for 3D Propagator test.")
    p.add_argument('--basename',
                   type=str,
                   nargs='+',
                   help='Name of test used for benchmarking')
    p.add_argument('--compiler',
                   type=str,
                   nargs='+',
                   help='Compilers to compare')
    p.add_argument('--opt_level',
                   type=int,
                   nargs='+',
                   help='Compiler optimisation levels to compare')
    p.add_argument('--affinity',
                   type=str,
                   nargs='+',
示例#8
0
class CahnHilliard(Benchmark):

    method = 'cahn_hilliard'
    benchmark = 'CahnHilliard'
    plotstyle = {'total': {'marker': '*'},
                 'mesh': {'marker': 's'},
                 'initial condition': {'marker': 'D'},
                 'Assemble cells': {'marker': '^'},
                 'SNES solver execution': {'marker': 'o'}}
    profilegraph = {'format': 'svg,eps',
                    'node_threshold': 2.0}
    profileregions = ['setup', 'initial condition', 'timestepping']

if __name__ == '__main__':
    p = parser(description="Plot results for CahnHilliard benchmark")
    p.add_argument('-m', '--size', type=int, nargs='+',
                   help='mesh sizes to plot')
    p.add_argument('-r', '--region', nargs='+', help='regions to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b', '--base', type=int,
                   help='index of size to use as base for parallel efficiency')
    args = p.parse_args()
    regions = args.region or regions
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    aggregate = {'Assemble cells': ['Assemble cells', 'Apply (PETScVector)', 'Apply (PETScMatrix)']}
    if args.sequential:
        b = CahnHilliard(resultsdir=args.resultsdir, plotdir=args.plotdir)
        b.combine_series([('np', [1]), ('variant', variants), ('size', args.size or sizes)],
                         aggregate=aggregate)
                 'mesh': {'marker': '+'},
                 'setup': {'marker': 'x'},
                 'matrix assembly': {'marker': 'p'},
                 'timestepping': {'marker': 'o'},
                 'tentative velocity RHS': {'marker': '^'},
                 'tentative velocity solve': {'marker': 'v'},
                 'pressure correction RHS': {'marker': 's'},
                 'pressure correction solve': {'marker': 'D'},
                 'velocity correction RHS': {'marker': '>'},
                 'velocity correction solve': {'marker': '<'}}
    profilegraph = {'format': 'svg,pdf',
                    'node_threshold': 2.0}
    profileregions = ['matrix assembly'] + map(' '.join, product(r1, r2))

if __name__ == '__main__':
    p = parser(description="Plot results for Navier-Stokes benchmark")
    p.add_argument('-m', '--scale', type=float, nargs='+',
                   help='mesh scales to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b', '--base', type=int,
                   help='index of size to use as base for parallel efficiency')
    p.add_argument('-r', '--region', nargs='+', help='regions to plot')
    args = p.parse_args()
    regions = args.region or map(' '.join, product(r1, r2))
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    scales = args.scale or scale
    if args.sequential:
        b = NavierStokes(resultsdir=args.resultsdir, plotdir=args.plotdir)
        b.combine_series([('np', [1]), ('scale', scales), ('variant', variants)])
        b.plot(xaxis='scale', regions=regions, xlabel='DOFs', groups=groups,
示例#10
0
from pybench import parser, Benchmark
import pylab as plt


class PlutoPlot(Benchmark):
    """
    example: python tests/pluto_plot.py -ts "2 4 8" "4 4 1000" "default" "nopluto"
    """

    figsize = (6, 4)


if __name__ == '__main__':
    p = parser(
        description="pluto performance benchmark for different tile sizes ")
    p.add_argument('-ts',
                   '--tile_size',
                   type=str,
                   nargs='+',
                   help='tile sizes to plot')

    args = p.parse_args()
    ts = args.tile_size
    b = PlutoPlot(benchmark='pluto_tile_bench',
                  resultsdir=args.resultsdir,
                  plotdir=args.plotdir)

    b.combine_series([('tile_size', ts)], filename='pluto_tile_bench')

    res = []
    for data in b.result['timings'].values():
示例#11
0
        'pressure correction solve': {
            'marker': 'D'
        },
        'velocity correction RHS': {
            'marker': '>'
        },
        'velocity correction solve': {
            'marker': '<'
        }
    }
    profilegraph = {'format': 'svg,pdf', 'node_threshold': 2.0}
    profileregions = ['matrix assembly'] + map(' '.join, product(r1, r2))


if __name__ == '__main__':
    p = parser(description="Plot results for Navier-Stokes benchmark")
    p.add_argument('-m',
                   '--scale',
                   type=float,
                   nargs='+',
                   help='mesh scales to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b',
                   '--base',
                   type=int,
                   help='index of size to use as base for parallel efficiency')
    p.add_argument('-r', '--region', nargs='+', help='regions to plot')
    args = p.parse_args()
    regions = args.region or map(' '.join, product(r1, r2))
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
示例#12
0
        },
        'rhs assembly': {
            'marker': '<'
        },
        'solve': {
            'marker': 'D'
        }
    }
    method = 'poisson'
    benchmark = 'Poisson'
    profilegraph = {'format': 'svg,pdf', 'node_threshold': 2.0}
    profileregions = regions


if __name__ == '__main__':
    p = parser(description="Plot results for Poisson benchmark")
    p.add_argument('-d',
                   '--degree',
                   type=int,
                   nargs='+',
                   help='polynomial degrees to plot')
    p.add_argument('-m',
                   '--size',
                   type=int,
                   nargs='+',
                   help='mesh sizes to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b',
                   '--base',
                   type=int,
                   help='index of size to use as base for parallel efficiency')
class CahnHilliard(Benchmark):

    method = 'cahn_hilliard'
    benchmark = 'CahnHilliard'
    plotstyle = {'total': {'marker': '*'},
                 'mesh': {'marker': 's'},
                 'initial condition': {'marker': 'D'},
                 'Assemble cells': {'marker': '^'},
                 'SNES solver execution': {'marker': 'o'}}
    profilegraph = {'format': 'svg,pdf',
                    'node_threshold': 2.0}
    profileregions = ['setup', 'initial condition', 'timestepping']

if __name__ == '__main__':
    p = parser(description="Plot results for CahnHilliard benchmark")
    p.add_argument('-m', '--size', type=int, nargs='+',
                   help='mesh sizes to plot')
    p.add_argument('-r', '--region', nargs='+', help='regions to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b', '--base', type=int,
                   help='index of size to use as base for parallel efficiency')
    args = p.parse_args()
    regions = args.region or regions
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    aggregate = {'Assemble cells': ['Assemble cells', 'Apply (PETScVector)', 'Apply (PETScMatrix)']}
    if args.sequential:
        b = CahnHilliard(resultsdir=args.resultsdir, plotdir=args.plotdir)
        b.combine_series([('np', [1]), ('variant', variants), ('size', args.size or sizes)],
                         aggregate=aggregate)
示例#14
0
cells[0.026] = 62893912
vertices[0.577] = 66615
vertices[0.408] = 133342
vertices[0.316] = 223100
vertices[0.289] = 255050
vertices[0.204] = 498559
vertices[0.158] = 868981
vertices[0.144] = 1000124
vertices[0.102] = 2049232
vertices[0.072] = 4108380
vertices[0.051] = 8182936
vertices[0.036] = 16416447
vertices[0.026] = 31446948

if __name__ == '__main__':
    p = parser(description="Plot results for explicit wave benchmark")
    p.add_argument('-m',
                   '--scale',
                   type=float,
                   nargs='+',
                   help='mesh scales to plot')
    p.add_argument('-v', '--variant', nargs='+', help='variants to plot')
    p.add_argument('-b',
                   '--base',
                   type=int,
                   help='index of size to use as base for parallel efficiency')
    args = p.parse_args()
    variants = args.variant or ['Firedrake', 'DOLFIN']
    groups = ['variant'] if len(variants) > 1 else []
    if args.sequential:
        b = Wave(resultsdir=args.resultsdir, plotdir=args.plotdir)