update
This commit is contained in:
parent
43a9c1a2eb
commit
4ea5c623cb
@ -4,6 +4,8 @@ import numpy as np
|
|||||||
|
|
||||||
cpu_num_array = np.arange(1, 17)
|
cpu_num_array = np.arange(1, 17)
|
||||||
|
|
||||||
|
# n = 5000
|
||||||
|
|
||||||
time_array_1 = [3.999, 1.679, 1.257, 0.985, 0.699, 0.562, 0.534, 0.525, 0.510, 0.424, 0.409, 0.380, 0.372, 0.339, 0.334, 0.293]
|
time_array_1 = [3.999, 1.679, 1.257, 0.985, 0.699, 0.562, 0.534, 0.525, 0.510, 0.424, 0.409, 0.380, 0.372, 0.339, 0.334, 0.293]
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
ax.set_title('np.dot()')
|
ax.set_title('np.dot()')
|
||||||
@ -13,6 +15,20 @@ ax.xaxis.set_major_locator(MultipleLocator(1))
|
|||||||
plt.plot(cpu_num_array, time_array_1, '-o', )
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
time_array_2 = [6.059, 2.723, 2.190, 1.577, 1.169, 0.939, 1.231, 0.958, 1.070, 0.793, 1.208, 0.760, 0.709, 0.677, 0.671, 0.906]
|
time_array_2 = [6.059, 2.723, 2.190, 1.577, 1.169, 0.939, 1.231, 0.958, 1.070, 0.793, 1.208, 0.760, 0.709, 0.677, 0.671, 0.906]
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
ax.set_title('np.linalg.inv()')
|
ax.set_title('np.linalg.inv()')
|
||||||
@ -22,6 +38,20 @@ ax.xaxis.set_major_locator(MultipleLocator(1))
|
|||||||
plt.plot(cpu_num_array, time_array_2, '-o', )
|
plt.plot(cpu_num_array, time_array_2, '-o', )
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_2[0]
|
||||||
|
for i0 in range(len(time_array_2)):
|
||||||
|
time_array_2[i0] = time_0/time_array_2[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.linalg.inv()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_2, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
time_array_3 = [95.896, 49.107, 41.703, 38.915, 32.468, 25.804, 40.716, 31.072, 40.045, 26.397, 38.557, 28.684, 28.267, 26.840, 27.381, 34.494]
|
time_array_3 = [95.896, 49.107, 41.703, 38.915, 32.468, 25.804, 40.716, 31.072, 40.045, 26.397, 38.557, 28.684, 28.267, 26.840, 27.381, 34.494]
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
ax.set_title('np.linalg.eig()')
|
ax.set_title('np.linalg.eig()')
|
||||||
@ -29,4 +59,16 @@ ax.set_xlabel('Number of CPU cores')
|
|||||||
ax.set_ylabel('Time (s)')
|
ax.set_ylabel('Time (s)')
|
||||||
ax.xaxis.set_major_locator(MultipleLocator(1))
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
plt.plot(cpu_num_array, time_array_3, '-o', )
|
plt.plot(cpu_num_array, time_array_3, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_3[0]
|
||||||
|
for i0 in range(len(time_array_3)):
|
||||||
|
time_array_3[i0] = time_0/time_array_3[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.linalg.eig()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_3, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
plt.show()
|
plt.show()
|
@ -0,0 +1,160 @@
|
|||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from matplotlib.ticker import MultipleLocator
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
cpu_num_array = np.arange(1, 17)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 30000
|
||||||
|
|
||||||
|
time_array_1 = [1164.522, 648.587, 444.488, 647.176, 298.652, 256.809, 239.630, 231.987, 475.781, 383.823, 410.388, 172.702, 163.727, 144.307, 121.530, 109.636]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 20000
|
||||||
|
|
||||||
|
time_array_1 = [365.730, 209.475, 151.805, 120.739, 104.102, 88.944, 80.475, 70.486, 67.500, 61.404, 53.837, 51.219, 51.542, 84.641, 80.378, 30.629]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 10000
|
||||||
|
|
||||||
|
time_array_1 = [62.485, 36.402, 25.316, 21.785, 17.619, 15.412, 16.718, 10.874, 9.588, 7.004, 6.733, 7.251, 7.248, 4.979, 4.889, 7.037]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 500
|
||||||
|
|
||||||
|
time_array_1 = [0.004053801, 0.002605676, 0.001590664, 0.001103345, 0.001266495, 0.000954730, 0.000930616, 0.000779754, 0.000970088, 0.000651353, 0.000918634, 0.000538209, 0.000716934, 0.000521487, 0.001165715, 0.000764804 ]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 300
|
||||||
|
|
||||||
|
time_array_1 = [0.001144045, 0.000554059, 0.000413136, 0.000385368, 0.000287431, 0.000270178, 0.000268842, 0.000535453, 0.000219275, 0.000219676, 0.000186116, 0.000522058, 0.000146788, 0.000134041, 0.000558532, 0.000135554]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# n = 100
|
||||||
|
|
||||||
|
time_array_1 = [0.000041899, 0.000104283, 0.000138595, 0.000038628, 0.000039540, 0.000029726, 0.000101140, 0.000023468, 0.000061134, 0.000225034, 0.000033439, 0.000075225, 0.000057184, 0.000040229, 0.000104894, 0.000041510]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Time (s)')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
time_0 = time_array_1[0]
|
||||||
|
for i0 in range(len(time_array_1)):
|
||||||
|
time_array_1[i0] = time_0/time_array_1[i0]
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
ax.set_title('np.dot()')
|
||||||
|
ax.set_xlabel('Number of CPU cores')
|
||||||
|
ax.set_ylabel('Ratio')
|
||||||
|
ax.xaxis.set_major_locator(MultipleLocator(1))
|
||||||
|
plt.plot(cpu_num_array, time_array_1, '-o', )
|
||||||
|
plt.plot(cpu_num_array, cpu_num_array, '--r')
|
||||||
|
plt.show()
|
Loading…
x
Reference in New Issue
Block a user