OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-CompactHash commits / 8f03078

Adding new plots
8f0307868ce8b2106aec0ed4fbc19f95cbb587ac
by Bob Robey <brobey@lanl.gov> · 2016-01-24T23:38:28.000Z

Changed files (6) +177 -0

do_plots/do_plot.py +71 -0
……@@ -0,0 +1,71 @@
1from matplotlib import pyplot
2import string
3from array import *
4
5fp = open("memopt.dat",'r')
6
7X1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
8Y1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
9Y2 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
10Y3 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
11Y4 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
12Y5 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
13Y6 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
14Y7 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
15Y8 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
16Y9 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
17Y10 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
18Y11 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
19
20line = fp.readline()
21
22for i in range(0,7):
23 line = fp.readline()
24 value = line.split(",")
25 X1[i] = float(value[0])
26 Y1[i] = float(value[1])
27 Y2[i] = float(value[2])
28 Y3[i] = float(value[3])
29 Y4[i] = float(value[4])
30 Y5[i] = float(value[5])
31 Y6[i] = float(value[6])
32 Y7[i] = float(value[7])
33 Y8[i] = float(value[8])
34 Y9[i] = float(value[9])
35 Y10[i] = float(value[10])
36 Y11[i] = float(value[11])
37 Y3[i] /= Y1[i]
38 Y4[i] /= Y1[i]
39 Y5[i] /= Y1[i]
40 Y6[i] /= Y1[i]
41 Y7[i] /= Y1[i]
42 Y8[i] /= Y1[i]
43 Y9[i] /= Y1[i]
44 Y10[i] /= Y1[i]
45 Y11[i] /= Y1[i]
46 #print (X1[i]*pow(2,i+1) * X1[i]*pow(2,i+1))/Y1[i]
47
48fig = pyplot.figure()
49
50fig.patch.set_facecolor('white')
51pyplot.xlabel("Compressibility",fontdict={'fontsize':16})
52pyplot.ylabel("Runtime (millisecs)/numcells",fontdict={'fontsize':16})
53
54pyplot.semilogy()
55
56pyplot.plot(Y2, Y3, color = '#3399FF', linestyle='-', linewidth=1.0, marker='o', label='kDtree')
57pyplot.plot(Y2, Y4, color = 'green', linestyle='-', linewidth=1.0, marker='o', label='Full Perfect on CPU')
58pyplot.plot(Y2, Y5, color = 'orange', linestyle='-', linewidth=1.0, marker='o', label='7 write, 1 read on CPU')
59pyplot.plot(Y2, Y6, color = 'blue', linestyle='-', linewidth=1.0, marker='o', label='1 write, 3 read on CPU')
60pyplot.plot(Y2, Y7, color = 'red', linestyle='-', linewidth=1.0, marker='o', label='Compact CPU')
61pyplot.plot(Y2, Y8, color = 'green', linestyle='--', linewidth=1.0, marker='D', label='Full Perfect on GPU')
62pyplot.plot(Y2, Y9, color = 'orange', linestyle='--', linewidth=1.0, marker='D', label='7 write, 1 read on GPU')
63pyplot.plot(Y2, Y10, color = 'blue', linestyle='--', linewidth=1.0, marker='D', label='1 write, 3 read on GPU')
64pyplot.plot(Y2, Y11, color = 'red', linestyle='--', linewidth=1.0, marker='D', label='Compact GPU')
65
66pyplot.grid()
67pyplot.legend(loc = 2)
68pyplot.suptitle("Comparison of Neighbor Finding Algorithms on the CPU and GPU",fontdict={'fontsize':16})
69
70pyplot.savefig('neighbors_all.pdf',format='pdf')
71pyplot.show()
do_plots/do_plot_cpu.py +55 -0
……@@ -0,0 +1,55 @@
1from matplotlib import pyplot
2import string
3from array import *
4
5fp = open("memopt.dat",'r')
6
7X1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
8Y1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
9Y2 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
10Y3 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
11Y4 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
12Y5 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
13Y6 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
14Y7 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
15
16line = fp.readline()
17
18for i in range(0,7):
19 line = fp.readline()
20 value = line.split(",")
21 X1[i] = float(value[0])
22 Y1[i] = float(value[1])
23 Y2[i] = float(value[2])
24 Y3[i] = float(value[3])
25 Y4[i] = float(value[4])
26 Y5[i] = float(value[5])
27 Y6[i] = float(value[6])
28 Y7[i] = float(value[7])
29 Y3[i] /= Y1[i]
30 Y4[i] /= Y1[i]
31 Y5[i] /= Y1[i]
32 Y6[i] /= Y1[i]
33 Y7[i] /= Y1[i]
34 #print (X1[i]*pow(2,i+1) * X1[i]*pow(2,i+1))/Y1[i]
35
36fig = pyplot.figure()
37
38fig.patch.set_facecolor('white')
39pyplot.xlabel("Compressibility",fontdict={'fontsize':16})
40pyplot.ylabel("Runtime (millisecs)/numcells",fontdict={'fontsize':16})
41
42pyplot.semilogy()
43
44pyplot.plot(Y2, Y3, color = '#3399FF', linestyle='-', linewidth=1.0, marker='o', label='kDtree')
45pyplot.plot(Y2, Y4, color = 'green', linestyle='-', linewidth=1.0, marker='o', label='Full Perfect on CPU')
46pyplot.plot(Y2, Y5, color = 'orange', linestyle='-', linewidth=1.0, marker='o', label='7 write, 1 read on CPU')
47pyplot.plot(Y2, Y6, color = 'blue', linestyle='-', linewidth=1.0, marker='o', label='1 write, 3 read on CPU')
48pyplot.plot(Y2, Y7, color = 'red', linestyle='-', linewidth=1.0, marker='o', label='Compact CPU')
49
50pyplot.grid()
51pyplot.legend(loc = 2)
52pyplot.suptitle("Comparison of Neighbor Finding Algorithms on the CPU",fontdict={'fontsize':16})
53
54pyplot.savefig('neighbors_cpu.pdf',format='pdf')
55pyplot.show()
do_plots/do_plot_gpu.py +51 -0
……@@ -0,0 +1,51 @@
1from matplotlib import pyplot
2import string
3from array import *
4
5fp = open("memopt.dat",'r')
6
7X1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
8Y1 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
9Y2 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
10Y8 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
11Y9 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
12Y10 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
13Y11 = array ('d', [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ])
14
15line = fp.readline()
16
17for i in range(0,7):
18 line = fp.readline()
19 value = line.split(",")
20 X1[i] = float(value[0])
21 Y1[i] = float(value[1])
22 Y2[i] = float(value[2])
23 Y8[i] = float(value[8])
24 Y9[i] = float(value[9])
25 Y10[i] = float(value[10])
26 Y11[i] = float(value[11])
27 Y8[i] /= Y1[i]
28 Y9[i] /= Y1[i]
29 Y10[i] /= Y1[i]
30 Y11[i] /= Y1[i]
31 #print (X1[i]*pow(2,i+1) * X1[i]*pow(2,i+1))/Y1[i]
32
33fig = pyplot.figure()
34
35fig.patch.set_facecolor('white')
36pyplot.xlabel("Compressibility",fontdict={'fontsize':16})
37pyplot.ylabel("Runtime (millisecs)/numcells",fontdict={'fontsize':16})
38
39pyplot.semilogy()
40
41pyplot.plot(Y2, Y8, color = 'green', linestyle='-', linewidth=1.0, marker='D', label='Full Perfect on GPU')
42pyplot.plot(Y2, Y9, color = 'orange', linestyle='-', linewidth=1.0, marker='D', label='7 write, 1 read on GPU')
43pyplot.plot(Y2, Y10, color = 'blue', linestyle='-', linewidth=1.0, marker='D', label='1 write, 3 read on GPU')
44pyplot.plot(Y2, Y11, color = 'red', linestyle='-', linewidth=1.0, marker='D', label='Compact GPU')
45
46pyplot.grid()
47pyplot.legend(loc = 2)
48pyplot.suptitle("Comparison of Neighbor Finding Algorithms on the GPU",fontdict={'fontsize':16})
49
50pyplot.savefig('neighbors_gpu.pdf',format='pdf')
51pyplot.show()
do_plots/neighbors_all.pdf +0 -0
(no content changes — binary or rename)
do_plots/neighbors_cpu.pdf +0 -0
(no content changes — binary or rename)
do_plots/neighbors_gpu.pdf +0 -0
(no content changes — binary or rename)