Epetra solver with ilu preconditioner fails for repeated solves

Bug #979657 reported by Mikael Mortensen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
New
Undecided
Unassigned

Bug Description

The ilu preconditioner of Epetra works just fine if the solver is used just once, but fails for repeated solves, like in a timeloop.

Reconstruction:

from dolfin import *
parameters['linear_algebra_backend'] = "Epetra"
mesh = UnitSquare(16, 16)
V = FunctionSpace(mesh, 'CG', 1)
u = TrialFunction(V)
v = TestFunction(V)
A = assemble(inner(grad(u), grad(v))*dx)
bc = DirichletBC(V, Constant(0), DomainBoundary())
source = interpolate(Expression('exp(-pow(x[0]-0.5, 2)-pow(x[1]-0.5, 2))'), V)
b = assemble(v*source*dx)
bc.apply(A, b)
solver = KrylovSolver('gmres', 'ilu')
solver.parameters['preconditioner']['reuse'] = True
solver.parameters['monitor_convergence'] = True
u = Function(V)
for i in range(2):
    solver.solve(A, u.vector(), b)

The first solve is just fine, but the second fails. It does not matter whether the preconditioner is reused or not. The output using dolfin-dev on bigblue is:

  *******************************************************
  ***** Problem: Epetra::CrsMatrix
  ***** Preconditioned GMRES solution
  ***** Ifpack_AdditiveSchwarz, ov = 0, local solver =
  ***** `IFPACK ILU (fill=0, relax=0.000000, athr=0.000000, rthr=1.000000)'
  ***** rcm reord, Condition number estimate = 1.70703
  ***** No scaling
  *******************************************************

                iter: 0 residual = 1.000000e+00
                iter: 1 residual = 7.108325e-01
                iter: 2 residual = 3.981243e-01
                iter: 3 residual = 1.574911e-01
                iter: 4 residual = 3.792059e-02
                iter: 5 residual = 9.715641e-03
                iter: 6 residual = 3.437766e-03
                iter: 7 residual = 9.689458e-04
                iter: 8 residual = 2.467065e-04
                iter: 9 residual = 5.568837e-05
                iter: 10 residual = 2.356537e-05
                iter: 11 residual = 1.144578e-05
                iter: 12 residual = 2.627463e-06
                iter: 13 residual = 3.757890e-07

  Solution time: 0.081843 (sec.)
  total iterations: 13
Epetra (AztecOO) Krylov solver (gmres, ILU) converged in 13 iterations.

  *******************************************************
  ***** Problem: Epetra::CrsMatrix
  ***** Preconditioned GMRES solution
  *****
  ***** No scaling
  *******************************************************
AZ_check_options: ERROR: options[AZ_precond] has improper value = 31626240

  Solution time: 0.000012 (sec.)
  total iterations: 0
Traceback (most recent call last):
  File "simple_test.py", line 17, in <module>
    solver.solve(A, u.vector(), b)
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to solve linear system using Epetra Krylov solver.
*** Reason: Solution failed to converge (error code 1).
*** Where: This error was encountered inside EpetraKrylovSolver.cpp.
*** -------------------------------------------------------------------------

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.