← Back to team overview

dolfin team mailing list archive

Re: parameter system

 



Johan Hake wrote:
On Tuesday 07 July 2009 22:07:13 Garth N. Wells wrote:
Johan Hake wrote:
On Tuesday 07 July 2009 19:18:22 Garth N. Wells wrote:
Kristian Oelgaard wrote:
Hi,

I get:

Solving linear variational problem
  Matrix of size 1089 x 1089 has 7361 nonzero entries.
  Applying boundary conditions to linear system.
  *** Warning: Ignoring unknown parameter "absolute_tolerance" in
parameter set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "divergence_limit" in
parameter set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "gmres_restart" in parameter
set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "maximum_iterations" in
parameter set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "monitor_convergence" in
parameter set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "relative_tolerance" in
parameter set "krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "report" in parameter set
"krylov_solver" when updating parameter set "parameters".
  *** Warning: Ignoring unknown parameter "shift_nonzero" in parameter
set "krylov_solver" when updating parameter set "parameters".
terminate called after throwing an instance of 'std::runtime_error'
  what():  *** Error: Unable to access parameter "report" in parameter
set "parameters", parameter not defined.
[mech028:15991] *** Process received signal ***
[mech028:15991] Signal: Aborted (6)
[mech028:15991] Signal code:  (-6)
[mech028:15991] [ 0] [0xb805d410]
[mech028:15991] [ 1] /lib/tls/i686/cmov/libc.so.6(abort+0x188)
[0xb6154098] [mech028:15991] [ 2]
/usr/lib/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x
15 8) [0xb636e8f8]
[mech028:15991] [ 3] /usr/lib/libstdc++.so.6 [0xb636c7d5]
[mech028:15991] [ 4] /usr/lib/libstdc++.so.6 [0xb636c812]
[mech028:15991] [ 5] /usr/lib/libstdc++.so.6 [0xb636c94a]
[mech028:15991] [ 6]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZNK6dolfin6Logge
r5 errorESs+0x93) [0xb7f166a3]
[mech028:15991] [ 7]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin5errorE
Ss z+0x9f) [0xb7f1f62f]
[mech028:15991] [ 8]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin10Param
et ersclESs+0xb3) [0xb7fc7833]
[mech028:15991] [ 9]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin17PETSc
Kr ylovSolver5solveERKNS_11PETScMatrixERNS_11PETScVectorERKS4_+0xb2)
[0xb7ee9ce2]
[mech028:15991] [10]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin17PETSc
Kr ylovSolver5solveERKNS_13GenericMatrixERNS_13GenericVectorERKS4_+0xfb)
[0xb7eea3db]
[mech028:15991] [11]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin12Krylo
vS olver5solveERKNS_13GenericMatrixERNS_13GenericVectorERKS4_+0x18e)
[0xb7e69c1e]
[mech028:15991] [12]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin18Varia
ti onalProblem12solve_linearERNS_8FunctionE+0xaaf) [0xb7e674af]
[mech028:15991] [13]
/home/oelgaard/fenics/dolfin/local/lib/libdolfin.so.0(_ZN6dolfin18Varia
ti onalProblem5solveERNS_8FunctionE+0x2a) [0xb7e6814a]
[mech028:15991] [14] ./demo(main+0x497) [0x805db07]
[mech028:15991] [15]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb613d775]
[mech028:15991] [16] ./demo [0x805d541]
[mech028:15991] *** End of error message ***

if I do:

  problem.parameters("linear_solver") = "iterative";

in the Poisson demo.

Is this a bug, or am I using the new parameter system incorrectly?
Take a look at the change Johan made recently to LUSolver. Same thing
probably needs to be done for KrylovSolver.
This one beats me... It is another problem here.
I've added a function to set parameters for PETScKrylovSolver and
everything works now.

Ahh! I was only looking at the KrylovSolver class. There is a lot of default_parameters functions for the different KrylovSolvers, returning the same set of parameters. Is there a reason for not being able to share some code here?


Yes - the reason is that I don't understand fully the parameter system yet :).

I'm taking the approach that it's easier to improve something that works than fix something which is broken. I think I understand how to do it now. Will take a look after fixing some uBLAS problems.

Garth

Johan

KrylovSolver::parameters get initialized. However, it looks like

   solver.parameters.update(parameters["krylov_solver"]);

does not update the krylov solvers parameters, but rather an empty
parameters, and therefore the warnings.
What exactly does (or should)

    solver.parameters.update(parameters["krylov_solver"]);

do?

Garth

Also note that in python we use square brackets for all levels in the
parameter hierarchy, so it should be:

  problem.parameters["linear_solver"] = "iterative"

But

  problem.parameters("linear_solver")

should report an error message.

Johan

Garth

Kristian

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev






Follow ups

References