[petsc-users] Setting PETSc Sundials Options Using PETSC_OPTIONS

Matthew Knepley knepley at gmail.com
Thu Jul 25 10:54:19 CDT 2013

On Thu, Jul 25, 2013 at 9:53 AM, Lesleis Nagy <l.nagy at ed.ac.uk> wrote:

> Hello,
> I currently use PETSc (version: 3.3-p7) and petsc4py along with the
> Sundials interface to perform time stepping for some FEM code that I have
> written (for completeness I make use of FEniCS). I would like to pass
> options to PETSc from the command line using the PETSC_OPTIONS environment
> variable. I set it with the following values:
>         $ export PETSC_OPTIONS="-ts_sundials_type bdf
> -ts_sundials_gramschmidt_type modified -ts_sundials_monitor_steps
> -options_table -options_left"
> I then run the code using:
>         $ mpiexec -n 2 python script.py
> Everything appears to work and my code terminates. However at the end of
> the run, '-options_table' / '-options_left' reports that
> #PETSc Option Table entries:
> -options_left
> -options_table
> -ts_sundials_gramschmidt_type modified
> -ts_sundials_monitor_steps
> -ts_sundials_type bdf
> #End of PETSc Option Table entries
> There are 3 unused database options. They are:
> Option left: name:-ts_sundials_gramschmidt_type value: modified
> Option left: name:-ts_sundials_monitor_steps no value
> Option left: name:-ts_sundials_type value: bdf
> Could someone explain to me why PETSc is reading the Sundials options that
> I've supplied but is not using them?

1) Your solver might have an options prefix

2) You might forget to call TSSetFromOptions()

The easiest thing to do is run with -start_in_debugger and set a breakpoint
in TSSetFromOptions()


> Kind regards
> Les
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.

What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130725/bd1e1383/attachment.html>

More information about the petsc-users mailing list