[Trilinos-Users] ML: reusing structures
Jonathan Hu
jhu at sandia.gov
Thu Feb 9 13:59:41 MST 2012
Hi Nico,
In answer to your questions:
1) As Eric pointed out, A is passed by reference.
2) In order to reuse the preconditioner, the sparsity pattern of A must
not change. In this way, all of the coarse grid information will still
be consistent (prolongators, coarse matrices, etc.). The smoothers can
be changed.
3) I can't reproduce the longer run times. Can you send me a short
example that demonstrates this?
Regards,
Jonathan
trilinos-users-request at software.sandia.gov wrote on 02/09/2012 11:00 AM:
> Subject:
> Re: [Trilinos-Users] ML: reusing structures
> From:
> Eric Marttila <eric.marttila at thermoanalytics.com>
> Date:
> Thu, 9 Feb 2012 10:22:34 -0500
>
>
> Nico,
> I don't know enough to answer your 2nd and 3rd questions, but regarding your
> first question: Internally, the MultiLevelPreconditioner class holds a pointer
> to the A matrix. You are not really passing it 'by value' - it is being
> passed by reference since the MultiLevelPreconditioner constructor is defined
> to take a reference.
>
> Hope this helps.
> --Eric
>
> On Thursday, February 09, 2012 06:28:11 am Nico Schlömer wrote:
>> > Hi,
>> >
>> > I've started to get my hands a little dirty with ML's reusing
>> > strategies, specifically referring to
>> > http://trilinos.sandia.gov/packages/docs/dev/packages/ml/doc/html/classML__
>> > Epetra_1_1MultiLevelPreconditioner.html#a0a5c1d47c6938d2ec1cb9bb710723c1e
>> >
>> > If what I understand from the docs is correct, then
>> > MultiLevelPreconditioner
>> > =================*snip* =================
>> > // set up matrix A (ptr)
>> > if ( ML is not build )
>> > {
>> > // set up ML list
>> > MlPrec_ = Teuchos::rcp( new ML_Epetra::MultiLevelPreconditioner(
>> > *A, MLList ) );
>> > }
>> > // Solve linear systems with MLPrec, A
>> >
>> > // change values of A, not its pointer
>> >
>> > MlPrec_->ComputePreconditioner();
>> > // ? MlPrec_->ReComputePreconditioner();
>> >
>> > // Solve more linear systems with MLPrec, A
>> > =================*snap* =================
>> >
>> > is what you're supposed to do.
>> >
>> > Three questions about it:
>> >
>> > (a) Out of interest: How is the data of the matrix A handled in ML?
>> > Are references to it passed around?
>> > It seems a bit funny to pass in A by value (*A), but then after
>> > that the pointer to A can't change.
>> > (b) There is also ReComputePreconditioner(). What are possible use cases
>> > for it? (c) ComputePreconditioner runs about twice as long with
>> > checkFiltering*disabled*. Is this somethings that's supposed to happen?
>> >
>> > Cheers,
>> > Nico
More information about the Trilinos-Users
mailing list