Hi, I saw MatMult() is used in ex2 as, Vec u, b; ierr = MatMult(A,u,b); MatMult is defined as, PetscErrorCode MatMult(Mat mat,Vec x,Vec y) Should be PetscErrorCode MatMult(Mat mat,Vec x,Vec &y)? Thanks. Yixun