def main(): parser = argparse.ArgumentParser() parser.add_argument("-p", "--pattern", help="access pattern", choices=["fix", "random"], default="fix") parser.add_argument("-r", "--ratio", help="graph ratio", type=float, default=ratio) args = parser.parse_args() pdffile = "graph/graph_bw2_{}.pdf".format(args.pattern) fig, ax = plt.subplots() xticks = [] yaxis = [] for x in range(1, 129): dma_len = x * 16 xticks.append(dma_len) f = ("output/pciebench_bw2_read_ptr-{}_len-{}.txt".format( args.pattern, dma_len)) yaxis.append(parse(f)) ax.plot(xticks, yaxis, color=get_color()) plt.yticks([0, 1, 2, 3, 4, 5]) plt.xticks([16, 512, 1024, 1536, 2048]) ax.tick_params(labelsize=fontsize) ax.set_ylabel("throughput (Gbps)", fontsize=fontsize) ax.set_xlabel("request size (byte)", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) change_aspect_ratio(ax, args.ratio) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.005)
def main(): parser = argparse.ArgumentParser() parser.add_argument("-p", "--pattern", help="access pattern", choices=["fix", "random"], default="fix") args = parser.parse_args() pdffile = "graph/graph_lat2_{}.pdf".format(args.pattern) fig, ax = plt.subplots() yaxis = [] xticks = [] for x in range(1, 129): dma_len = x * 16 xticks.append(dma_len) f = ("output/pciebench_lat2_" + "read_ptr-{}_len-{}.txt".format(args.pattern, dma_len)) yaxis.append(parse(f)) ax.plot(xticks, yaxis, color=get_color()) plt.yticks(list(map(lambda x: x * 5, range(6)))) plt.xticks([0, 512, 1024, 1536, 2048]) ax.tick_params(labelsize=fontsize) ax.set_ylabel("latency (usec)", fontsize=fontsize) ax.set_xlabel("transfer size (byte)", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) change_aspect_ratio(ax, 2) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.005)
def main(): parser = argparse.ArgumentParser() parser.add_argument("-p", "--pattern", help="access pattern", choices=["fix", "random"], default="fix") args = parser.parse_args() pdffile = "graph/graph_bw_{}.pdf".format(args.pattern) fig, ax = plt.subplots() dma_lens = [8, 16, 32, 64, 128, 256, 512, 1024, 2048] xticks = list(range(9)) yaxis = [] for dma_len in dma_lens: f = ("output/pciebench_bw_read_ptr-{}_len-{}.txt".format( args.pattern, dma_len)) yaxis.append(parse(f)) ax.plot(xticks, yaxis, marker=get_marker(), color=get_color()) print(xticks) print(yaxis) plt.xticks(xticks, dma_lens) ax.tick_params(labelsize=fontsize) ax.set_ylabel("throughput (Gbps)", fontsize=fontsize) ax.set_xlabel("transfer size (byte)", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) change_aspect_ratio(ax, 2) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.005)
def main(): parser = argparse.ArgumentParser() parser.add_argument("-d", "--direction", help="DMA direction", choices=["read", "write"], default="read") parser.add_argument("-l", "--dmalen", help="DMA length to be drawn", action="append") parser.add_argument("-p", "--pattern", help="access pattern", choices=["seq", "fix", "random"], default="seq") parser.add_argument("-R", "--ratio", help="aspect ratio", type=float, default=1.5) parser.add_argument("-o", "--output", help="output pdf file name", default=None) args = parser.parse_args() if not args.dmalen: dma_lens = [1, 4, 8, 16, 32, 64, 128, 256, 512, 1024] else: dma_lens = args.dmalen cpu_nums = [1] if not args.output: pdffile = ("graph/graph_latency_{}_".format(args.direction) + "pattern-{}.pdf".format(args.pattern)) else: pdffile = args.output fig, ax = plt.subplots() maximum = 0 for dma_len in dma_lens: for cpu_num in cpu_nums: f = ("output-lat/{}_".format(args.direction) + "pattern-{}_".format(args.pattern) + "dmalen-{}_".format(dma_len) + "cpu-{}.txt".format(cpu_num)) xaxis, yaxis = parse_lat(f) ax.plot(xaxis, yaxis, color=get_color(), linestyle=get_linestyle(), label="DMA {}B".format(dma_len)) # save maximum x value if maximum < max(xaxis): maximum = max(xaxis) #xticks = list(range(int(maximum) + 2)) #plt.xticks(xticks, xticks) plt.yticks(list(map(lambda x: x * 0.2, range(0, 6)))) ax.tick_params(labelsize=fontsize) ax.set_ylabel("CDF", fontsize=fontsize) ax.set_xlabel("latency (usec)", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) ax.legend(fontsize=lfontsize, loc="lower right") change_aspect_ratio(ax, args.ratio) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.05)
def main(): round_map = { "G": 1000000000, "M": 1000000, "K": 1000, } parser = argparse.ArgumentParser() parser.add_argument("-u", "--unit", help="unit of bandwidth", choices=["bps", "tps"], default="bps") parser.add_argument("-d", "--direction", help="DMA direction", choices=["read", "write"], default="read") parser.add_argument("-l", "--dmalen", help="DMA length to be drawn", action="append") parser.add_argument("-p", "--pattern", help="access pattern", choices=["seq", "fix", "random"], default="seq") parser.add_argument("-r", "--round", help="round up x axis", choices=round_map.keys(), default=list(round_map.keys())[0]) parser.add_argument("-R", "--ratio", help="aspect ratio", type=float, default=1.5) parser.add_argument("-o", "--output", help="output pdf file name", default=None) args = parser.parse_args() if not args.dmalen: dma_lens = reversed([1, 4, 8, 16, 32, 64, 128, 256, 512, 1024]) else: dma_lens = args.dmalen cpu_nums = [1, 2, 4, 6, 8, 10, 12, 14, 16] if not args.output: pdffile = ("graph/graph_{}_x-cpu_".format(args.direction) + "pattern-{}_".format(args.pattern) + "{}.pdf".format(args.unit)) else: pdffile = args.output fig, ax = plt.subplots() maximum = 0 for dma_len in dma_lens: bpses = [] tpses = [] for cpu_num in cpu_nums: f = ("output/{}_".format(args.direction) + "pattern-{}_".format(args.pattern) + "dmalen-{}_".format(dma_len) + "cpu-{}.txt".format(cpu_num)) bps, tps = parse(f) bpses.append(bps) tpses.append(tps) if args.unit == "bps": yaxis = bpses elif args.unit == "tps": yaxis = tpses # round up to K, M, or G yaxis = list(map(lambda x: x / round_map[args.round], yaxis)) ax.plot(cpu_nums, yaxis, marker=get_marker(), color=get_color(), label="DMA {}B".format(dma_len)) print(f) for x in range(len(cpu_nums)): print("{}\t{}".format(cpu_nums[x], yaxis[x])) print() # save maximum y value if maximum < max(yaxis): maximum = max(yaxis) yticks = list(range(int(maximum) + 2)) # this code depends on round up Gig plt.yticks(yticks, yticks) plt.xticks(cpu_nums, cpu_nums) ax.tick_params(labelsize=fontsize) ax.set_ylabel("throughput ({}{})".format(args.round, args.unit), fontsize=fontsize) ax.set_xlabel("number of cores", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) ax.legend(fontsize=lfontsize) change_aspect_ratio(ax, args.ratio) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.05)
def main(): round_map = { "G": 1000000000, "M": 1000000, "K": 1000, } parser = argparse.ArgumentParser() parser.add_argument("-u", "--unit", help="unit of bandwidth", choices=["bps", "tps"], default="bps") parser.add_argument("-p", "--pattern", help="access pattern", choices=["seq", "seq512", "fix", "random"], default="seq") parser.add_argument("-r", "--round", help="round up x axis", choices=round_map.keys(), default=list(round_map.keys())[0]) parser.add_argument("-R", "--ratio", help="aspect ratio", type=float, default=ratio) parser.add_argument("-o", "--output", help="output pdf file name", default=None) args = parser.parse_args() dma_lens = list(map(lambda x: x * 16, range(129))) dma_lens[0] = 1 xaxis = list(map(lambda x: x * 512, range(5))) xaxis[0] = 1 if not args.output: pdffile = ("graph/graph_x-dmalen-16binterval_" + "pattern-{}_{}.pdf".format(args.pattern, args.unit)) else: pdffile = args.output fig, ax = plt.subplots() bpses = [] tpses = [] for dma_len in dma_lens: f = ("output-16b/read_pattern-{}_".format(args.pattern) + "dmalen-{}_".format(dma_len) + "cpu-16.txt") bps, tps = parse(f) bpses.append(bps) tpses.append(tps) if args.unit == "bps": yaxis = bpses elif args.unit == "tps": yaxis = tpses # round up to K, M, or G yaxis = list(map(lambda x: x / round_map[args.round], yaxis)) ax.plot(dma_lens, yaxis, color=get_color()) plt.yticks([0, 1, 2, 3, 4]) plt.xticks(xaxis) ax.tick_params(labelsize=fontsize) ax.set_ylabel("throughput ({}{})".format(args.round, args.unit), fontsize=fontsize) ax.set_xlabel("request size (byte)", fontsize=fontsize) ax.grid(True, linestyle="--", linewidth=0.5) change_aspect_ratio(ax, args.ratio) print("save '{}'".format(pdffile)) plt.savefig(pdffile, bbox_inches="tight", pad_inches=0.05)