[petsc-dev] Lagging the numerical factorization for one of the fields of fieldsplit preconditioner

Barry Smith bsmith at mcs.anl.gov
Tue Mar 15 14:47:29 CDT 2011


On Mar 14, 2011, at 6:38 PM, Shri wrote:

> 
> 
> ----- Original Message -----
>> Shri,
>> 
>> In theory the flag for KSPSetOperators() (for example
>> SAME_PRECONDITIONER) is propagated down through the PCFIELDSPLIT into
>> the PC that is used on the A block. So in at least simple
>> circumstances if you use -snes_lag_preconditioner it should "just
>> work". I traced through the PCFIELDSPLIT and it does attempt to pass
>> it down.
>> 
>> Is it not working as expected?
> 
>  Yes,-snes_lag_preconditioner works as expected i.e it either builds both or none.
> 
>> 
>> Of course this means that any other part of the preconditioner are
>> also not rebuilt. So I guess if you used additive or multiplicative
>> fieldsplit with 2 splits it won't update a factorization of D etc.
> 
>> Do you want other things rebuilt, just not this one thing. 
> 
> Yes. This is exactly that i am looking for.
> 
> The system i'm trying to solve is of the form
> 0 = A*y + g(x)
> 0 = f(x,y)
> which has the jacobian
> 
>  | A      dg_dx |
>  | df_dy  df_dx |
> 
> I'm using the schur preconditioner which needs factorization of A and (df_dx - df_dy*inv(A)*dg_dx).

   df_dx - df_dy*inv(A)*dg_dx is never formed (and hence never factored) it is dense and way to expensive to ever form.  Now approx inverse(df_dx) may be used as a preconditioner for the Schur complement and this means df_dx would be factored.

  Please send me the output from running with -snes_view so I can see exactly what Schur complement preconditioner you are forming.

    In affect I think you are correct we want A to not be factored each time because A is a constant matrix that does not change. Is this correct?

    Do you form the big-assed matrix 
> | A      dg_dx |
>  | df_dy  df_dx |

  explicitly as one big matrix?  And each time-step you changes values in the dg_dx, df_dy  and df_dx parts with MatSetValues?


    One fix may be to make PCSetUp() smarter and know the matrix has not changed and hence it doesn't have to be refactored (instead of only relying on the flag passed to KSPSetOperators()).

   Barry



> Since,A is constant
> it needs to be factorized only once while (df_dx - df_dy*inv(A)*dg_dx) is not constant and needs to be refactorized.
> 
>> This will be
>> tricky because we don't have a mechanism to pass this information down
>> into PCFIELDSPLIT. Tell me exactly what you want to do that it cannot
>> currently do and I'll what we can do about it.
> 
> Currently,the factorization is done for 'both or none'.I wanted the factorization to be done for 'either,both,or none'. 
> I was thinking about having an option say -fieldsplit_xxx_lag_preconditioner <niterations> which 
> will delay the refactorization for field xxx by niterations and if niterations
> is set to -1 then it will not update the factorization.
> 
> Thanks,
> Shri
> 
>> 
>> Barry
>> 
>> 
>> 
>> On Mar 14, 2011, at 4:41 PM, Shri wrote:
>> 
>>> 
>>>           | A B | |dx| |fx|
>>> Jacobian = =
>>>           | C D | |dy| |fy|
>>> 
>>> While solving this linear system with a fieldsplit precondioner,is
>>> there a way to lag the numerical factorization of the A matrix. The
>>> A matrix in my application is constant and is about 3-4 times bigger
>>> than the D matrix. The log summary shows that about 90% of the time
>>> is spent in the numerical factorization phase. So i would like to do
>>> the numerical factorization for A matrix just once and not have it
>>> factorized for all the snes iterations.
>>> Speaking on the same note, should snes lag_preconditioner
>>> functionality be moved to ksp or maybe a
>>> -fieldsplit_xxx_lag_preconditioner option?
>>> 
>>> Thanks,
>>> Shri




More information about the petsc-dev mailing list