In [21]:
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(1,5)
#print(type(t))
speed_up10Work100 = np.array([1, 1.76, 2.34, 2.74]);
speed_up10Work1000 = np.array([1, 2.10,2.65,3.17]);
speed_up1000Work100 = np.array([1, 2.06, 3.10, 4.11]);
# red dashes with no symbols, blue squares with a solid line, and green triangles with a dotted line
plt.plot(t, speed_up10Work100[t-1], 'rs-', label='ITN = 10, WRKTM = 100')
plt.plot(t, speed_up10Work1000[t-1], 'bs-', label='ITN = 10, WRKTM = 1000')
plt.plot(t, speed_up1000Work100[t-1], 'gs-', label='ITN = 1000, WRKTM = 100')
plt.legend(loc='upper left', shadow=True, fontsize='medium')
plt.xlabel('Number of threads')
plt.ylabel('Speedup')
plt.title('Assignment 2')
plt.show()
In [23]:
t = np.arange(1,5)
#print(type(t))
defaultstatic = np.array([1,1.42,1.94,2.49]);
static30 = np.array([1,1.96,2.92,3.97]);
guided = np.array([1, 2.00,3.02,4.00]);
dynamic = np.array([1, 2.05,3.03,4.09]);
# red dashes with no symbols, blue squares with a solid line, and green triangles with a dotted line
plt.plot(t, defaultstatic[t-1], 'rs-', label='default/static')
plt.plot(t, static30[t-1], 'bs-', label='static,30')
plt.plot(t, guided[t-1], 'gs-', label='guided')
plt.plot(t, dynamic[t-1], 'ys-', label='dynamic')
plt.legend(loc='upper left', shadow=True, fontsize='medium')
plt.xlabel('Number of threads')
plt.ylabel('Speedup')
plt.title('Assignment 3')
plt.show()
In [26]:
t = np.arange(1,5)
#print(type(t))
collapse = np.array([1,1.64,1.92,2.03]);
paraOuterLoop = np.array([1,1.71,1.96,1.99]);
paraOuterLoopInnerVar = np.array([1, 1.67,1.98,2.04]);
paraInnerLoopInnerVar = np.array([1, 1.65,1.83,2.06]);
# red dashes with no symbols, blue squares with a solid line, and green triangles with a dotted line
plt.plot(t, collapse[t-1], 'rs-', label='collapse')
plt.plot(t, paraOuterLoop[t-1], 'bs-', label='paralel on outer loop')
plt.plot(t, paraOuterLoopInnerVar[t-1], 'gs-', label='paralel on outer loop w inner var')
plt.plot(t, paraInnerLoopInnerVar[t-1], 'ys-', label='paralel on inner loop w inner var')
plt.legend(loc='lower right', shadow=True, fontsize='medium')
plt.xlabel('Number of threads')
plt.ylabel('Speedup')
plt.title('Assignment 5')
plt.show()
In [ ]: