[petsc-users] Does flagging a matrix as symmetric improving performances?

Barry Smith bsmith at petsc.dev
Fri Oct 21 10:00:18 CDT 2022


 For most solvers, just setting this flag will not, by itself, will not improve the setup time. An exception to this is PCGAMG in the latest release where it will improve the solution time. 

 For some preconditioner situations you can use MATSBAIJ to store the matrix, this can help noticeably because only half of the matrix is stored and computed with.

 You can select KSP methods that specifically work only for symmetric operators (or symmetric positive definite operators) to get faster solve times but you need to do this explicitly, it is not done automatically.

  If you know the matrix is symmetric there is likely never a reason to not set the flag. Note also the flag MAT_SYMMETRY_ETERNAL that can be used in conjunction with 
MAT_SYMMETRIC if you know the matrix will remain symmetric despite changes may to its numerical values.

  Barry


> On Oct 21, 2022, at 10:52 AM, Edoardo alinovi <edoardo.alinovi at gmail.com> wrote:
> 
> Hi PETSc friends,
> 
> As per object, do you think that flagging a matrix as symmetric might improve setup times of the preconditioner?
> 
> Thank you as always.



More information about the petsc-users mailing list