Skip to content

Commit

Permalink
Add results and changes to the main script
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiCorbilla committed Aug 14, 2016
1 parent 2c720f9 commit f5ad4ec
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 14 deletions.
144 changes: 144 additions & 0 deletions src/Logs/cpu.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
19:11:07 , 0.0, 0.0, 0.0, 0.0
19:11:07 , 0.0, 0.0, 0.0, 0.0
19:11:07 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:08 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:09 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:10 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:11 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:12 , 0.0, 0.0, 0.0, 0.0
19:11:13 , 0.0, 0.0, 0.0, 0.0
19:11:13 , 0.0, 0.0, 0.0, 0.0
19:11:13 , 0.0, 0.0, 0.0, 0.0
19:11:13 , 0.0, 0.0, 0.0, 0.0
19:11:13 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:14 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:15 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:16 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:17 , 0.0, 0.0, 0.0, 0.0
19:11:18 , 0.0, 0.0, 0.0, 0.0
19:11:18 , 0.0, 0.0, 0.0, 0.0
19:11:18 , 0.0, 0.0, 0.0, 0.0
19:11:18 , 0.0, 0.0, 0.0, 0.0
19:11:18 , 0.0, 0.0, 0.0, 0.0
19:11:19 , 57.0, 62.0, 68.0, 69.0
19:11:19 , 84.0, 85.0, 92.0, 97.0
19:11:19 , 115, 120, 125, 127
19:11:20 , 73.0, 75.5, 76.0, 80.0
19:11:20 , 87.0, 90.0, 90.5, 92.5
19:11:20 , 102, 103, 103, 105
19:11:20 , 77.0, 77.6, 78.3, 80.3
19:11:21 , 86.6, 87.3, 89.0, 91.0
19:11:21 , 97.3, 98.3, 98.3, 102
19:11:21 , 105, 108, 108, 112
19:11:22 , 89.2, 90.2, 91.0, 92.7
19:11:22 , 96.0, 98.7, 99.7, 101
19:11:22 , 82.8, 84.2, 85.2, 85.8
19:11:23 , 88.6, 90.8, 91.8, 92.8
19:11:23 , 93.8, 96.8, 98.2, 99.4
19:11:23 , 83.5, 85.8, 87.1, 87.3
19:11:24 , 88.5, 90.6, 91.3, 92.5
19:11:24 , 93.1, 95.8, 97.3, 98.0
19:11:24 , 83.1, 85.4, 86.5, 87.1
19:11:25 , 87.8, 90.2, 90.8, 92.2
19:11:25 , 93.2, 95.1, 95.7, 96.4
19:11:25 , 98.1, 100, 100, 101
19:11:26 , 89.5, 91.7, 92.0, 93.2
19:11:26 , 93.3, 95.2, 95.7, 96.3
19:11:26 , 97.6, 99.6, 100, 100
19:11:27 , 90.5, 92.0, 92.0, 93.0
19:11:27 , 94.0, 95.4, 95.5, 95.8
19:11:27 , 87.8, 88.8, 88.8, 89.0
19:11:28 , 90.7, 91.7, 91.8, 91.9
19:11:28 , 94.2, 94.3, 94.7, 94.9
19:11:28 , 97.6, 97.7, 97.9, 98.0
19:11:29 , 91.4, 92.0, 92.0, 92.0
19:11:29 , 93.6, 94.5, 94.6, 94.7
19:11:29 , 96.3, 96.9, 97.1, 97.5
19:11:30 , 90.6, 91.5, 91.6, 92.0
19:11:30 , 92.8, 94.0, 94.2, 94.8
19:11:30 , 95.0, 96.7, 96.7, 97.5
19:11:31 , 0.0, 0.0, 0.0, 0.0
19:11:31 , 0.0, 0.0, 0.0, 0.0
19:11:31 , 0.0, 0.0, 0.0, 0.0
19:11:31 , 0.0, 0.0, 0.0, 0.0
19:11:31 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:32 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:33 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:34 , 0.0, 0.0, 0.0, 0.0
19:11:35 , 0.0, 0.0, 0.0, 0.0
19:11:35 , 0.0, 0.0, 0.0, 0.0
19:11:35 , 0.0, 0.0, 0.0, 0.0
19:11:35 , 0.0, 0.0, 0.0, 0.0
19:11:35 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:36 , 0.0, 0.0, 0.0, 0.0
19:11:37 , 0.0, 0.0, 0.0, 0.0
Binary file added src/Logs/cpu.xlsx
Binary file not shown.
Binary file modified src/ParseLog/parseLog.identcache
Binary file not shown.
10 changes: 10 additions & 0 deletions src/ParseLog/parseLog.stat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Stats]
EditorSecs=763
DesignerSecs=609
InspectorSecs=111
CompileSecs=16625
OtherSecs=274
StartTime=13/08/2016 12:51:37
RealKeys=0
EffectiveKeys=0
DebugSecs=4974
Binary file modified src/documentation/Results.xlsx
Binary file not shown.
34 changes: 20 additions & 14 deletions src/examples/matrix multiplication/matrixmultiplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

