# Matrix Vector Multiplication Parallel

CLRS book has the following algorithm for parallel for matrix vector multiplication

My problem is, can't we use a simple approach like this,

MAT-VEC-MULTIPLY-MAIN(A,x,y,n)
for i = 2 to n
spawn MULTIPLY-ROW(A,x,y,n,i)

MULTIPLY-ROW(A,x,y,n,1)
sync

MULTIPLY-ROW(A,x,y,,n,row)
for j = 1 to n
y[row] = y[row] + a[row]j.xj


Both approaches generate same number of threads (One thread for each row). Is there any performance difference between these two?

• Can you profile them and see? – user1118321 Jul 14 '17 at 2:40