[petsc-dev] Using PCFieldSplitSetIS

Matthew Knepley knepley at gmail.com
Wed Mar 16 09:04:52 CDT 2011


On Wed, Mar 16, 2011 at 8:57 AM, Thomas Witkowski <
thomas.witkowski at tu-dresden.de> wrote:

> Matt, it makes the output nicer, but does not help me to understand what's
> going on inside of PETSc:
>
>
>   Residual norms for fieldsplit_boundary_ solve.
>   0 KSP Residual norm 1.790059331071e-04
>   1 KSP Residual norm 1.237356212928e-04
>   2 KSP Residual norm 7.952220245101e-05
>   3 KSP Residual norm 3.502858665398e-05
>   4 KSP Residual norm 1.601085190129e-05
>   5 KSP Residual norm 8.491161243057e-06
>   6 KSP Residual norm 4.778227395989e-06
>   7 KSP Residual norm 2.571919352633e-06
>   8 KSP Residual norm 1.353979940120e-06
>   9 KSP Residual norm 7.408377337496e-07
>  10 KSP Residual norm 3.810694345834e-07
>  11 KSP Residual norm 1.955889542056e-07
>  12 KSP Residual norm 9.938906113920e-08
>  13 KSP Residual norm 4.893445675773e-08
>  14 KSP Residual norm 2.395128458062e-08
>  15 KSP Residual norm <1.2464425896>1.246442589657e-08
>  16 KSP Residual norm 6.316454504022e-09
>  17 KSP Residual norm 3.088668836241e-09
>  18 KSP Residual norm 1.593454221996e-09
>  0 KSP preconditioned resid norm 5.745043818120e-01 true resid norm
> 1.584249437360e-01 ||r(i)||/||b|| 1.000000000000e+00
>   Residual norms for fieldsplit_boundary_ solve.
>   0 KSP Residual norm 1.790059331000e-04
>   1 KSP Residual norm 1.237356237744e-04
>   2 KSP Residual norm 7.952220078415e-05
>   3 KSP Residual norm 3.502859285561e-05
>   4 KSP Residual norm 1.601086485810e-05
>   5 KSP Residual norm 8.491169384185e-06
>   6 KSP Residual norm 4.778229157872e-06
>   7 KSP Residual norm 2.571917112191e-06
>   8 KSP Residual norm 1.353977280183e-06
>   9 KSP Residual norm 7.408352317360e-07
>  10 KSP Residual norm 3.810710583336e-07
>  11 KSP Residual norm 1.955898169394e-07
>  12 KSP Residual norm 9.938892788465e-08
>  13 KSP Residual norm 4.893428546840e-08
>  14 KSP Residual norm 2.395120857135e-08
>  15 KSP Residual norm <1.2464367927>1.246436792784e-08
>  16 KSP Residual norm 6.316409779118e-09
>  17 KSP Residual norm 3.088649355374e-09
>  18 KSP Residual norm 1.593449602302e-09
>   Residual norms for fieldsplit_boundary_ solve.
>   0 KSP Residual norm 1.593449603155e-09
>   1 KSP Residual norm 1.011857676662e-09
>   2 KSP Residual norm 5.660892669788e-10
>   3 KSP Residual norm 3.046799343903e-10
>   4 KSP Residual norm <1.6004713993>1.600471399329e-10
>   5 KSP Residual norm 8.083216601016e-11
>   6 KSP Residual norm 4.308671648345e-11
>   7 KSP Residual norm 2.381959817139e-11
>   8 KSP Residual norm 1.264839790114e-11
>   9 KSP Residual norm 6.435098853282e-12
>  10 KSP Residual norm 3.184769579797e-12
>  11 KSP Residual norm <1.5022019430>1.502201943016e-12
>  12 KSP Residual norm 7.099486208425e-13
>  13 KSP Residual norm 3.443222176388e-13
>  14 KSP Residual norm <1.6478434989>1.647843498912e-13
>  15 KSP Residual norm 8.208508173926e-14
>  16 KSP Residual norm 4.376604355287e-14
>  17 KSP Residual norm 2.596069152755e-14
>  18 KSP Residual norm 1.335744434252e-14
>  1 KSP preconditioned resid norm 2.608069232839e-13 true resid norm
> 1.449869994655e-13 ||r(i)||/||b|| 9.151778504469e-13
>
>
> So, are there now two or one outer iterations?
>

