[petsc-users] -snes_mf_operator yields "No support for this operation for this object type" in TS codes?

Ed Bueler elbueler at alaska.edu
Sun Apr 2 21:39:39 CDT 2017


I checked out branch barry/fix-huge-flaw-in-ts
<https://bitbucket.org/petsc/petsc/branch/barry/fix-huge-flaw-in-ts> (see
pull request #655) and reconfigured and rebuilt.

No, the ts/.../ex2.c example is not fixed.  It gives same error:

~/petsc/src/ts/examples/tutorials[barry/fix-huge-flaw-in-ts*]$ ./ex2 -ts_dt
0.001 -ts_final_time 0.001 -snes_monitor -snes_mf_operator
    0 SNES Function norm 1.059316422854e+01
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: No support for this operation for this object type
[0]PETSC ERROR: Mat type mffd
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.7.5-3346-g41a1d4d  GIT
Date: 2017-03-24 14:39:28 -0500
[0]PETSC ERROR: ./ex2 on a linux-c-dbg named bueler-leopard by ed Sun Apr
 2 18:31:55 2017
[0]PETSC ERROR: Configure options --download-mpich --with-debugging=1
[0]PETSC ERROR: #1 MatZeroEntries() line 5471 in
/home/ed/petsc/src/mat/interface/matrix.c
[0]PETSC ERROR: #2 TSComputeIJacobian() line 942 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #3 SNESTSFormJacobian_Theta() line 515 in
/home/ed/petsc/src/ts/impls/implicit/theta/theta.c
[0]PETSC ERROR: #4 SNESTSFormJacobian() line 5055 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #5 SNESComputeJacobian() line 2276 in
/home/ed/petsc/src/snes/interface/snes.c
[0]PETSC ERROR: #6 SNESSolve_NEWTONLS() line 222 in
/home/ed/petsc/src/snes/impls/ls/ls.c
[0]PETSC ERROR: #7 SNESSolve() line 3967 in
/home/ed/petsc/src/snes/interface/snes.c
[0]PETSC ERROR: #8 TS_SNESSolve() line 171 in
/home/ed/petsc/src/ts/impls/implicit/theta/theta.c
[0]PETSC ERROR: #9 TSStep_Theta() line 211 in
/home/ed/petsc/src/ts/impls/implicit/theta/theta.c
[0]PETSC ERROR: #10 TSStep() line 3820 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #11 TSSolve() line 4065 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #12 main() line 194 in
/home/ed/petsc/src/ts/examples/tutorials/ex2.c
[0]PETSC ERROR: PETSc Option Table entries:
[0]PETSC ERROR: -snes_mf_operator
[0]PETSC ERROR: -snes_monitor
[0]PETSC ERROR: -ts_dt 0.001
[0]PETSC ERROR: -ts_final_time 0.001
[0]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
[unset]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0

Curiously, my own code (attached), which differs from ex2.c in that it uses
DMDA, *does* change behavior to a DIVERGED_NONLINEAR_SOLVE error:

$ ./advect -da_refine 0 -ts_monitor -adv_circlewind -adv_conex 0.3
-adv_coney 0.3 -ts_type beuler -snes_monitor_short -ts_final_time 0.01
-ts_dt 0.01 -snes_rtol 1.0e-4 -adv_firstorder -snes_mf_operator
solving on 5 x 5 grid with dx=0.2 x dy=0.2 cells, t0=0.,
and initial step dt=0.01 ...
0 TS dt 0.01 time 0.
    0 SNES Function norm 2.1277
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR:
[0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase
-ts_max_snes_failures or make negative to attempt recovery
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.7.5-3346-g41a1d4d  GIT
Date: 2017-03-24 14:39:28 -0500
[0]PETSC ERROR: ./advect on a linux-c-dbg named bueler-leopard by ed Sun
Apr  2 18:34:18 2017
[0]PETSC ERROR: Configure options --download-mpich --with-debugging=1
[0]PETSC ERROR: #1 TSStep() line 3829 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #2 TSSolve() line 4065 in
/home/ed/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #3 main() line 314 in /home/ed/repos/p4pdes/c/ch9/advect.c
[0]PETSC ERROR: PETSc Option Table entries:
[0]PETSC ERROR: -adv_circlewind
[0]PETSC ERROR: -adv_conex 0.3
[0]PETSC ERROR: -adv_coney 0.3
[0]PETSC ERROR: -adv_firstorder
[0]PETSC ERROR: -da_refine 0
[0]PETSC ERROR: -snes_mf_operator
[0]PETSC ERROR: -snes_monitor_short
[0]PETSC ERROR: -snes_rtol 1.0e-4
[0]PETSC ERROR: -ts_dt 0.01
[0]PETSC ERROR: -ts_final_time 0.01
[0]PETSC ERROR: -ts_monitor
[0]PETSC ERROR: -ts_type beuler
[0]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------
application called MPI_Abort(MPI_COMM_WORLD, 91) - process 0
[unset]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 91) - process 0

Previously it gave a "No support for this operation for this object type
... Mat type mffd" error like ex2.c.  Progress?

Note that my code works fine (i.e. no errors) with any of: the analytical
Jacobian or -snes_fd or -snes_fd_color or -snes_mf.

Ed



On Sun, Apr 2, 2017 at 6:23 PM, Jed Brown <jed at jedbrown.org> wrote:

> The issue is that we need to create
>
>   a*I - Jrhs
>
> and this is currently done by creating a*I first when we have separate
> matrices for the left and right hand sides.  There is code to just scale
> and shift Jrhs when there is no IJacobian, but the creation logic got
> messed up at some point (or at least for some TS configurations that are
> common).  We were discussing this recently in a performance context and
> this branch is supposed to fix that logic.  Does this branch work for
> you?
>
> https://bitbucket.org/petsc/petsc/pull-requests/655/fix-
> flaw-with-tssetrhsjacobian-and-no/diff
>
> Ed Bueler <elbueler at alaska.edu> writes:
>
> > Dear PETSc --
> >
> > I have a TS-using and DMDA-using code in which I want to set a
> RHSJacobian
> > which is only approximate.  (The Jacobian uses first-order upwinding MOL
> > while the RHSFunction uses a flux-limited MOL.)  While it works with the
> > analytical Jacobian, and -snes_fd, and -snes_fd_color, and -snes_mf, I
> get
> > a "No support ..." message for -snes_mf_operator.
> >
> > It suffices to show the problem with
> >
> > src/ts/examples/tutorials/ex2.c
> >
> > (Note ex2.c does not use DMDA so ..._color is not available for ex2.c.)
> >
> > Error as follows:
> >
> > ~/petsc/src/ts/examples/tutorials[master*]$ ./ex2 -ts_dt 0.001
> > -ts_final_time 0.001 -snes_monitor
> >     0 SNES Function norm 1.059316422854e+01
> >     1 SNES Function norm 1.035505461114e-05
> >     2 SNES Function norm 5.498223366328e-12
> > ~/petsc/src/ts/examples/tutorials[master*]$ ./ex2 -ts_dt 0.001
> > -ts_final_time 0.001 -snes_monitor -snes_fd
> >     0 SNES Function norm 1.059316422854e+01
> >     1 SNES Function norm 1.208245988550e-05
> >     2 SNES Function norm 6.022374930788e-12
> > ~/petsc/src/ts/examples/tutorials[master*]$ ./ex2 -ts_dt 0.001
> > -ts_final_time 0.001 -snes_monitor -snes_mf
> >     0 SNES Function norm 1.059316422854e+01
> >     1 SNES Function norm 6.136984336801e-05
> >     2 SNES Function norm 5.355730806625e-10
> > ~/petsc/src/ts/examples/tutorials[master*]$ ./ex2 -ts_dt 0.001
> > -ts_final_time 0.001 -snes_monitor -snes_mf_operator
> >     0 SNES Function norm 1.059316422854e+01
> > [0]PETSC ERROR: --------------------- Error Message
> > --------------------------------------------------------------
> > [0]PETSC ERROR: No support for this operation for this object type
> > [0]PETSC ERROR: Mat type mffd
> > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for
> > trouble shooting.
> > [0]PETSC ERROR: Petsc Development GIT revision: v3.7.5-3426-g0c7851c  GIT
> > Date: 2017-04-01 18:40:06 -0600
> > [0]PETSC ERROR: ./ex2 on a linux-c-dbg named ed-lemur by ed Sun Apr  2
> > 17:02:47 2017
> > [0]PETSC ERROR: Configure options --download-mpich --with-debugging=1
> > [0]PETSC ERROR: #1 MatZeroEntries() line 5471 in
> > /home/ed/petsc/src/mat/interface/matrix.c
> > [0]PETSC ERROR: #2 TSComputeIJacobian() line 965 in
> > /home/ed/petsc/src/ts/interface/ts.c
> > [0]PETSC ERROR: #3 SNESTSFormJacobian_Theta() line 515 in
> > /home/ed/petsc/src/ts/impls/implicit/theta/theta.c
> > [0]PETSC ERROR: #4 SNESTSFormJacobian() line 5078 in
> > /home/ed/petsc/src/ts/interface/ts.c
> > [0]PETSC ERROR: #5 SNESComputeJacobian() line 2276 in
> > /home/ed/petsc/src/snes/interface/snes.c
> > [0]PETSC ERROR: #6 SNESSolve_NEWTONLS() line 222 in
> > /home/ed/petsc/src/snes/impls/ls/ls.c
> > [0]PETSC ERROR: #7 SNESSolve() line 3967 in
> > /home/ed/petsc/src/snes/interface/snes.c
> > [0]PETSC ERROR: #8 TS_SNESSolve() line 171 in
> > /home/ed/petsc/src/ts/impls/implicit/theta/theta.c
> > [0]PETSC ERROR: #9 TSStep_Theta() line 211 in
> > /home/ed/petsc/src/ts/impls/implicit/theta/theta.c
> > [0]PETSC ERROR: #10 TSStep() line 3843 in
> > /home/ed/petsc/src/ts/interface/ts.c
> > [0]PETSC ERROR: #11 TSSolve() line 4088 in
> > /home/ed/petsc/src/ts/interface/ts.c
> > [0]PETSC ERROR: #12 main() line 194 in
> > /home/ed/petsc/src/ts/examples/tutorials/ex2.c
> > [0]PETSC ERROR: PETSc Option Table entries:
> > [0]PETSC ERROR: -snes_mf_operator
> > [0]PETSC ERROR: -snes_monitor
> > [0]PETSC ERROR: -ts_dt 0.001
> > [0]PETSC ERROR: -ts_final_time 0.001
> > [0]PETSC ERROR: ----------------End of Error Message -------send entire
> > error message to petsc-maint at mcs.anl.gov----------
> > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
> > [unset]: aborting job:
> > application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
> >
> > Is this intended or a bug?  If it is intended, what is the issue?
> >
> > I am using current master branch (commit
> > 0c7851c55cba8e40da5083f79ba1ff846acd45b2).
> >
> > Thanks for your help and awesome library!
> >
> > Ed
> >
> >
> >
> >
> >
> > --
> > Ed Bueler
> > Dept of Math and Stat and Geophysical Institute
> > University of Alaska Fairbanks
> > Fairbanks, AK 99775-6660
> > 301C Chapman
>



-- 
Ed Bueler
Dept of Math and Stat and Geophysical Institute
University of Alaska Fairbanks
Fairbanks, AK 99775-6660
301C Chapman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170402/a71f2462/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: advect.c
Type: text/x-csrc
Size: 14636 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170402/a71f2462/attachment-0001.c>


More information about the petsc-users mailing list