Commit cf0e6dc3 authored by petros.anastasiadis's avatar petros.anastasiadis

Finallize

parent 69f6179e
......@@ -3,4 +3,3 @@
**/*.out
**/*.err
**/*.debug
Outputs/
# Put all debug files(.debug) for common run values to a single 'Debug' directory in order to compare them
cd Debug
for filename in *
do
for filename1 in *
do
diff $filename $filename1
done
done
# A folder for program Running/Debugging
# Run all files. Must update if changes are made in directory tree
submit=sbatch
cd ../Serial
make
$submit Serial.slurm 25000
cd ../OpenMP
make
$submit OpenMP.slurm 25000
cd ../GPUs
make
$submit GPU.slurm 25000
cd ../MPI
make
$submit MPI.slurm 25000
import matplotlib.pyplot as plt
import numpy as np
def autolabel(rects):
"""
Attach a text label above each bar displaying its height
"""
for rect in rects:
height = float(rect.get_height())
ax.text(rect.get_x() + rect.get_width()/2., 1.05*height,
'%.4f' % float(height),
ha='center', va='bottom')
with open('GPU.out') as file:
list0 = file.readlines()
with open('Serial.out') as file:
list1 = file.readlines()
nm=["naive_cuda", "coalesced_cuda", "shmem_cuda", "cuBLAS"]
res0=[]
res=[]
res1=[]
res2=[]
res3=[]
nm=[]
for i in range(0,3):
n = int(((list0[4*i].split()[3]).split('=')[1])[:-1])
m = int(((list0[4*i].split()[4]).split('=')[1])[:-2])
nm.append(str(n) + "x" + str(m))
#print " n=" + str(n) + ", m=" + str(m) + ")"
GFlops_ms = 2 * n * m *1000/1.e9
res0.append( GFlops_ms/float(list0[4*i].split()[6]))
res.append( GFlops_ms/float(list0[4*i+1].split()[7]))
res1.append( GFlops_ms/float(list0[4*i+2].split()[7]))
res2.append( GFlops_ms/float(list0[4*i+3].split()[6]))
res3.append( GFlops_ms/float(list1[i].split()[4]))
fig, ax = plt.subplots(figsize=(16, 9),dpi=300)
N = 3
ind = np.arange(N) # the x locations for the groups
width = 0.10 # the width of the bars
rect0 = ax.bar(ind + 0.15, res0, width, color='r',label='naive_cuda')
rect = ax.bar(ind + 0.30, res, width, color='b',label='coalesced_cuda')
rect1 = ax.bar(ind + 0.45, res1, width, color='g',label='shmem_cuda')
rect2 = ax.bar(ind + 0.60, res2, width, color='k',label='cuBLAS')
rect3 = ax.bar(ind, res3, width, color='c',label='Serial')
ax.set_ylabel('GFLOPS/s')
ax.set_xlabel('Array_size')
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(nm)#rotation = (60))
#autolabel(rect)
ax.set_title( "GPU Benchmark" )
ax.legend(prop={'size':10},loc=2)
plt.savefig('GPU_version_gflops.png', bbox_inches='tight')
plt.close()
import matplotlib.pyplot as plt
import numpy as np
def autolabel(rects):
"""
Attach a text label above each bar displaying its height
"""
for rect in rects:
height = float(rect.get_height())
ax.text(rect.get_x() + rect.get_width()/2., 1.05*height,
'%.4f' % float(height),
ha='center', va='bottom')
with open('GPU.out') as file:
list0 = file.readlines()
with open('Serial.out') as file:
list1 = file.readlines()
with open('mpi.out') as file:
list2 = file.readlines()
nodes = [1,2,4,8,16]
nm=[]
fig, ax = plt.subplots(figsize=(16, 9),dpi=300)
width = 0.1 # the width of the bars
col=['g','b','k','m','c','y']
N=len(nodes)
ind = np.arange(N) # the x locations for the groups
fig, ax = plt.subplots(figsize=(16, 9),dpi=300)
for i in range(0,3):
n = int(((list0[4*i].split()[3]).split('=')[1])[:-1])
m = int(((list0[4*i].split()[4]).split('=')[1])[:-2])
nm.append(str(n) + "x" + str(m))
#print " n=" + str(n) + ", m=" + str(m) + ")"
GFlops_ms = 2 * n * m *1000/1.e9
res0=[]
res=[]
for j in range(0,N):
res0.append( GFlops_ms/float(list0[12+3*j+i].split()[-5]))
res.append( GFlops_ms/float(list2[6*i+18*j+5].split()[-5]))
rect0 = ax.bar(ind + 0.3*i, res0, width, color=col[2*i],label='MPI-cuBLAS(2 GPUs/node)'+ nm[i])
rect = ax.bar(ind + 0.3*i+0.15, res, width, color=col[2*i+1],label='MPI-OpenMP(20 threads/node)'+ nm[i])
ax.set_ylabel('GFLOPS/(s*nodes)')
ax.set_xlabel('Nodes')
ax.set_xticks(ind)
ax.set_xticklabels(nodes)#rotation = (60))
#autolabel(rect)
ax.set_title( "Multinode Gflops" )
ax.legend(prop={'size':10},loc=2)
plt.savefig("Node_flops.png", bbox_inches='tight')
plt.close()
import matplotlib.pyplot as plt
import numpy as np
def autolabel(rects):
"""
Attach a text label above each bar displaying its height
"""
for rect in rects:
height = float(rect.get_height())
ax.text(rect.get_x() + rect.get_width()/2., 1.05*height,
'%.4f' % float(height),
ha='center', va='bottom')
with open('GPU.out') as file:
list0 = file.readlines()
with open('Serial.out') as file:
list1 = file.readlines()
with open('mpi.out') as file:
list2 = file.readlines()
nodes = [1,2,4,8,16]
nm=[]
width = 0.1 # the width of the bars
col=['g','b','k','m','c','y']
N=len(nodes)
ind = np.arange(N) # the x locations for the groups
fig, ax = plt.subplots(figsize=(16, 9),dpi=300)
for i in range(0,3):
n = int(((list0[4*i].split()[3]).split('=')[1])[:-1])
m = int(((list0[4*i].split()[4]).split('=')[1])[:-2])
nm.append(str(n) + "x" + str(m))
res0=[]
res=[]
serial = float(list1[i].split()[4])
for j in range(0,N):
gpu = float(list0[12+3*j+i].split()[-5])
omp = float(list2[6*i+18*j+5].split()[-5])
print "(" + str(i) + "," + str(nodes[j]) + ")gpu= "+ str(gpu) + ",omp= " + str(omp)
res0.append( serial/ gpu)
res.append( serial/ omp)
rect0 = ax.bar(ind + 0.3*i, res0, width, color=col[2*i],label='MPI-cuBLAS(2 GPUs/node)'+ nm[i])
rect = ax.bar(ind + 0.3*i + 0.15, res, width, color=col[2*i+1],label='MPI-OpenMP(20 threads/node)'+ nm[i])
ax.set_ylabel('Speedup')
ax.set_xlabel('Nodes')
ax.set_xticks(ind)
ax.set_xticklabels(nodes)#rotation = (60))
#autolabel(rect)
ax.set_title( "Multinode Speedup" )
ax.legend(prop={'size':10},loc=2)
plt.savefig("Node_Speedup.png", bbox_inches='tight')
plt.close()
import matplotlib.pyplot as plt
import numpy as np
def autolabel(rects):
"""
Attach a text label above each bar displaying its height
"""
for rect in rects:
height = float(rect.get_height())
ax.text(rect.get_x() + rect.get_width()/2., 1.05*height,
'%.4f' % float(height),
ha='center', va='bottom')
with open('OpenMP.out') as file:
list0 = file.readlines()
with open('Serial.out') as file:
list1 = file.readlines()
nm=["naive_cuda", "coalesced_cuda", "shmem_cuda", "cuBLAS"]
cores=[1,2,5,10,20,40]
col=['g','b','k','m','c','y']
res1=[]
res2=[]
res3=[]
nm=[]
fig, pl = plt.subplots(figsize=(16, 9),dpi=300)
for i in range(0,3):
n = int(((list1[i].split()[1]).split('=')[1])[:-1])
m = int(((list1[i].split()[2]).split('=')[1])[:-2])
nm.append(str(n) + "x" + str(m))
serial = float(list1[i].split()[4])
res0=[]
res=[]
print " n=" + str(n) + ", m=" + str(m) + ")"
for j in range(0,len(cores)):
#GFlops_ms = 2 * n * m *1000/1.e9
res0.append( serial/float(list0[12*i+2*j].split()[5]))
res.append( serial/float(list0[12*i+2*j+1].split()[5]))
y = plt.plot(cores,res0, color = col[2*i], label="OpenMP_Naive("+nm[i]+")")
y = plt.plot(cores,res, color = col[2*i+1], label="OpenMP_Aff("+nm[i]+")" )
y = plt.plot(cores,cores, color='r',label='Linear Speedup')
pl.set_ylabel('Speedup')
pl.set_xlabel('Cores')
#ax.set_xticks(ind + width / 2)
pl.set_xticklabels(cores)#rotation = (60))
#autolabel(rect)
pl.set_title( "OpenMP Benchmark" )
pl.legend(prop={'size':10},loc=2)
plt.savefig('OpenMP_version_speedup.png', bbox_inches='tight')
plt.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment