Specifying the KSP method to use in solve(a == L)

Asked by Patrick Farrell

Hi,

I just spent an hour debugging why

solve(a == L, u, solver_parameters={'linear_solver': 'cg'})

was using an LU decomposition.

It appears that the interface has changed. Now you're supposed to do solver_parameters={'linear_solver': 'iterative', 'symmetric': True}. Is that correct? It appears that the code in LinearVariationalSolver.cpp now decides between 'cg' and 'gmres' depending on whether symmetric is true.

If so,

a) how am I supposed to use another option PETSc provides (like bicg, tfqmr, etc)? It appears this logic only allows me to choose between cg and gmres, which is very restrictive.

b) the snippet of code above used to work in 1.0.0. Shouldn't there be an error message, rather than silently using LU instead of doing what I told it to? Not everyone will be willing to gdb in to see why it's not doing what they expect.

c) is this redesign discussed anywhere? I strongly prefer the old interface, and would like to see why it was changed.

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

This is a nasty regression bug and already reported here:

  https://bugs.launchpad.net/dolfin/+bug/1100324

I think we all agreed for going with your c) alternative. Submit a patch
or ping Mr Logg to get this fixed.

johan

On 03/05/2013 03:50 PM, Patrick Farrell wrote:
> New question #223460 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/223460
>
> Hi,
>
> I just spent an hour debugging why
>
> solve(a == L, u, solver_parameters={'linear_solver': 'cg'})
>
> was using an LU decomposition.
>
> It appears that the interface has changed. Now you're supposed to do solver_parameters={'linear_solver': 'iterative', 'symmetric': True}. Is that correct? It appears that the code in LinearVariationalSolver.cpp now decides between 'cg' and 'gmres' depending on whether symmetric is true.
>
> If so,
>
> a) how am I supposed to use another option PETSc provides (like bicg, tfqmr, etc)? It appears this logic only allows me to choose between cg and gmres, which is very restrictive.
>
> b) the snippet of code above used to work in 1.0.0. Shouldn't there be an error message, rather than silently using LU instead of doing what I told it to? Not everyone will be willing to gdb in to see why it's not doing what they expect.
>
> c) is this redesign discussed anywhere? I strongly prefer the old interface, and would like to see why it was changed.
>

Can you help with this problem?

Provide an answer of your own, or ask Patrick Farrell for more information if necessary.

To post a message you must log in.