Ejemplo n.º 1
0
def plotall(name, strats, legend_loc):
    lines = []
    maxX = 0.0
    maxY = 0.0
    for experiment_id in ids:
        problem_name = get.problem_name_of_experiment(experiment_id)
        #print problem_name
        (maxtime, bl_avg, norms) = ets(experiment_id, n_procs)
        for strat in strats:
            lab = pretty_bench_name(problem_name)
            ns = norms
            xys = []
            for (input, pinput, avg, stddev) in ns:
                if is_ebsap(input):
                    s = param_of_strategy(input)
                    (k, v) = s.split(",")
                    x = float(k)
                else:
                    x = int(param_of_mls(input))
                    x = float(math.log(x, 2))
                y = (bl_avg / avg)
                #print (lab, avg, y, bl_avg)
                xys.append((x, y))
                maxX = max(x, maxX)
                maxY = max(y, maxY)
            xys.sort(cmp)
            lines.append((lab, xys))
    yaxvals = np.arange(0, 49, 8)
    xaxlabs = []
    for i in range(0, 15):
        xaxlabs.append(('$2^{' + str(i) + '}$'))
    line_plot.plot(
        'mls' + name,
        lines,
        14,
        49.0,
        chart_title='',
        connect_dots=True,
        #formats=['r+', 'b+', 'r-', 'b-', 'rx', 'bx', 'r^', 'b^', 'ro', 'bo'],
        linecolors=[
            '#000000', 'r', 'b', 'g', 'b', 'r', 'b', 'r', 'g', 'r', 'b', 'g',
            'r', 'b'
        ],
        formats=['b+', 'b,', 'b.', 'b1', 'b2', 'b3', 'b4', 'b<', 'b>', 'b|'],
        dashes=[
            False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, False
        ],
        yax_label='speedup',
        xax_label='$M$',
        dimensions=(35, 23),
        legend_loc=legend_loc,
        marker=(43.0, 4.0),
        yaxvals=yaxvals,
        xaxlabs=xaxlabs)
def print_compare_normalized (experiment_id, n_procs):
  problem_name=get.problem_name_of_experiment(experiment_id)
  print ("Problem: " + problem_name)
  print ("Number of Cores: " + str(n_procs))
  ((binput, bps, bspeedup, mltspeedup, mltlbsovhd, seqpmlcvsmlton, berror, lbs_ovhd, (bavg, bstddev)), norms)=compare_normalized(experiment_id, n_procs)
  print ("Best splitting strategy: " + bps + " (Error= " + human_readable.percent(berror) + "%) (Speedup vs. SeqPMLC= " + human_readable.speedup(bspeedup) + ") (Speedup vs. mlton= " + human_readable.speedup(mltspeedup) + ")")
  print ("Overhead of LBS vs. NS (PMLC)= " + human_readable.percent(lbs_ovhd)) + '%'
  print ("Overhead of LBS vs. NS (mlton)= " + human_readable.percent(mltlbsovhd))  + '%' 
  print ("Sequential PMLC vs. mlton (both NS)= " + human_readable.percent(seqpmlcvsmlton) + "%")
  print("Splitting strategy\t\tPct. slower\t\tError\t\t\tSpeedup vs. SeqPMLC\tSpeedup vs. mlton")
  for norm in norms:
    print_pt(norm)
