[Trilinos-Users] Trouble Ensuring x (as Guess) is used in Belos Solver

Heroux, Mike MHeroux at CSBSJU.EDU
Sat Feb 9 21:19:01 EST 2019

```Corey,

Did you get past this issue?  Messages being sent to trilinos-users at trilinos.org<mailto:trilinos-users at trilinos.org> are not being reliably received by everyone on the list.

Thanks.

Mike

From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of "Corey A. Henderson" <cahenderson at wisc.edu>
Date: Wednesday, December 26, 2018 at 1:30 PM
To: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: [Trilinos-Users] Trouble Ensuring x (as Guess) is used in Belos Solver

Hello,

I am trying to set up an iterative call to the Pseudoblock GMRES solver in Belos where I expect x to vary only slightly between calls (because b varies only slightly). When I inspect the number of iterations after subsequent calls, even if b is not changed, I get no reduction in iterations as I would expect from using the previous x as a guess. I believe I am missing something in how Belos is reset().

I need some help in learning how to ensure the previously-solved x is reused as a guess for subsequent iterations.

Pseudocode:

Set up A, x=0, preconditioner M, initial b
Create problem from M, A, x, b
Create solver ("GMRES")
Solver.setProblem()
loop
solve()
print numIters
copy off of x
Solver.reset(Problem)  <-- Where I think my mistake is
update b
end loop

Even if b is unchanged, I get the same number of iterations (and duration) on subsequent solves, where I would expect them to drop significantly since x is near (or just is) the solution. If I omit the solver.reset() call I get an error on the next solve(). I believe x is not being used as a guess the way I'm setting up my code, but I don't understand why.

Can someone explain how to ensure Belos uses x as a guess? I have been over the documentation and can't figure it what I'm doing wrong.

Thanks!

Corey
--
Corey A. Henderson
PhD Candidate and NSF Graduate Fellow
Dept. of Engineering Physics