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

Heroux, Michael A maherou at sandia.gov
Wed Jun 7 20:25:28 EDT 2017


I mean that some clients of the Epetra_Operator will pass the same pointer in for both the z an r vectors.  If z and r share space, a sweep algorithm such as Gauss-Seidel or triangular solver can be more efficient.  My guess is that your operator will need to copy the input vector r into a temporary vector.  This way, if z and r are the same vector, z will be computed correctly.

I hope this helps. 

Mike

> On Jun 6, 2017, at 5:22 PM, ga95gey at mytum.de <john.jomo at tum.de> wrote:
> 
> Hallo Mike,
> 
> Thanks for the reply. I, however, did not understand what you mean by the case where z and r are equal.
> 
> I followed your advice and was able to get rid of the exception. I adapted the Epetra_Operator class by deriving from Epetra_FECRSMatrix and overwritting the ApplyInverse function. The ApplyInverse function in my new class now just calls the Epetra_FeCRSMatrix Apply() function. In this way I can assemble M^-1 and use it to compute z = M^-1 r directly, where M^-1 is stored as a lower triangular matrix. 
> 
> My modifications work perfectly for diagonal scaling but do not seem to work well for more complicated additive Schwarz preconditioners, which appear to need more iterations to converge to my prescribed tolerance than diagonal scaling. This contradict the results I get with my own serial cg Implementation. I use the Az_rhs norm to check convergence.
> 
> Is this maybe related to the case where z and r are the same?
> 
> Thanks for the help.
> 
> Best regards,
> 
> John.


More information about the Trilinos-Users mailing list