← Back to team overview

fenics team mailing list archive

intermittent error in uBLAS gmres solver

 

I am having a strange problem with the gmres solver using the
uBLAS backend.  The strange part is that it works fine sometimes,
and fails others, with the same code.

A simple code that demonstrates the problem is:

  from dolfin import *
  parameters["linear_algebra_backend"] = "PETSc"
  mesh = UnitSquare(3,3)
  V = FunctionSpace(mesh, 'CG', 1)
  v = TestFunction(V)
  u = TrialFunction(V)
  a = u*v*dx
  A = assemble(a)
  L = v*dx
  b = assemble(L)
  x = Vector(b.size())
  solve(A, x, b)
  print x.array()

Here I run it and get the expected output:

: vinh512 1032; python solve3.py
Warning: Converting real-valued parameter to double, might loose precision.
Warning: Converting real-valued parameter to double, might loose precision.
Matrix of size 16 x 16 has 82 nonzero entries.
Sorting sparsity pattern.
Warning: Converting real-valued parameter to double, might loose precision.
Solving linear system of size 16 x 16 (uBLAS Krylov solver).
Krylov solver converged in 5 iterations.
[ 1.00000005  0.99999996  1.00000011  1.00000001  0.99999996  0.99999992
  0.99999997  0.99999995  1.00000011  0.99999997  0.99999998  1.00000003
  1.00000001  0.99999995  1.00000003  0.99999999]

Then I run it again, and get an error message:

: vinh512 1032; python solve3.py
Warning: Converting real-valued parameter to double, might loose precision.
Warning: Converting real-valued parameter to double, might loose precision.
Matrix of size 16 x 16 has 82 nonzero entries.
Sorting sparsity pattern.
Warning: Converting real-valued parameter to double, might loose precision.
Solving linear system of size 16 x 16 (uBLAS Krylov solver).
Check failed in file /usr/include/boost/numeric/ublas/operation.hpp at line 260: norm_1 (v - cv) <= 2 * std::numeric_limits<real_type>::epsilon () * verrorbound
Traceback (most recent call last):
  File "solve3.py", line 12, in <module>
    solve(A, x, b, 'gmres')
File "/home/faculty/arnold/workshop/FEniCS/lib/python2.6/site-packages/dolfin/cpp.py", line 4169, in solve
    return _cpp.solve(*args)
StandardError: internal logic

Searching on the web for the error message came up with this:
  http://archives.free.net.ph/message/20081022.224821.1eddeaa9.da.html
where Gunter Winkler suggests "#define BOOST_UBLAS_TYPE_CHECK 0",
but I don't know how to do this from dolfin.

Any ideas what is going on or how to fix?



Follow ups