Menu

[c6cc8d]: / memcpy-perf / graph_memcpy.py  Maximize  Restore  History

Download this file

47 lines (26 with data), 810 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
import subprocess
import matplotlib.pyplot as plt
import time
import argparse
parser = argparse.ArgumentParser(description="Graph memcpy perf")
parser.add_argument("--files", nargs='+', type=str, help="files to graph", default=None)
args = parser.parse_args()
fig, ax = plt.subplots(nrows=1)
ax.set_xscale('log')
plt.xlabel("size in bytes")
plt.ylabel("BW in GB/s")
plt.title("size vs. bw")
plt.tight_layout()
for arg in args.files:
f = open(arg)
size = []
perf = []
for line in f:
# size: 11430912, perf: 6.76051GB/s, iter: 5
line_split = line.split(",")
size.append(float(line_split[0].split(":")[1]))
perf.append(float(line_split[1].split(":")[1].split("G")[0]))
line, = ax.plot(size, perf, '-', linewidth=0.2, label=arg)
legend = plt.legend()
plt.show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.