[petsc-users] [petsc-3.2] LSQR new convergence test

Alexander Grayver agrayver at gfz-potsdam.de
Wed Sep 21 02:39:26 CDT 2011


Hong, Barry,

Thanks! Sorry for not to be clear, but Barry right, my question was how to get back to DefaultConvergenceTest in case of LSQR solver.

Barry, yes, both versions give the same two norms.

Can you clarify please how to implement that in Fortran:
void *cctx;
KSPDefaultConvergedCreate(&cctx);
KSPSetConvergenceTest(ksp,KSPDefaultConverged,cctx);

I'm a little bit confused about cctx parameter.

Regards,
Alexander


On 21.09.2011 01:10, Barry Smith wrote:
> It has its own monitor that provides additional information  -ksp_monitor_lsqr
>
> You can also remove the new convergence test and get back the old one with code like
>
> void *cctx;
> KSPDefaultConvergedCreate(&cctx);
> KSPSetConvergenceTest(ksp,KSPDefaultConverged,cctx);
>
> after the KSPType is set to LSQR. So if you are happy with the old test.
>
>
>    Do both versions give the same first two norms?
>
>> 0 KSP Residual norm 9.386670021557e-17
>>   1 KSP Residual norm 8.258308650175e-17
>    Barry
>
>
> On Sep 20, 2011, at 4:40 AM, Alexander Grayver wrote:
>
>> Hello,
>>
>> In comparison with petsc-3.1-p7 in the latest petsc LSQR solver behaves differently.
>>
>> In petsc31 I had:
>>
>>   0 KSP Residual norm 9.386670021557e-17
>> ...
>> 95 KSP Residual norm 9.341367317075e-18
>> Linear solve converged due to CONVERGED_RTOL iterations 95
>> KSP Object:
>>   type: lsqr
>>   maximum iterations=200, initial guess is zero
>>   tolerances:  relative=0.1, absolute=1e-50, divergence=10000
>>   left preconditioning
>>   using PRECONDITIONED norm type for convergence test
>> PC Object:
>>   type: none
>>   linear system matrix = precond matrix:
>>   Matrix Object:
>>     type=shell, rows=19584, cols=19584
>>
>> relative residual norm =    0.9951737192872134E-01
>>
>> Now, with petsc32 I have:
>>
>>   0 KSP Residual norm 9.386670021557e-17
>>   1 KSP Residual norm 8.258308650175e-17
>> Linear solve converged due to CONVERGED_RTOL_NORMAL iterations 1
>> KSP Object: 12 MPI processes
>>   type: lsqr
>>   maximum iterations=200, initial guess is zero
>>   tolerances:  relative=0.1, absolute=1e-50, divergence=10000
>>   left preconditioning
>>   using UNPRECONDITIONED norm type for convergence test
>> PC Object: 12 MPI processes
>>   type: none
>>   linear system matrix = precond matrix:
>>   Matrix Object:   12 MPI processes
>>     type: shell
>>     rows=19584, cols=19584
>> relative residual norm =    0.8797910900468064E+00
>>
>> So I found new convergence test here which sets CONVERGED_RTOL_NORMAL:
>> http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPLSQRDefaultConverged.html
>>
>> The question is, how to interpret this new test and make it works properly for me?
>> Thanks in advance.
>>
>> Regards,
>> Alexander



More information about the petsc-users mailing list