Exemplo 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 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))
Exemplo n.º 3
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))
Exemplo n.º 4
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))