assert numberRows == numberColumns

print ("Initialising variables.\n")
#print ("Initialising variables.\n")
a = np.zeros(shape=(numberRows, numberColumns))
b = np.zeros(shape=(numberRows, numberColumns))
c = np.zeros(shape=(numberRows, numberColumns))
Expand All @@ -43,8 +43,8 @@ def populateMatrix( p ):
rank = comm.Get_rank()
processorName = MPI.Get_processor_name()

print ("Process %d started.\n" % (rank))
print ("Running from processor %s, rank %d out of %d processors.\n" % (processorName, rank, worldSize))
#print ("Process %d started.\n" % (rank))
#print ("Running from processor %s, rank %d out of %d processors.\n" % (processorName, rank, worldSize))

#Calculate the slice per worker
if (worldSize == 1):
Expand All @@ -59,7 +59,8 @@ def populateMatrix( p ):
comm.Barrier()

if rank == TaskMaster:
print ("Initialising Matrix A and B (%d,%d).\n" % (numberRows, numberColumns))
#print ("Initialising Matrix A and B (%d,%d).\n" % (numberRows, numberColumns))
print ("Start")
populateMatrix(a)

for i in range(1, worldSize):
Expand All @@ -69,20 +70,20 @@ def populateMatrix( p ):
comm.send(row, dest=i, tag=i)
for j in range(0, slice):
comm.send(a[j+offset,:], dest=i, tag=j+offset)
print ("All sent to workers.\n")
#print ("All sent to workers.\n")

comm.Barrier()

if rank != TaskMaster:

print ("Data Received from process %d.\n" % (rank))
#print ("Data Received from process %d.\n" % (rank))
offset = comm.recv(source=0, tag=rank)
recv_data = comm.recv(source=0, tag=rank)
for j in range(1, slice):
c = comm.recv(source=0, tag=j+offset)
recv_data = np.vstack((recv_data, c))

print ("Start Calculation from process %d.\n" % (rank))
#print ("Start Calculation from process %d.\n" % (rank))

#Loop through rows
t_start = MPI.Wtime()
Expand All @@ -106,24 +107,29 @@ def populateMatrix( p ):

print("Process %d finished in %5.4fs.\n" %(rank, t_diff))
#Send large data
print ("Sending results to Master %d bytes.\n" % (send.nbytes))
#print ("Sending results to Master %d bytes.\n" % (send.nbytes))
comm.Send([send, MPI.FLOAT], dest=0, tag=rank) #1, 12, 23

comm.Barrier()

if rank == TaskMaster:
print ("Checking response from Workers.\n")
#print ("Checking response from Workers.\n")
res1 = np.zeros(shape=(slice, numberColumns))
comm.Recv([res1, MPI.FLOAT], source=1, tag=1)
print ("Received response from 1.\n")
#print ("Received response from 1.\n")
kl = np.vstack((res1))
for i in range(2, worldSize):
resx= np.zeros(shape=(slice, numberColumns))
comm.Recv([resx, MPI.FLOAT], source=i, tag=i)
print ("Received response from %d.\n" % (i))
#print ("Received response from %d.\n" % (i))
kl = np.vstack((kl, resx))
print ("End")
#print ("Result AxB.\n")
#print (kl)

comm.Barrier()




print ("Result AxB.\n")
print (kl)

comm.Barrier()

0 comments on commit f5ad4ec

Please sign in to comment.