Does flagging a matrix as symmetric improving performances?
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.
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 <[email protected]> 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.
Hi Berry, Thank you for the hints. Actually, I am using MPIAIJ, does this mean I need to change the matrix format? Most of the time I am using CG + boomerAMG, do you think that using a sym matrix can be any good for the performance? Cheers
Set the flag, it cannot harm. I cannot see that hypre boomerAMG has options to indicate matrix symmetry to take advantage of it. Stefano or Mark would know better than I. No, do not change MPIAIJ it offers the most preconditioners. Barry
On Oct 21, 2022, at 11:36 AM, Edoardo alinovi <[email protected]> wrote:
Hi Berry,
Thank you for the hints. Actually, I am using MPIAIJ, does this mean I need to change the matrix format?
Most of the time I am using CG + boomerAMG, do you think that using a sym matrix can be any good for the performance?
Cheers
participants (2)
-
Barry Smith -
Edoardo alinovi