Krylov: retrieve num_iters, relresvec,..

Asked by Nico Schlömer

I'd like to look at effiency data of some Krylov preconditioners for a specific problem, and to this end I would need the list of (relative) residuals from the Krylov iterations. For PETSc at least, this data is dumped on the running console if `monitor_convergence` is `true`. I could probably parse that, but is there a cleaner way?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Nico Schlömer
Solved:
Last query:
Last reply:
Revision history for this message
Jan Blechta (blechta) said :
#1

You could use
  boost::shared_ptr<KSP> PETScKrylovSolver::ksp() const;
and then make some PETSc calls with this pointer to retrieve needed data directly from PETSc. If in python you can use compile_extension_module() to wrap C++ code.

Jan

Revision history for this message
Nico Schlömer (nschloe) said :
#2

Hm, okay.
I guess in that case I'll just use 'uBlas', extract the data into a numpy linear problem and take it from there. The fact that I'm missing out on parallelism doesn't matter too much for toying around.
Thanks!

Revision history for this message
Garth Wells (garth-wells) said :
#3

On 22 March 2013 02:01, Nico Schlömer
<email address hidden> wrote:
> New question #224842 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/224842
>
> I'd like to look at effiency data of some Krylov preconditioners for a specific problem, and to this end I would need the list of (relative) residuals from the Krylov iterations. For PETSc at least, this data is dumped on the running console if `monitor_convergence` is `true`. I could probably parse that, but is there a cleaner way?
>

No, but it would be nice to dump a file, and maybe some matplotlib
code, to produce iteration count vs residual plots. You could add a
blueprint.

Garth

> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.