Unset parameters should not be written to file
The parameters profile
and convergence_norm_type
of PETScKrylovSolver
are unset. This causes the following error when saving the parameters to a file:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to convert parameter to string .
*** Reason: Parameter has not been set.
*** Where: This error was encountered inside Parameter.cpp.
*** Process: unknown
***
*** DOLFIN version: 1.3.0+
*** Git changeset: 13c0b37b7fc8f69a6de0eb0df104838c9c7c49ff
*** -------------------------------------------------------------------------
A minimal example to reproduce the error:
tmp = PETScKrylovSolver()
p = tmp.parameters
info(p, True)
File("parameters.xml") << p
If I try to set the profile
option, the solver does not work any more (it runs without giving error messages, but it does not perform any iteration).
Comments (10)
-
reporter -
profile
works for me. -
Is this still a bug?
-
Yes, can be reproduced.
-
reporter Yes, I think that
unset
parameters should be classified as a bug. The code snippet above saving the parameters to a file still gives the reported error. Below the output ofPETScKrylovSolver
default parameters.convergence_norm_type
andprofile
should have default values.petsc_krylov_solver | type value range access change ----------------------------------------------------------------------------------------- absolute_tolerance | double 1e-15 [] 0 0 convergence_norm_type | string <unset> [none, preconditioned, true] 0 0 divergence_limit | double 10000 [] 0 0 error_on_nonconvergence | bool true {true, false} 0 0 maximum_iterations | int 10000 [] 0 0 monitor_convergence | bool false {true, false} 0 0 nonzero_initial_guess | bool false {true, false} 0 0 options_prefix | string default [] 0 0 profile | bool <unset> {true, false} 0 0 relative_tolerance | double 1e-06 [] 0 0 report | bool true {true, false} 0 0 use_petsc_cusp_hack | bool false {true, false} 0 0
-
- changed milestone to 1.6
-
-
assigned issue to
-
assigned issue to
-
- changed status to resolved
Do not attempt to write unset parameters to file. Fixes Issue
#259.→ <<cset e6e60e4910af>>
-
- changed title to Unset parameters should not be written to file
This bug doesn't have anything to do with the PETSc wrapper. This issue was that DOLFIN attempted to write unset parameters to file, which since unset parameters do not have a value lead to an error.
-
- removed milestone
Removing milestone: 1.6 (automated comment)
- Log in to comment
@garth-wells The most important part of the bug has been introduced here. Is there a rationale in this commit?
Is it possible to revert to the previous version?