[petsc-users] How to force the code run with a given number of iterations?

Jed Brown jedbrown at mcs.anl.gov
Wed Oct 30 19:49:31 CDT 2013


Fande Kong <fd.kong at siat.ac.cn> writes:

> Thanks,
>
> I got this message  *Linear solve converged due to CONVERGED_RTOL
> iterations 2*.
>
> What is the definition of RTOL in petsc?
>
> I doubt the RTOL is small.*
>
>
> *
>
>
> On Wed, Oct 30, 2013 at 6:38 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>
>> Fande Kong <fd.kong at siat.ac.cn> writes:
>>
>> > Hi all,
>> >
>> > How to force the code run with a given number of iterations?
>> >
>> > I use the following script to run code, but the code stop after doing
>> > *two*iterations:
>> >
>> > * mpirun -n 2 ./linearElasticity  -ksp_type gmres -pc_type asm
>> > -pc_asm_overlap 1 -sub_pc_type ilu -sub_pc_factor_levels 2 -sub_ksp_type
>> > preonly -sub_pc_factor_mat_ordering_type rcm -ksp_view - -ksp_rtol 1e-5
>> > -ksp_max_it 500 -ksp_monitor -ksp_monitor_singular_value*

You set the relative tolerance to 1e-5

>> > The residual history is listed as follows:
>> >
>> > *  0 KSP Residual norm 9.732477596672e+31

Your initial residual.

>> >   0 KSP Residual norm 9.732477596672e+31 % max 1.000000000000e+00 min
>> > 1.000000000000e+00 max/min 1.000000000000e+00
>> >   1 KSP Residual norm 8.532845325800e+31
>> >   1 KSP Residual norm 8.532845325800e+31 % max 4.821161757157e+55 min
>> > 4.821161757157e+55 max/min 1.000000000000e+00
>> >   2 KSP Residual norm 3.648279603061e+23

A residual that is 8 orders of magnitude smaller.


Your system is probably very poorly scaled (assuming taht 1e23 is not
"small" in your chosen units).  You need to fix the scaling if you want
to solve it accurately.

>> >   2 KSP Residual norm 3.648279603061e+23 % max 1.234581012401e+79 min
>> > 2.318814661396e+55 max/min 5.324190125905e+23
>> > *
>> >  The residual is not small enough to stop.
>>
>> -ksp_converged_reason will tell you why it exited early.
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131030/906c9705/attachment.pgp>


More information about the petsc-users mailing list