Re: [petsc-dev] MatMult implementation
On Jan 26, 2015, at 2:53 AM, Ronal Celaya <[email protected]> wrote:
Hello everyone. I'm work on CG implementation using PETSc. I know that PETSc has a solver (ksp) but I want to implement it step by step. How PETSc implements MatMult multiplication? I mean, where can I find the algorithm used by PETSc to do Matrix-vector multiplication?
The implementation depends on the data structure used to store the matrix and whether it is parallel or not. There are many of the them: The most basic is MatMult_SeqAIJ: located at http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/seq/aij.c.html#... for parallel http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpiaij.c.ht... The parallel one just does the needed communication and calls the sequential one twice. See the manual page for http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateAIJ... for a detailed discussion of the storage format of the parallel matrices. Barry
Sorry for my English
Regards,
-- Ronal Celaya
participants (1)
-
Barry Smith