def plotall(name, leaf_sizes, legend_loc):
    lines = []
    maxX = 0.0
    maxY = 0.0
    for experiment_id in ids:
        problem_name = get.problem_name_of_experiment(experiment_id)
        #print problem_name
        (maxtime, bl_avg, mlt_avg, mltlbsovhd, lbs_ovhd,
         norms) = compare_wall_clock(experiment_id, n_procs)
        lab = problem_name
        ns = norms
        xys = []
        print problem_name
        print ns
        print bl_avg
        print 'n_procs'
        print n_procs
        for (branch, input, pinput, avg, stddev, max_leaf_size) in ns:
            if max_leaf_size == 500:
                x = math.log(512, 2)
            else:
                x = math.log(max_leaf_size, 2)
            y = (bl_avg / avg)
            xys.append((x, y))
            maxX = max(x, maxX)
            maxY = max(y, maxY)
        xys.sort(cmp)
        print xys
        lines.append((lab, xys))
    yaxvals = np.arange(0, 49, 8)
    xaxlabs = []
    for i in range(0, 13):
        xaxlabs.append(('$2^{' + str(i) + '}$'))
    line_plot.plot(
        name,
        lines,
        maxX,
        48,
        chart_title='',
        connect_dots=True,
        #formats=['r+', 'b+', 'r-', 'b-', 'rx', 'bx', 'r^', 'b^', 'ro', 'bo'],
        formats=['b+', 'b,', 'b.', 'b1', 'b2', 'b3', 'b4', 'b<', 'b>', 'b|'],
        dashes=[
            False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, False
        ],
        yax_label='speedup',
        xax_label='leaf size',
        dimensions=(35, 23),
        legend_loc=legend_loc,
        yaxvals=yaxvals,
        xaxlabs=xaxlabs,
        marker=(43.0, 4.0))
Ejemplo n.º 4
0
def plotall(name, strats, legend_loc):
    lines = []
    maxX = 0.0
    maxY = 0.0
    for experiment_id in ids:
        problem_name = get.problem_name_of_experiment(experiment_id)
        #print problem_name
        (maxtime, bl_avg, mlt_avg, mltlbsovhd, lbs_ovhd,
         norms) = compare_wall_clock(experiment_id, n_procs)
        for strat in strats:
            lab = problem_name
            ns = [n for n in norms if id_of_strategy(n[0]) == strat[0]]
            xys = []
            for (input, pinput, avg, stddev) in ns:
                if is_ebsap(input):
                    s = param_of_strategy(input)
                    (k, v) = s.split(",")
                    x = float(k)
                else:
                    x = int(param_of_strategy(input))
                    x = float(math.log(x, 2))
#          x=x-4.0
                y = ((bl_avg / avg) / float(n_procs)) * 100.0
                #print (lab, avg, y, bl_avg)
                xys.append((x, y))
                maxX = max(x, maxX)
                maxY = max(y, maxY)
            xys.sort(cmp)
            lines.append((lab, xys))
    line_plot.plot(
        'tps' + name,
        lines,
        maxX,
        102.0,
        chart_title='',
        connect_dots=True,
        #formats=['r+', 'b+', 'r-', 'b-', 'rx', 'bx', 'r^', 'b^', 'ro', 'bo'],
        linecolors=[
            '#000000', 'r', 'b', 'g', 'b', 'r', 'b', 'r', 'g', 'r', 'b', 'g',
            'r', 'b'
        ],
        formats=['b+', 'b,', 'b.', 'b1', 'b2', 'b3', 'b4', 'b<', 'b>', 'b|'],
        dashes=[
            False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, False
        ],
        yax_label='parallel efficiency',
        xax_label='SST (log scale)',
        dimensions=(35, 23),
        legend_loc=legend_loc,
        marker=(43.0, 4.0))
