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
33
|
#!/usr/bin/env python3
# Copied from jupyter notebook at 12:36 AM on Sept 13 2022
import numpy
import matplotlib
# Headless backend. Comment this out if you want to use X.
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import sys
if len(sys.argv) < 4:
print("Usage: {} <gpu_pg_results> <direct_pg_results> <demand_pg_results>".format(sys.argv[0]))
exit(1)
# Load data
gpu_pg_speeds = numpy.loadtxt(sys.argv[1], delimiter="\t", skiprows=1)
direct_pg_speeds = numpy.loadtxt(sys.argv[2], delimiter="\t", skiprows=2)
demand_pg_speeds = numpy.loadtxt(sys.argv[3], delimiter="\t", skiprows=2)
# Convert to milliseconds
gpu_pg_speeds = numpy.divide(gpu_pg_speeds, 1000)
direct_pg_speeds = numpy.divide(direct_pg_speeds, 1000)
demand_pg_speeds = numpy.divide(demand_pg_speeds, 1000)
# Plot
plt.ylabel("Milliseconds")
#plt.title("Box Plot of Time to Load 1GiB From SSD")
plt.xlabel("Paging Method")
plt.boxplot([gpu_pg_speeds[:,0], gpu_pg_speeds[:,1], direct_pg_speeds[:,0], direct_pg_speeds[:,1], demand_pg_speeds], labels=["GPU\nPaging Out", "GPU\nPaging In", "Direct I/O\nWrite", "Direct I/O\nRead", "Demand\nPaging In"])
plt.ylim(bottom=0, top=1000)
plt.tight_layout()
plt.savefig("fig10.pdf")
print("Plot saved as fig10.pdf.")
|