Stopping criteria

Barry Smith bsmith at mcs.anl.gov
Thu Jan 15 12:05:27 CST 2009


    When something so basic goes wrong. CG kicks out because the  
matrix is not
symmetric positive definite, you need to step back and understand more  
about the
matrix before worrying about running in parallel fast.

    So, yes, you should run sequentially to "play around" with the  
matrix. You can
use a MatType of MATAIJ in MatSetType() to have it automatically be  
SEQAIJ
on one process and MPIAIJ on more than one. or MATBAIJ for BAIJ format.

    You can then try direct solver, for example, trivially to begin to  
understand the
matrix. You can also use MatIsSymmetric() to determine if it truly is  
symmetric
or something went wrong in assembly. You can also try -pc_type none and
see what happens.

    Barry



On Jan 15, 2009, at 10:24 AM, Nguyen, Hung V ERDC-ITL-MS wrote:

> Hello Matt,
>
>> however I would first check your matrix using -pc_type lu -ksp_type  
>> preonly
> to make sure its not singular.
>
> I got the error message below while running with option above. Do I  
> have to
> build a matrix with type of seqaij/seqbaij to run with the -pc_type lu
> option?
>
> Thanks,
>
> -Hung
>
>
>
>  np ..       138524
>  np ..       143882
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: [15]PETSC ERROR: [12]PETSC ERROR: [8]PETSC ERROR:
> --------------------- Error Message  
> ------------------------------------
> [4]PETSC ERROR: [6]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [13]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> --------------------- Error Message  
> ------------------------------------
> [15]PETSC ERROR: [13]PETSC ERROR: No support for this operation for  
> this
> object type!
> [12]PETSC ERROR: [15]PETSC ERROR: No support for this operation for  
> this
> object type!
> No support for this operation for this object type!
> [12]PETSC ERROR: Matrix type mpiaij  symbolic LU!
> Matrix type mpiaij  symbolic LU!
> [13]PETSC ERROR: [15]PETSC ERROR: [12]PETSC ERROR: Matrix type mpiaij
> symbolic LU!
> [13]PETSC ERROR:
> ------------------------------------------------------------------------
>
>
>
> -----Original Message-----
> From: owner-petsc-users at mcs.anl.gov [mailto:owner-petsc-users at mcs.anl.gov 
> ] On
> Behalf Of Matthew Knepley
> Sent: Wednesday, January 14, 2009 2:05 PM
> To: petsc-users at mcs.anl.gov
> Subject: Re: Stopping criteria
>
> On Wed, Jan 14, 2009 at 1:54 PM, Nguyen, Hung V ERDC-ITL-MS
> <Hung.V.Nguyen at usace.army.mil> wrote:
>
>
>
> 	Hello All,
> 	
> 	I tried to solve an ill-conditioned system using cg with Jacobi
> 	preconditioned. The KSP solver was stopping due to diverged reason
> within a
> 	few iterations. Is there a way to keep KSP solver running until
> max_it?
>
>
> There is no way to continue CG here because it gets a zero divisor,  
> and
> interprets this as an indefinite matrix. You can try GMRES, however  
> I would
> first check your matrix using -pc_type lu -ksp_type preonly to make  
> sure its
> not singular.
>
>  Matt
>
>
>
> 	Thanks,
> 	
> 	-hung
> 	
> 	hvnguyen:jade23% aprun -n 16 ./test_matrix_read -ksp_type cg -pc_type
> jacobi
> 	-ksp_rtol 1.0e-15 -ksp_max_it 50000 -ksp_monitor
> -ksp_converged_reason
> 	 0 KSP Residual norm 1.379074550666e+04
> 	 1 KSP Residual norm 7.252034661743e+03
> 	 2 KSP Residual norm 7.302184771313e+03
> 	 3 KSP Residual norm 1.162244351275e+04
> 	 4 KSP Residual norm 7.912531765659e+03
> 	 5 KSP Residual norm 4.094706251487e+03
> 	 6 KSP Residual norm 5.486131070301e+03
> 	 7 KSP Residual norm 6.367904529202e+03
> 	 8 KSP Residual norm 6.312767173219e+03
> 	Linear solve did not converge due to DIVERGED_INDEFINITE_MAT
> iterations 9
> 	Time in PETSc solver: 0.452695 seconds
> 	The number of iteration       = 9
> 	The solution residual error = 6.312767e+03
> 	
> 	
>
>
>
>
> --
> What most experimenters take for granted before they begin their  
> experiments
> is infinitely more interesting than any results to which their  
> experiments
> lead.
> -- Norbert Wiener
>




More information about the petsc-users mailing list