[Trilinos-Users] Segmentation fault when using setPrecOperator and user defined preconditoner

John Jomo john.jomo at tum.de
Wed May 31 04:29:03 EDT 2017


Hallo Mike,

the exception occurs AztecOO.cpp in the function 
Epetra_Aztec_precond(...) and is related to lines 1530 and 1531

1530: int ierr = A->ApplyInverse(*X, *Y);
1531: (ierr!=0) throw X->ReportError("Error in call to Epetra_Operator 
for preconditioner", ierr);

The ApplyInverse function seems to return an error code -3 in the 
Epetra_CrsMatrix::Solve( .. ) function (Epetra_CrsMatrix.cpp:1692)

It seems to me that I might be using the SetPrecOperator Interface in 
the wrong way. I actually only want to apply my user-defined 
preconditioner as a left preconditioner:  S A x = S y.
The matrix I pass to the SetPrecOperator function is the matrix S itself 
and not its inverse. Is this the intended use of the function?

I am a bit confused by the ApplyInverse function in 
Epetra_Aztec_precond(..). Is the AZ_PRECOND object meant to be S or its 
inverse?

Does the Epetra_Aztec_precond function just check if the preconditioner 
is valid?

Thanks for your help

John.


On 30.05.2017 22:05, Heroux, Michael A wrote:
>
> John,
>
> Can you send the error output?
>
> Mike
>
> *From: *Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf 
> of John Jomo <john.jomo at tum.de>
> *Date: *Monday, May 29, 2017 at 10:39 AM
> *To: *Trilinos Users <trilinos-users at trilinos.org>
> *Subject: *[EXTERNAL] [Trilinos-Users] Segmentation fault when using 
> setPrecOperator and user defined preconditoner
>
> Hallo,
>
> I want to apply a user-defined preconditioner when using Aztec00 
> through the function setPrecOperator() but get an exception when the 
> iterate function is called on my AzteC00 object. The exception seems 
> to be related to a bad_cast.
>
> Here is a code snippet.
>
> Teuchos::ParameterList mySolverParameterlist;
> mySolverParameterlist.set( "AZ_output", AZ_summary );
> mySolverParameterlist.set( "AZ_tol", 1e-10 );
> mySolverParameterlist.set( "AZ_conv", AZ_rhs );
> mySolverParameterlist.set( "AZ_solver", AZ_cg );
> mySolverParameterlist.set( "Max_Iters", 8000 );
>
> Epetra_LinearProblem problem( A, x, b );
>
> AztecOO solver(problem);
>
> EpetraFECrsMatrixPtr preconditioner = 
> myEpetraLinearSystem.computePreconditionerMatrix();
>
> solver.SetParameters( mySolverParameterlist );
> solver.SetPrecOperator( preconditioner );
> solver.Iterate( mySolverParameterlist.get("Max_Iters",100), 
> mySolverParameterlist.get( "AZ_tol",1e-8) );
>
> I tried following the advice in the AzteC00 examples or in the 
> following thread
>
> _https://trilinos.org/pipermail/trilinos-users/2016-January/005276.html_
>
> My user defined Preconditioner is an algebraic preconditoner which I 
> store as a Epetra_FECrsMatrix. I compute the values of the 
> preconditioner in the function computePreconditionerMatrix() and call 
> FillComplete when finished.
>
> A Epetra_FECrsMatrix should be a Epetra_Operator so I do not see why 
> code doesn't work. Is there anything I am missing?
>
> Thanks for the help.
>
> bests,
>
> John
>
>
>
> -- 
> John Jomo M.Sc.
> Technische Universität München
> Computation in Engineering
> Simulation in Applied Mechanics - SAM
> Arcisstraße 21
> 80333 München
> Tel.:     0049 / 89 / 289 25064
> Fax:      0049 / 89 / 289 25051
> E-Mail:john.jomo at tum.de <mailto:john.jomo at tum.de><mailto:john.jomo at tum.de> 
> <mailto:john.jomo at tum.de>
> Internet:www.cie.bgu.tum.de 
> <http://www.cie.bgu.tum.de><http://www.cie.bgu.tum.de/> 
> <http://www.cie.bgu.tum.de/>

-- 
John Jomo M.Sc.
Technische Universität München
Computation in Engineering
Simulation in Applied Mechanics - SAM
Arcisstraße 21
80333 München
Tel.:     0049 / 89 / 289 25064
Fax:      0049 / 89 / 289 25051
E-Mail:   john.jomo at tum.de<mailto:john.jomo at tum.de>
Internet: www.cie.bgu.tum.de<http://www.cie.bgu.tum.de/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20170531/f7542a12/attachment.html>


More information about the Trilinos-Users mailing list