示例#1
0
def generate_processors(jgraphs, benchmark, stat, ylabel, transformation,
                        ymax):
    ## Generate number of processors vs performance (one graph per bandwidth)
    for bandwidth in bandwidth_list:
        lines = []
        for module in modules_list:
            points = []
            counter = 2
            for processor in processor_list:
                data = get_data(benchmark,
                                processor=processor,
                                module=module,
                                bandwidth=bandwidth,
                                stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    points.append(
                        [counter, value, value - stddev, value + stddev])
                counter += 1

            lines.append([module] + points)

        transformation(lines)
        xlabel = "processor count"
        jgraphs.append(
            mfgraph.line_graph(
                lines,
                title="%s vs %s - %d bandwidth" % (xlabel, ylabel, bandwidth),
                xlabel=xlabel,
                ylabel=ylabel,
                ymax=ymax,
                xmin=1.9,
            ))
示例#2
0
def generate_bandwidth(jgraphs, benchmark, stat, ylabel, transformation, ymax):
    ## Generate bandwidth available vs performance (one graph per processor count)
    for processor in processor_list:
        lines = []
        for module in modules_list:
            points = []
            for bandwidth in bandwidth_list:
                data = get_data(benchmark,
                                processor=processor,
                                module=module,
                                bandwidth=bandwidth,
                                stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    points.append(
                        [bandwidth, value, value + stddev, value - stddev])
            lines.append([module] + points)

        transformation(lines)
        xlabel = "endpoint bandwidth available (MB/second)"
        jgraphs.append(
            mfgraph.line_graph(lines,
                               title="%s: %d processors" %
                               (benchmark, processor),
                               ymax=ymax,
                               xlabel=xlabel,
                               ylabel=ylabel,
                               xlog=10,
                               xmin=90.0))
示例#3
0
def generate_processors(jgraphs, benchmark, stat, ylabel, transformation, ymax):
    ## Generate number of processors vs performance (one graph per bandwidth)
    for bandwidth in bandwidth_list:
        lines = []
        for module in modules_list:
            points = []
            counter = 2
            for processor in processor_list:
                data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    points.append([counter, value, value - stddev, value + stddev])
                counter += 1
                    
            lines.append([module] + points)

        transformation(lines)
        xlabel = "processor count"
        jgraphs.append(mfgraph.line_graph(lines,
                                          title = "%s vs %s - %d bandwidth" % (xlabel, ylabel, bandwidth),
                                          xlabel = xlabel,
                                          ylabel = ylabel,
                                          ymax = ymax,
                                          xmin = 1.9,
                                          ))
示例#4
0
def generate_macro_bar():
    processor = 16
    bandwidth = 1600
    stat = "Ruby_cycles"

    stacks = []
    for benchmark in benchmarks[1:]:
        bars = []
        modules = ["MOSI_bcast_opt_4", "MOSI_GS_4", "MOSI_mcast_aggr_4"]
        #norm = mfgraph.average(get_data(benchmark, processor=processor, module="MOSI_mcast_aggr_4", bandwidth=bandwidth, stat=stat))
        norm = mfgraph.average(get_data(benchmark, processor=processor, module="MOSI_bcast_opt_4", bandwidth=bandwidth, stat=stat))
        for module in modules:

            if module == "MOSI_mcast_aggr_4":
                bars.append(["", 0])
            else:
                data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat)
                value = mfgraph.average(data)
                stddev = mfgraph.stddev(data)
                if (stddev/value)*100.0 > 1.0: # only plot error bars if they are more than 1%
                    bars.append([protocol_name[module], [norm/value, norm/(value+stddev), norm/(value-stddev)]])
                else:
                    bars.append([protocol_name[module], [norm/value, norm/(value+stddev), norm/(value-stddev)]])
    #                bars.append([protocol_name[module], norm/value])
        stacks.append([workload_name[benchmark]] + bars)
    jgraph_input = mfgraph.stacked_bar_graph(stacks,
                                             colors = ["1 0 0", "0 .5 0", "0 0 1", "0 1 1", "1 0 1"],
#                                             colors = [".85 .85 .85", ".5 .5 .5", ".45 .45 .45"],
                                             patterns = ["solid", "stripe -45"],
                                             ymax = 1.5,
                                             xsize = 2.7,
                                             ysize = 2.3,
                                             label_fontsize = "9",
                                             hash_label_fontsize = "9",
                                             stack_name_font_size = "9",
                                             bar_name_font_size = "9",
                                             bar_name_rotate = 90.0,
                                             stack_name_location = 28.0,
                                             ylabel = "normalized performance",
                                             yhash = 0.2,
                                             ymhash = 1,
                                             )
    mfgraph.run_jgraph(jgraph_input, "bash-macro-talk-bars")
示例#5
0
def gen_protocol(benchmarks):
#    configs = ["8p-perfect", "8p-MOSI_bcast_opt", "8p-MOSI_GS"]
    configs = ["8p-MOSI_bcast_opt", "8p-MOSI_GS"]

    base_config = "8p-MOSI_bcast_opt"

    parameter = "Ruby_cycles"

    stacks = [];
    print "parsing..."
    for benchmark in benchmarks:
        assoc_data = {};
        for config in configs:
            sys.stderr.write("  %s %s\n" % (benchmark, config))
            numbers = []
            filenames = glob.glob(benchmark + "/*-" + config + "-*.stats")
            for filename in filenames:
                lines = mfgraph.grep(filename, parameter);
                line = lines[0]
                numbers.append(float(string.split(line)[1]))
            print numbers
            med = mfgraph.median(numbers)
            stddev = mfgraph.stddev(numbers)
            min_val = min(numbers)
            max_val = max(numbers)
            assoc_data[config] = [med, min_val, max_val];
        mfgraph.normalize(assoc_data, base_config)

        bars = []
        stack_data = [benchmark]
        for config in configs:
            bars.append([config, assoc_data[config]])
        stacks.append([benchmark] + bars)
    print "done."

    print stacks

    return [mfgraph.stacked_bar_graph(stacks,
                                      title = "Snooping vs Directory",
                                      ylabel = "normalized runtime",
                                      colors = [".5 .5 1"],
                                      patterns = ["solid"])]
示例#6
0
def generate_bandwidth(jgraphs, benchmark, stat, ylabel, transformation, ymax):
    ## Generate bandwidth available vs performance (one graph per processor count)
    for processor in processor_list:
        lines = []
        for module in modules_list:
            points = []
            for bandwidth in bandwidth_list:
                data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    points.append([bandwidth, value, value+stddev, value-stddev])
            lines.append([module] + points)

        transformation(lines)
        xlabel = "endpoint bandwidth available (MB/second)"
        jgraphs.append(mfgraph.line_graph(lines,
                                          title = "%s: %d processors" % (benchmark, processor),
                                          ymax = ymax,
                                          xlabel = xlabel,
                                          ylabel = ylabel,
                                          xlog = 10,
                                          xmin = 90.0
                                          ))
示例#7
0
def generate_macro(scale, benchmarks, stat, ylabel, transformation, ymax):
    cols = 3
    row_space = 2.2
    col_space = 2.3
    jgraph_input = ""
    num = 0
    ## Generate bandwidth available vs performance (one graph per processor count)
    for benchmark in benchmarks:
        processor = 16
        lines = []
        if scale == 4:
            modules = "MOSI_bcast_opt_4", "MOSI_mcast_aggr_4", "MOSI_GS_4",

        if scale == 1:
            modules = "MOSI_bcast_opt_1", "MOSI_mcast_aggr_1", "MOSI_GS_1",

        for module in modules:
            points = []
            for bandwidth in bandwidth_list:
                if bandwidth < 600:
                    continue
                if bandwidth > 12800:
                    continue
                data = get_data(benchmark,
                                processor=processor,
                                module=module,
                                bandwidth=bandwidth,
                                stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    if (
                            stddev / value
                    ) * 100.0 > 1.0 and benchmark != "microbenchmark":  # only plot error bars if they are more than 1%
                        points.append(
                            [bandwidth, value, value + stddev, value - stddev])
                    else:
                        points.append([bandwidth, value])

            lines.append([protocol_name[module]] + points)

        transformation(lines)

        # don't plot marks for the microbenchmark
        benchmark_marktype = ["circle"]
        if benchmark == "microbenchmark":
            benchmark_marktype = ["none"]

        xlabel = "endpoint bandwidth available (MB/second)"
        jgraph_input += mfgraph.line_graph(
            lines,
            #title = "%s: %dx%d processors" % (workload_name[benchmark], scale, processor),
            title="%s" % (workload_name[benchmark]),
            title_fontsize="10",
            title_font="Times-Roman",
            ymax=ymax,
            xlabel=xlabel,
            ylabel=ylabel,
            label_fontsize="9",
            xsize=1.8,
            ysize=1.4,
            xlog=10,
            xmin=450.0,
            xmax=12800.0,
            legend_x="2500",
            legend_y=".18",
            legend_fontsize="8",
            marktype=benchmark_marktype,
            marksize=.03,
            x_translate=(num % cols) * col_space,
            y_translate=(num / cols) * -row_space,
            ylabel_location=18.0,
        )

        if stat == "links_utilized_percent":
            jgraph_input += "newcurve clip pts 0.1 75 11000 75 linetype solid linethickness 1 marktype none gray .75\n"
            jgraph_input += "newstring x 10000 y 76 fontsize 8 : 75%\n"

        num += 1

    mfgraph.run_jgraph(
        jgraph_input,
        "bash-macrobenchmarks-%d-%s" % (scale, string.split(ylabel)[0]))
示例#8
0
def generate_macro(scale, benchmarks, stat, ylabel, transformation, ymax):
    cols = 3
    row_space = 2.2
    col_space = 2.3
    jgraph_input = ""
    num = 0
    ## Generate bandwidth available vs performance (one graph per processor count)
    for benchmark in benchmarks:
        processor = 16
        lines = []
        if scale == 4:
            modules = "MOSI_bcast_opt_4", "MOSI_mcast_aggr_4", "MOSI_GS_4", 

        if scale == 1:
            modules = "MOSI_bcast_opt_1", "MOSI_mcast_aggr_1", "MOSI_GS_1", 

        for module in modules:
            points = []
            for bandwidth in bandwidth_list:
                if bandwidth < 600:
                    continue
                if bandwidth > 12800:
                    continue
                data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat)
                if len(data) > 0:
                    value = mfgraph.average(data)
                    stddev = mfgraph.stddev(data)
                    if (stddev/value)*100.0 > 1.0 and benchmark != "microbenchmark": # only plot error bars if they are more than 1%
                        points.append([bandwidth, value, value+stddev, value-stddev])
                    else:
                        points.append([bandwidth, value])
                        
            lines.append([protocol_name[module]] + points)
            
        transformation(lines)

        # don't plot marks for the microbenchmark
        benchmark_marktype = ["circle"]
        if benchmark == "microbenchmark":
            benchmark_marktype = ["none"]
            
        xlabel = "endpoint bandwidth available (MB/second)"
        jgraph_input += mfgraph.line_graph(lines,
                                           #title = "%s: %dx%d processors" % (workload_name[benchmark], scale, processor),
                                           title = "%s" % (workload_name[benchmark]),
                                           title_fontsize = "10",
                                           title_font = "Times-Roman",
                                           ymax = ymax,
                                           xlabel = xlabel,
                                           ylabel = ylabel,
                                           label_fontsize = "9",
                                           xsize = 1.8,
                                           ysize = 1.4,
                                           xlog = 10,
                                           xmin = 450.0,
                                           xmax = 12800.0,
                                           legend_x = "2500",
                                           legend_y = ".18",
                                           legend_fontsize = "8",
                                           marktype = benchmark_marktype,
                                           marksize = .03,
                                           x_translate = (num % cols) * col_space,
                                           y_translate = (num / cols) * -row_space,
                                           ylabel_location = 18.0,
                                           )
        
        if stat == "links_utilized_percent":
            jgraph_input += "newcurve clip pts 0.1 75 11000 75 linetype solid linethickness 1 marktype none gray .75\n"
            jgraph_input += "newstring x 10000 y 76 fontsize 8 : 75%\n"
        
        num += 1
        
    mfgraph.run_jgraph(jgraph_input, "bash-macrobenchmarks-%d-%s" % (scale, string.split(ylabel)[0]))