Parallel Algorithms HW 2

Cache effects are extremely important for large linear algebra. We want to get some experience with these effects.

Implement (Subscript[M, i,j])=(∑_k)(Subscript[A, i,k])(Subscript[B, k,j]) to compute M=A.B for compatible matrices A∈(ℝ^(n×m)) and B∈(ℝ^(m×p)) in C.  Your code will have three loops.  Pick a reasonably large problem and compare the time it takes to compute in all possible loop orders i.e. {i,j,k}, {j,i,k}, {k,i,j}, {k,j,i}, {i,k,j}, and {j,k,i}. Explain the effects if you can.

Use a BLAS library to compute the matrix vector product.  Compare the timing to the best loop order of your home-made code on a

Create an interesting plot of the times for your code as a function of two of the size parameters.