[petsc-users] Condition number of matrix

Barry Smith bsmith at mcs.anl.gov
Tue Aug 30 07:05:14 CDT 2016


   The format of .petscrc requires each option to be on its own line

> -ksp_view
> -pc_type none
> -ksp_type gmres
> -ksp_monitor_singular_value
> -ksp_gmres_restart 1000



> On Aug 30, 2016, at 7:01 AM, Florian Lindner <mailinglists at xgm.de> wrote:
> 
> Hello,
> 
> there is a FAQ and a Stackoverflow article about getting the condition number of a petsc matrix:
> 
> http://www.mcs.anl.gov/petsc/documentation/faq.html#conditionnumber
> http://scicomp.stackexchange.com/questions/34/how-can-i-estimate-the-condition-number-of-a-large-sparse-matrix-using-petsc
> 
> Both tell me to add:
> 
> -pc_type none -ksp_type gmres -ksp_monitor_singular_value -ksp_gmres_restart 1000
> 
> to my options.
> 
> I add the line to .petscrc but nothing happens, no additional output at all. I added -ksp_view, so my .petscrc looks
> like that:
> 
> -ksp_view
> -pc_type none -ksp_type gmres -ksp_monitor_singular_value -ksp_gmres_restart 1000
> 
> The complete output is below, but something I wonder about:
> 
> GMRES: restart=30, shouldn't that be 1000
> 
> And where can I read out the condition number approximation?
> 
> Thanks,
> Florian
> 
> 
> KSP Object: 1 MPI processes
>  type: gmres
>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
>    GMRES: happy breakdown tolerance 1e-30
>  maximum iterations=10000
>  tolerances:  relative=1e-09, absolute=1e-50, divergence=10000.
>  left preconditioning
>  using nonzero initial guess
>  using PRECONDITIONED norm type for convergence test
> PC Object: 1 MPI processes
>  type: none
>  linear system matrix = precond matrix:
>  Mat Object:  C   1 MPI processes
>    type: seqsbaij
>    rows=14403, cols=14403
>    total: nonzeros=1044787, allocated nonzeros=1123449
>    total number of mallocs used during MatSetValues calls =72016
>        block size is 1
> (0) 13:58:35 [precice::impl::SolverInterfaceImpl]:395 in initialize: it 1 of 1 | dt# 1 | t 0 of 1 | dt 1 | max dt 1 |
> ongoing yes | dt complete no |
> (0) 13:58:35 [precice::impl::SolverInterfaceImpl]:446 in advance: Iteration #1
> KSP Object: 1 MPI processes
>  type: gmres
>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
>    GMRES: happy breakdown tolerance 1e-30
>  maximum iterations=10000
>  tolerances:  relative=1e-09, absolute=1e-50, divergence=10000.
>  left preconditioning
>  using nonzero initial guess
>  using PRECONDITIONED norm type for convergence test
> PC Object: 1 MPI processes
>  type: none
>  linear system matrix = precond matrix:
>  Mat Object:  C   1 MPI processes
>    type: seqsbaij
>    rows=14403, cols=14403
>    total: nonzeros=1044787, allocated nonzeros=1123449
>    total number of mallocs used during MatSetValues calls =72016
>        block size is 1



More information about the petsc-users mailing list