I am trying to do a simple parallel sparse matrix vector multiplications using PETSC. My sparse matrix is a simple tridiagonal laplacian matrix, which is distributed over multiple processors using PETSC.
My main question is that if I do the same operation by simply iterating over the vector and updating each value A[i] = -1*A[i-1] + 2*A[i] + -1*A[i+1], it takes much lesser time than by using the PETSC SpMV. Why is it so? Or am I doing something wrong?