1 outer (NOT INDENTED) which took two iterates. 1 inner (INDENTED) which ran
3 times.

   Matt


> Thomas
>
>
>
>
> Matthew Knepley wrote:
>
>> On Wed, Mar 16, 2011 at 8:27 AM, Thomas Witkowski <
>> thomas.witkowski at tu-dresden.de <mailto:thomas.witkowski at tu-dresden.de>>
>> wrote:
>>
>>    Jed Brown wrote:
>>
>>        On Wed, Mar 16, 2011 at 07:37, Thomas Witkowski
>>        <thomas.witkowski at tu-dresden.de
>>        <mailto:thomas.witkowski at tu-dresden.de>
>>        <mailto:thomas.witkowski at tu-dresden.de
>>        <mailto:thomas.witkowski at tu-dresden.de>>> wrote:
>>
>>           Thanks for explanations! It works fine in my code. But I
>>        have two
>>           questions about it, maybe you can help me with them:
>>           - To the first, is the LU factorization on block A_00 done
>>        only once?
>>
>>
>>        Yes, one way to confirm this is to run with -log_summary and
>>        check MatLUFactor{Sym,Num}.
>>                    - I have run the code with -fieldsplit_1_ksp_monitor to
>> get
>>        some
>>           more information about the internal solves. I expected to get
>>           information about one iterative solver (for solving the Schur
>>           complement system), but I got three, all of them need around 20
>>           iterations for my example. Could you explain to me what is
>>           actually solved there?
>>
>>
>>        I'm going to guess that you still have an outer KSP that (in
>>        the global norm, rather than the partitioned norm used inside
>>        of splits) has a tighter tolerance, therefore it takes a few
>>        outer iterations. If you use loose inner tolerances then the
>>        preconditioner becomes nonlinear and you'll need to use FGMRES
>>        for the outer. When in doubt, run with -ksp_view and show us
>>        the results if you don't understand. Additionally, monitoring
>>        inner solves separately can be useful, e.g.
>>        -fieldsplit_0_ksp_converged_reason -fieldsplit_1_ksp_monitor
>>        -ksp_monitor_true_residual.
>>
>>    Okay, I run my code with the options "-pc_fieldsplit_type schur
>>    -fieldsplit_interior_ksp_type preonly -fieldsplit_interior_pc_type
>>    bjacobi -fieldsplit_interior_sub_pc_type lu
>>    -fieldsplit_boundary_ksp_monitor -ksp_monitor_true_residual
>>    -fieldsplit_interior_ksp_converged_reason". The splits are named
>>    "interior" and "boundary". The ksp output is as follows:
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      Residual norms for fieldsplit_boundary_ solve.
>>      0 KSP Residual norm 1.790059331071e-04
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      1 KSP Residual norm 1.237356212928e-04
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      2 KSP Residual norm 7.952220245101e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      3 KSP Residual norm 3.502858665398e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      4 KSP Residual norm 1.601085190129e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      5 KSP Residual norm 8.491161243057e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      6 KSP Residual norm 4.778227395989e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      7 KSP Residual norm 2.571919352633e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      8 KSP Residual norm 1.353979940120e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      9 KSP Residual norm 7.408377337496e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     10 KSP Residual norm 3.810694345834e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     11 KSP Residual norm 1.955889542056e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     12 KSP Residual norm 9.938906113920e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     13 KSP Residual norm 4.893445675773e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     14 KSP Residual norm 2.395128458062e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     15 KSP Residual norm <1.2464425896>1.2464425896 <tel: <1.2464425896>
>> 1.2464425896>57e-08
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     16 KSP Residual norm 6.316454504022e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     17 KSP Residual norm 3.088668836241e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     18 KSP Residual norm 1.593454221996e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>    [0]  Petsc-Iteration 0: 0.574504
>>     0 KSP preconditioned resid norm 5.745043818120e-01 true resid
>>    norm 1.584249437360e-01 ||r(i)||/||b|| 1.000000000000e+00
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      Residual norms for fieldsplit_boundary_ solve.
>>      0 KSP Residual norm 1.790059331000e-04
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      1 KSP Residual norm 1.237356237744e-04
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      2 KSP Residual norm 7.952220078415e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      3 KSP Residual norm 3.502859285561e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      4 KSP Residual norm 1.601086485810e-05
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      5 KSP Residual norm 8.491169384185e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      6 KSP Residual norm 4.778229157872e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      7 KSP Residual norm 2.571917112191e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      8 KSP Residual norm 1.353977280183e-06
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      9 KSP Residual norm 7.408352317360e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     10 KSP Residual norm 3.810710583336e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     11 KSP Residual norm 1.955898169394e-07
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     12 KSP Residual norm 9.938892788465e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     13 KSP Residual norm 4.893428546840e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     14 KSP Residual norm 2.395120857135e-08
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     15 KSP Residual norm <1.2464367927>1.2464367927 <tel: <1.2464367927>
>> 1.2464367927>84e-08
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     16 KSP Residual norm 6.316409779118e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     17 KSP Residual norm 3.088649355374e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     18 KSP Residual norm 1.593449602302e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      Residual norms for fieldsplit_boundary_ solve.
>>      0 KSP Residual norm 1.593449603155e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      1 KSP Residual norm 1.011857676662e-09
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      2 KSP Residual norm 5.660892669788e-10
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      3 KSP Residual norm 3.046799343903e-10
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      4 KSP Residual norm <1.6004713993>1.6004713993 <tel: <1.6004713993>
>> 1.6004713993>29e-10
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      5 KSP Residual norm 8.083216601016e-11
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      6 KSP Residual norm 4.308671648345e-11
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      7 KSP Residual norm 2.381959817139e-11
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      8 KSP Residual norm 1.264839790114e-11
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>      9 KSP Residual norm 6.435098853282e-12
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     10 KSP Residual norm 3.184769579797e-12
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     11 KSP Residual norm <1.5022019430>1.5022019430 <tel: <1.5022019430>
>> 1.5022019430>16e-12
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     12 KSP Residual norm 7.099486208425e-13
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     13 KSP Residual norm 3.443222176388e-13
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     14 KSP Residual norm <1.6478434989>1.6478434989 <tel: <1.6478434989>
>> 1.6478434989>12e-13
>>
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     15 KSP Residual norm 8.208508173926e-14
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     16 KSP Residual norm 4.376604355287e-14
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     17 KSP Residual norm 2.596069152755e-14
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     18 KSP Residual norm 1.335744434252e-14
>>      Linear solve converged due to CONVERGED_ITS iterations 1
>>     1 KSP preconditioned resid norm 2.608069232839e-13 true resid
>>    norm 1.449869994655e-13 ||r(i)||/||b|| 9.151778504469e-13
>>
>>    I have no idea how to interpret this output! Could you help me
>>    with it?
>>
>>
>> Get rid of -fieldsplit_interior_ksp_converged_reason. It is confusing
>> things. Then you will see
>> the outer iteration and the inner boundary iteration which is indented.
>>
>>   Matt
>>
>>
>>    Thomas
>>
>>
>>
>>
>> --
>> 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
>>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110316/35c3597a/attachment.html>


More information about the petsc-dev mailing list