Ejemplo n.º 5
0
def compare(experiment_id):
    speedup_args = []
    ssts = (1, 128, 16384)
    ks = (1, 2)
    sstpars = ([], [], [])
    ebsappars = ([], [])
    lbspars = []
    for n_procs in (1, 8, 16, 24, 32, 42, 48):
        (maxtime, bl_avg, mlt_avg, mltlbsovhd, lbs_ovhd,
         norms) = r.compare_wall_clock(experiment_id, n_procs)
        for i in (0, 1, 2):
            sst = ssts[i]
            xinput = "-chunking-policy ETS " + str(sst)
            for (input, ps, avg, stddev) in norms:
                if input == xinput:
                    sstparsi = sstpars[i]
                    sstparsi.append((n_procs, avg))
        for i in [1]:
            k = ks[i]
            xinput = "-splitting-strategy ebs-ap " + str(k) + " 4"
            for (input, ps, avg, stddev) in norms:
                if input == xinput:
                    ebsapparsi = ebsappars[i]
                    ebsapparsi.append((n_procs, avg))
        for (input, ps, avg, stddev) in norms:
            if r.is_lbs1(input):
                lbspars.append((n_procs, avg))
    speedup_args.append(("LTS", bl_avg, lbspars))
    speedup_args.append(("ETS ($SST=2^0$)", bl_avg, sstpars[0]))
    speedup_args.append(("ETS ($SST=2^7$)", bl_avg, sstpars[1]))
    speedup_args.append(("ETS ($SST=2^{14}$)", bl_avg, sstpars[2]))
    #    speedup_args.append(("EBS AP (K=1 V=4)", bl_avg, ebsappars[0]))
    #    speedup_args.append(("EBS AP (K=2 V=4)", bl_avg, ebsappars[1]))
    ylab = 'speedup'
    bench_name = get.problem_name_of_experiment(experiment_id)
    xaxlabs = (0, 8, 16, 24, 32, 40, 48)
    yaxvals = (0, 8, 16, 24, 32, 40, 48)
    plot(bench_name + '-speedups',
         speedup_args,
         chart_title='',
         yax_label=ylab,
         connect_dots=True,
         dimensions=(35, 23),
         prefix='.',
         formats=['r.', 'bx', 'b+', 'b1', 'b,', 'b4', 'b2', 'b<', 'b>', 'b|'],
         yaxvals=yaxvals,
         xaxlabs=xaxlabs,
         marker=(80.0, 5.0))
Ejemplo n.º 6
0
def plotall(name, leaf_sizes, legend_loc):
    lines = []
    maxX = 0.0
    maxY = 0.0
    for experiment_id in ids:
        problem_name = get.problem_name_of_experiment(experiment_id)
        #print problem_name
        (maxtime, bl_avg, mlt_avg, mltlbsovhd, lbs_ovhd,
         norms) = compare_wall_clock(experiment_id, n_procs)
        lab = problem_name
        ns = [n for n in norms if id_of_strategy(n[1]) == "lbs"]
        xys = []
        print problem_name
        print ns
        print bl_avg
        for (branch, input, pinput, avg, stddev, max_leaf_size) in ns:
            if max_leaf_size == 500:
                x = math.log(512, 2)
            else:
                x = math.log(max_leaf_size, 2)
            y = ((bl_avg / avg) / float(n_procs)) * 100.0
            xys.append((x, y))
            maxX = max(x, maxX)
            maxY = max(y, maxY)
        xys.sort(cmp)
        print xys
        lines.append((lab, xys))
    line_plot.plot(
        name,
        lines,
        maxX,
        150.0,
        chart_title='',
        connect_dots=True,
        #formats=['r+', 'b+', 'r-', 'b-', 'rx', 'bx', 'r^', 'b^', 'ro', 'bo'],
        formats=['b+', 'b,', 'b.', 'b1', 'b2', 'b3', 'b4', 'b<', 'b>', 'b|'],
        dashes=[
            False, False, False, False, False, False, False, False, False,
            False, False, False, False, False, False
        ],
        yax_label='parallel efficiency',
        xax_label='Max leaf size (log_2 scale)',
        dimensions=(35, 23),
        legend_loc=legend_loc,
        marker=(43.0, 4.0))
Ejemplo n.º 7
0
# Adam Shaw, November 2009
# run this with 'python speedup.py'

# Please see EDIT ME! below for customization.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
import utils
import rope_splitting_experiment as r
import collect_data as get
import human_readable as h
import speedups as spds

for experiment_id in spds.ids:
    (maxtime, bl_avg, mlt_avg, mltlbsovhd, lbs_ovhd,
     norms) = r.compare_wall_clock(experiment_id, 48)
    problem_name = get.problem_name_of_experiment(experiment_id)
    problem_name = r.pretty_bench_name(problem_name)
    (input, ps, lbs_avg,
     lbs_std) = filter(lambda (input, ps, avg, err): r.is_lbs1(input),
                       norms)[0]
    lbs_speedup = bl_avg / lbs_avg
    print(problem_name + " & " + h.speedup(mlt_avg, digits=2) + " & " +
          h.speedup(bl_avg, digits=2) + " & " + h.speedup(lbs_ovhd, digits=2) +
          " & " + h.speedup(lbs_avg, digits=2) + " & " +
          h.speedup(lbs_speedup, digits=2) + "\\\\")