def generate_thinktime(jgraphs, benchmark, stat, ylabel, transformation, ymax): for bandwidth in bandwidth_list: lines = [] for module in modules_list: points = [] for think_time in think_time_list: value = mfgraph.average( get_data(benchmark, module=module, bandwidth=bandwidth, think_time=think_time, stat=stat)) if (value != []): points.append([think_time, value]) lines.append([module] + points) transformation(lines) xlabel = "think time" jgraphs.append( mfgraph.line_graph( lines, title="%s vs %s - %d bandwidth" % (xlabel, ylabel, bandwidth), xlabel=xlabel, ylabel=ylabel, ymax=ymax, ))
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))
def generate_threshold(jgraphs, benchmark, stat, ylabel, transformation, ymax): ## Generate threshold variation lines = [] for module in ["MOSI_bcast_opt", "MOSI_GS"]: points = [] for bandwidth in bandwidth_list: value = mfgraph.average(get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != []): points.append([bandwidth, value]) lines.append([module] + points) for threshold in threshold_list: points = [] for bandwidth in bandwidth_list: value = mfgraph.average(get_data(benchmark, module="MOSI_mcast_aggr", bandwidth=bandwidth, threshold=threshold, stat=stat)) if (value != []): points.append([bandwidth, value]) if threshold == default_threshold: lines.append(["MOSI_mcast_aggr"] + points) else: lines.append(["%f" % threshold] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraphs.append(mfgraph.line_graph(lines, title = "multiple thresholds: %s vs %s - %d processors" % (xlabel, ylabel, default_processor), ymax = ymax, xlabel = xlabel, ylabel = ylabel, xlog = 10, xmin = 90.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, ))
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, ))
def draw_std_line(jgraphs, title, xlabel, ylabel, lines): jgraphs.append(mfgraph.line_graph(lines, title = title, xlabel = xlabel, ylabel = ylabel, xsize = 6, ysize = 4.5, ))
def run_trace(name, pred_lst): jgraph_input = [] cols = 2 row_space = 2.8 col_space = 2.8 num = 0 for bench in benchmarks: lines = [] for predictor in pred_lst: predictor_data = get_data(bench, predictor)[0] (predictor, bandwidth, runtime) = predictor_data if not (predictor in pred_lst): continue line = [ predictor_map[predictor], [float(bandwidth), float(runtime)] ] # line = [predictor, [float(bandwidth), float(runtime)]] lines.append(line) legend_hack = "" if (num == 4): legend_hack = "yes" print legend_hack jgraph_input.append( mfgraph.line_graph( lines, title=benchmark_map[bench], title_fontsize="12", title_font="Times-Roman", xsize=1.8, ysize=1.8, xlabel="control bandwidth (normalized to Broadcast)", ylabel="indirections (normalized to Directory)", label_fontsize="10", label_font="Times-Roman", legend_fontsize="10", legend_font="Times-Roman", linetype=["none"], marktype=["circle", "box", "diamond", "triangle", "triangle"], mrotate=[0, 0, 0, 0, 180], colors=["0 0 0"], xmin=0, x_translate=(num % cols) * col_space, y_translate=(num / cols) * -row_space, line_thickness=1.0, legend_hack=legend_hack, legend_x="150", # legend_y = "", )) num += 1 mfgraph.run_jgraph("\n".join(jgraph_input), "/p/multifacet/papers/mask-prediction/graphs/%s" % name)
def generate_micro4(stat, ylabel, transformation, ymax, legend_x, legend_y): benchmark = "microbenchmark" processor = 64 ## Generate bandwidth available vs performance (one graph per processor count) for bandwidth in bandwidth_list: jgraph_input = "" lines = [] for module in modules_list: points = [] for think_time in think_time_list: if think_time > 1000: continue data = get_data(benchmark, think_time=think_time, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) if (stat == "Ruby_cycles"): points.append([ think_time, ((value / 10000.0) - think_time) / 2.0 ]) else: points.append([think_time, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "think time (cycles)" jgraph_input += mfgraph.line_graph( lines, title_fontsize="12", title_font="Times-Roman", ymax=ymax, xlabel=xlabel, ylabel=ylabel, label_fontsize="9", xsize=1.8, ysize=1.8, xmin=0.0, legend_x=legend_x, legend_y=legend_y, legend_fontsize="8", # marktype = ["circle"], # marksize = .03, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 1000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 950 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph( jgraph_input, "bash-microbenchmark-thinktime-%d-%s" % (bandwidth, string.split(ylabel)[0]))
def draw_std_line(jgraphs, title, xlabel, ylabel, lines): jgraphs.append( mfgraph.line_graph( lines, title=title, xlabel=xlabel, ylabel=ylabel, xsize=6, ysize=4.5, ))
def generate_micro3(stat, ylabel, transformation, ymax, legend_x, legend_y): benchmark = "microbenchmark" ## Generate bandwidth available vs performance (one graph per processor count) for bandwidth in bandwidth_list: jgraph_input = "" lines = [] for module in modules_list: points = [] 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) points.append([processor, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "processors" if ylabel == "performance": ylabel = "performance per processor" jgraph_input += mfgraph.line_graph( lines, title_fontsize="12", title_font="Times-Roman", ymax=ymax, xlabel=xlabel, ylabel=ylabel, label_fontsize="9", xsize=1.8, ysize=1.8, xlog=10, xmin=3.0, legend_x=4, legend_y=legend_y, legend_fontsize="8", marktype=["circle"], marksize=.03, hash_marks=map(str, processor_list), ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 512 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 512 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph( jgraph_input, "bash-microbenchmark-processors-%d-%s" % (bandwidth, string.split(ylabel)[0]))
def run_trace(name, pred_lst): jgraph_input = [] cols = 2 row_space = 2.8 col_space = 2.8 num = 0 for bench in benchmarks: lines = [] for predictor in pred_lst: predictor_data = get_data(bench, predictor)[0] (predictor, bandwidth, runtime) = predictor_data if not (predictor in pred_lst): continue line = [predictor_map[predictor], [float(bandwidth), float(runtime)]] # line = [predictor, [float(bandwidth), float(runtime)]] lines.append(line) legend_hack = "" if (num == 4): legend_hack = "yes" print legend_hack jgraph_input.append(mfgraph.line_graph(lines, title = benchmark_map[bench], title_fontsize = "12", title_font = "Times-Roman", xsize = 1.8, ysize = 1.8, xlabel = "control bandwidth (normalized to Broadcast)", ylabel = "indirections (normalized to Directory)", label_fontsize = "10", label_font = "Times-Roman", legend_fontsize = "10", legend_font = "Times-Roman", linetype = ["none"], marktype = ["circle", "box", "diamond", "triangle", "triangle"], mrotate = [0, 0, 0, 0, 180], colors = ["0 0 0"], xmin = 0, x_translate = (num % cols) * col_space, y_translate = (num / cols) * -row_space, line_thickness = 1.0, legend_hack = legend_hack, legend_x = "150", # legend_y = "", )) num += 1 mfgraph.run_jgraph("\n".join(jgraph_input), "/p/multifacet/papers/mask-prediction/graphs/%s" % name)
def generate_line_example(jgraphs, title): xlabel = "x label" ylabel = "y label" lines = [ ["line1", [10, 10], [20, 20], [30, 30]], ["line2", [10, 5], [20, 25], [30, 80]], ] jgraphs.append( mfgraph.line_graph( lines, title=title, xlabel=xlabel, ylabel=ylabel, ))
def generate_micro1(stat, ylabel, transformation, ymax, legend_x, legend_y): jgraph_input = "" ## Generate bandwidth available vs performance (one graph per processor count) benchmark = "microbenchmark" processor = 64 lines = [] for module in modules_list: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph( lines, ymax=ymax, xlabel=xlabel, ylabel=ylabel, label_fontsize="9", xsize=1.8, ysize=1.8, xlog=10, xmin=90.0, xmax=30000.0, legend_x=legend_x, legend_y=legend_y, legend_fontsize="8", ylabel_location=18.0, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 200000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 20000 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph( jgraph_input, "bash-microbench-basic-%d-%s" % (processor, string.split(ylabel)[0]))
def generate_micro4(stat, ylabel, transformation, ymax, legend_x, legend_y): benchmark = "microbenchmark" processor = 64 ## Generate bandwidth available vs performance (one graph per processor count) for bandwidth in bandwidth_list: jgraph_input = "" lines = [] for module in modules_list: points = [] for think_time in think_time_list: if think_time > 1000: continue data = get_data(benchmark, think_time=think_time, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) if (stat == "Ruby_cycles"): points.append([think_time, ((value/10000.0)-think_time)/2.0]) else: points.append([think_time, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "think time (cycles)" jgraph_input += mfgraph.line_graph(lines, title_fontsize = "12", title_font = "Times-Roman", ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xmin = 0.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", # marktype = ["circle"], # marksize = .03, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 1000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 950 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbenchmark-thinktime-%d-%s" % (bandwidth, string.split(ylabel)[0]))
def generate_threshold(jgraphs, benchmark, stat, ylabel, transformation, ymax): ## Generate threshold variation lines = [] for module in ["MOSI_bcast_opt", "MOSI_GS"]: points = [] for bandwidth in bandwidth_list: value = mfgraph.average( get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != []): points.append([bandwidth, value]) lines.append([module] + points) for threshold in threshold_list: points = [] for bandwidth in bandwidth_list: value = mfgraph.average( get_data(benchmark, module="MOSI_mcast_aggr", bandwidth=bandwidth, threshold=threshold, stat=stat)) if (value != []): points.append([bandwidth, value]) if threshold == default_threshold: lines.append(["MOSI_mcast_aggr"] + points) else: lines.append(["%f" % threshold] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraphs.append( mfgraph.line_graph( lines, title="multiple thresholds: %s vs %s - %d processors" % (xlabel, ylabel, default_processor), ymax=ymax, xlabel=xlabel, ylabel=ylabel, xlog=10, xmin=90.0))
def generate_micro3(stat, ylabel, transformation, ymax, legend_x, legend_y): benchmark = "microbenchmark" ## Generate bandwidth available vs performance (one graph per processor count) for bandwidth in bandwidth_list: jgraph_input = "" lines = [] for module in modules_list: points = [] 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) points.append([processor, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "processors" if ylabel == "performance": ylabel = "performance per processor" jgraph_input += mfgraph.line_graph(lines, title_fontsize = "12", title_font = "Times-Roman", ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 3.0, legend_x = 4, legend_y = legend_y, legend_fontsize = "8", marktype = ["circle"], marksize = .03, hash_marks = map(str, processor_list), ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 512 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 512 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbenchmark-processors-%d-%s" % (bandwidth, string.split(ylabel)[0]))
def generate_indirect_branch_prediction_rate(jgraphs, results_dir): gshare_data = mfgraph.merge_data(group_title="GSHARE", data=get_branch_prediction_rate_data("INDIRE", "GSHARE")) agree_data = mfgraph.merge_data(group_title="AGREE", data=get_branch_prediction_rate_data("INDIRE", "AGREE")) yags_data = mfgraph.merge_data(group_title="YAGS", data=get_branch_prediction_rate_data("INDIRE", "YAGS")) print gshare_data lines = [gshare_data, agree_data, yags_data] jgraphs.append(mfgraph.line_graph(lines, title = "INDIRECT Branch Prediction Accuracy", xlabel = "PHT Bits", ylabel = "% Correct", xsize = 6, ysize = 4.5, ymin = 80, ymax = 100 ))
def generate_thinktime(jgraphs, benchmark, stat, ylabel, transformation, ymax): for bandwidth in bandwidth_list: lines = [] for module in modules_list: points = [] for think_time in think_time_list: value = mfgraph.average(get_data(benchmark, module=module, bandwidth=bandwidth, think_time=think_time, stat=stat)) if (value != []): points.append([think_time, value]) lines.append([module] + points) transformation(lines) xlabel = "think time" jgraphs.append(mfgraph.line_graph(lines, title = "%s vs %s - %d bandwidth" % (xlabel, ylabel, bandwidth), xlabel = xlabel, ylabel = ylabel, ymax = ymax, ))
def generate_micro1(stat, ylabel, transformation, ymax, legend_x, legend_y): jgraph_input = "" ## Generate bandwidth available vs performance (one graph per processor count) benchmark = "microbenchmark" processor = 64 lines = [] for module in modules_list: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph(lines, ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 90.0, xmax = 30000.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", ylabel_location = 18.0, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 200000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 20000 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbench-basic-%d-%s" % (processor, string.split(ylabel)[0]))
def generate_indirect_branch_prediction_rate(jgraphs, results_dir): gshare_data = mfgraph.merge_data(group_title="GSHARE", data=get_branch_prediction_rate_data( "INDIRE", "GSHARE")) agree_data = mfgraph.merge_data(group_title="AGREE", data=get_branch_prediction_rate_data( "INDIRE", "AGREE")) yags_data = mfgraph.merge_data(group_title="YAGS", data=get_branch_prediction_rate_data( "INDIRE", "YAGS")) print gshare_data lines = [gshare_data, agree_data, yags_data] jgraphs.append( mfgraph.line_graph(lines, title="INDIRECT Branch Prediction Accuracy", xlabel="PHT Bits", ylabel="% Correct", xsize=6, ysize=4.5, ymin=80, ymax=100))
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 ))
def cumulative(): stats = [ "^block_address ", "^macroblock_address ", "^pc_address ", ] stat_name = { "^block_address ": "Number of data blocks (64B)", "^macroblock_address ": "Number of data macroblocks (1024B)", "^pc_address ": "Number of instructions", } jgraph_input = [] cols = 3 row_space = 2.9 col_space = 3 num = 0 for stat in stats: graph_lines = [] for benchmark in benchmarks: print stat, benchmark group = [benchmark_names[benchmark]] filenames = glob.glob("%s/*trace-profiler*.stats" % benchmark) for filename in filenames: print filename command = 'egrep "^Total_data_misses_block_address" %s' % ( filename) results = os.popen(command, "r") line = results.readlines()[0] total_misses = float(string.split(line)[1]) command = 'egrep "^sharing_misses:" %s' % (filename) results = os.popen(command, "r") line = results.readlines()[0] total_sharing_misses = float(string.split(line)[1]) sharing_misses = get_cumulative(filename, 16, total_sharing_misses, stat) line = [benchmark_names[benchmark]] # points = range(0, 100) + range(100, len(sharing_misses), 10) points = range(1, len(sharing_misses), 100) for i in points: line.append([i + 1, sharing_misses[i]]) graph_lines.append(line) jgraph_input.append( mfgraph.line_graph( graph_lines, ymax=100.0, # xlog = 10, xmax=10000, title="", title_fontsize="12", title_font="Times-Roman", xsize=2.0, ysize=2.5, xlabel=stat_name[stat], ylabel="Percent of all sharing misses (cumulative)", label_fontsize="10", label_font="Times-Roman", legend_fontsize="10", legend_font="Times-Roman", legend_x="4000", legend_y="20", x_translate=(num % cols) * col_space, y_translate=(num / cols) * -row_space, line_thickness=1.0, )) ## jgraph_input.append(mfgraph.stacked_bar_graph(bars, ## title = stats_names[stat], ## xsize = 6.5, ## ysize = 2, ## xlabel = "", ## ylabel = "", ## stack_space = 3, ## )) num += 1 mfgraph.run_jgraph("\n".join(jgraph_input), "cumulative")
def cumulative(): stats = [ "^block_address ", "^macroblock_address ", # "^supermacroblock_address ", "^pc_address ", ] stat_name = { "^block_address " : "Number of data blocks (64B)", "^macroblock_address " : "Number of data macroblocks (1024B)", "^supermacroblock_address " : "Number of data macroblocks (4096B)", "^pc_address " : "Number of static instructions", } jgraph_input = [] cols = 3 row_space = 2.9 col_space = 3 num = 0 for stat in stats: graph_lines = [] for benchmark in benchmarks: print stat, benchmark group = [benchmark_names[benchmark]] filenames = glob.glob("*/%s-gs320*.stats" % benchmark) for filename in filenames: print filename command = 'egrep "^Total_data_misses_block_address" %s' % (filename) results = os.popen(command, "r") line = results.readlines()[0] total_misses = float(string.split(line)[1]) command = 'egrep "^sharing_misses:" %s' % (filename) results = os.popen(command, "r") line = results.readlines()[0] total_sharing_misses = float(string.split(line)[1]) sharing_misses = get_cumulative(filename, 16, total_sharing_misses, stat) line = [benchmark_names[benchmark]] # points = range(0, 100) + range(100, len(sharing_misses), 10) points = range(1, len(sharing_misses), 100) for i in points: line.append([i+1, sharing_misses[i]]) graph_lines.append(line) jgraph_input.append(mfgraph.line_graph(graph_lines, ymax = 100.0, # xlog = 10, xmax = 10000, title = "", title_fontsize = "12", title_font = "Times-Roman", xsize = 2.0, ysize = 2.5, xlabel = stat_name[stat], ylabel = "Percent of all sharing misses (cumulative)", label_fontsize = "10", label_font = "Times-Roman", legend_fontsize = "10", legend_font = "Times-Roman", legend_x = "50", legend_y = "20", x_translate = (num % cols) * col_space, y_translate = (num / cols) * -row_space, line_thickness = 1.0, )) num += 1 mfgraph.run_jgraph("\n".join(jgraph_input), "cumulative")
def generate_micro1(stat, ylabel, transformation, ymax, legend_x, legend_y): jgraph_input = "" ## Generate bandwidth available vs performance (one graph per processor count) benchmark = "microbenchmark" processor = 64 lines = [] for module in ["MOSI_bcast_opt_1", "MOSI_GS_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph(lines, ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 90.0, xmax = 30000.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", ylabel_location = 18.0, colors = ["1 0 0", "0 .5 0", "0 1 1", "1 0 1"], linetype = ["dotted", "longdash", "dotdash", "dashed"], ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 200000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 20000 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbench-talk-two-%d-%s" % (processor, string.split(ylabel)[0])) ############ repeated code jgraph_input = "" ## Generate bandwidth available vs performance (one graph per processor count) benchmark = "microbenchmark" processor = 64 lines = [] for module in modules_list: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph(lines, ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 90.0, xmax = 30000.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", ylabel_location = 18.0, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 200000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 20000 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbench-talk-three-%d-%s" % (processor, string.split(ylabel)[0])) ############ repeated code jgraph_input = "" ## Generate bandwidth available vs performance (one graph per processor count) benchmark = "microbenchmark" processor = 64 lines = [] for module in ["MOSI_bcast_opt_1", "maximum", "MOSI_GS_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue if module == "maximum": data1 = get_data(benchmark, processor=processor, module="MOSI_bcast_opt_1", bandwidth=bandwidth, stat=stat) data2 = get_data(benchmark, processor=processor, module="MOSI_GS_1", bandwidth=bandwidth, stat=stat) if len(data1) > 0: value1 = mfgraph.average(data1) if len(data2) > 0: value2 = mfgraph.average(data2) value = min([value1, value2]) points.append([bandwidth, value]) else: data = get_data(benchmark, processor=processor, module=module, bandwidth=bandwidth, stat=stat) if len(data) > 0: value = mfgraph.average(data) points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) transformation(lines) xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph(lines, ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 90.0, xmax = 30000.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", ylabel_location = 18.0, ) if stat == "links_utilized_percent": jgraph_input += "newcurve clip pts 0.1 75 200000 75 linetype solid linethickness 1 marktype none gray .75\n" jgraph_input += "newstring x 20000 y 76 fontsize 8 : 75%\n" mfgraph.run_jgraph(jgraph_input, "bash-microbench-talk-three-max-%d-%s" % (processor, string.split(ylabel)[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]))
def generate_micro2(stat, ylabel, transformation, ymax, legend_x, legend_y): jgraph_input = "" ## Generate threshold variation benchmark = "microbenchmark" processor = 64 lines = [] for module in ["MOSI_bcast_opt_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average( get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) for threshold in [0.55, 0.75, 0.95]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average( get_data(benchmark, module="MOSI_mcast_aggr_1", bandwidth=bandwidth, threshold=threshold, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([ protocol_name["MOSI_mcast_aggr_1"] + ": %2.0f%%" % (threshold * 100) ] + points) for module in ["MOSI_GS_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average( get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) global norm_module old_norm_module = norm_module norm_module = protocol_name["MOSI_mcast_aggr_1"] + ": %2.0f%%" % ( default_threshold * 100) transformation(lines) norm_module = old_norm_module xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph( lines, title_fontsize="12", title_font="Times-Roman", ymax=ymax, xlabel=xlabel, ylabel=ylabel, label_fontsize="9", xsize=1.8, ysize=1.8, xlog=10, xmin=90.0, xmax=30000.0, legend_x=legend_x, legend_y=legend_y, legend_fontsize="8", ylabel_location=18.0, ) mfgraph.run_jgraph( jgraph_input, "bash-microbench-threshold-%d-%s" % (processor, string.split(ylabel)[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]))
def generate_micro2(stat, ylabel, transformation, ymax, legend_x, legend_y): jgraph_input = "" ## Generate threshold variation benchmark = "microbenchmark" processor = 64 lines = [] for module in ["MOSI_bcast_opt_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average(get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) for threshold in [0.55, 0.75, 0.95]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average(get_data(benchmark, module="MOSI_mcast_aggr_1", bandwidth=bandwidth, threshold=threshold, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([protocol_name["MOSI_mcast_aggr_1"] + ": %2.0f%%" % (threshold*100)] + points) for module in ["MOSI_GS_1"]: points = [] for bandwidth in bandwidth_list: if bandwidth > 30000: continue value = mfgraph.average(get_data(benchmark, module=module, bandwidth=bandwidth, stat=stat)) if (value != 0): points.append([bandwidth, value]) lines.append([protocol_name[module]] + points) global norm_module old_norm_module = norm_module norm_module = protocol_name["MOSI_mcast_aggr_1"] + ": %2.0f%%" % (default_threshold*100) transformation(lines) norm_module = old_norm_module xlabel = "endpoint bandwidth available (MB/second)" jgraph_input += mfgraph.line_graph(lines, title_fontsize = "12", title_font = "Times-Roman", ymax = ymax, xlabel = xlabel, ylabel = ylabel, label_fontsize = "9", xsize = 1.8, ysize = 1.8, xlog = 10, xmin = 90.0, xmax = 30000.0, legend_x = legend_x, legend_y = legend_y, legend_fontsize = "8", ylabel_location = 18.0, ) mfgraph.run_jgraph(jgraph_input, "bash-microbench-threshold-%d-%s" % (processor, string.split(ylabel)[0]))
legend_hack = "yes" print legend_hack jgraph_input.append(mfgraph.line_graph(lines, title = benchmark_map[bench], title_fontsize = "12", title_font = "Times-Roman", xsize = 1.8, ysize = 1.8, xlabel = "control bandwidth (normalized to Broadcast)", ylabel = "indirections (normalized to Directory)", label_fontsize = "10", label_font = "Times-Roman", legend_fontsize = "10", legend_font = "Times-Roman", linetype = ["none"], marktype = ["circle", "box", "diamond", "triangle", "triangle"], mrotate = [0, 0, 0, 0, 180], colors = ["0 0 0"], xmin = 0, x_translate = (num % cols) * col_space, y_translate = (num / cols) * -row_space, line_thickness = 1.0, legend_hack = legend_hack, legend_x = "150", # legend_y = "", )) num += 1 mfgraph.run_jgraph("\n".join(jgraph_input), "/p/multifacet/papers/mask-prediction/graphs/predsize")
print legend_hack jgraph_input.append( mfgraph.line_graph( lines, title=benchmark_map[bench], title_fontsize="12", title_font="Times-Roman", xsize=1.8, ysize=1.8, xlabel="control bandwidth (normalized to Broadcast)", ylabel="runtime (normalized to Directory)", label_fontsize="10", label_font="Times-Roman", legend_fontsize="10", legend_font="Times-Roman", linetype=["none"], marktype=["circle", "box", "diamond", "triangle", "triangle"], mrotate=[0, 0, 0, 0, 180], colors=["0 0 0"], xmin=0, x_translate=(num % cols) * col_space, y_translate=(num / cols) * -row_space, line_thickness=1.0, legend_hack=legend_hack, legend_x="150", # legend_y = "", )) num += 1