[petsc-dev] Error in MatGetDiagonal_Shell?

Matthew Knepley knepley at gmail.com
Mon Apr 30 05:41:06 CDT 2018


On Mon, Apr 30, 2018 at 1:38 AM, Stefano Zampini <stefano.zampini at gmail.com>
wrote:

>
> > On Apr 30, 2018, at 3:14 AM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> >
> >
> >   I don't understand
> >
> >    The code has
> >
> >  ierr = MatGetDiagonal(A,W2);CHKERRQ(ierr);
> >  ierr = VecView(W2,viewer);CHKERRQ(ierr);
> >
> >   the output from this VecView seems to match the diagonal of the matrix
> printed earlier.
> >
> >> On Apr 29, 2018, at 10:02 AM, Stefano Zampini <
> stefano.zampini at gmail.com> wrote:
> >>
> >> By looking at src/mat/examples/tests/output/ex88_1.out, it seems that
> the output of MatGetDiagonal is wrong for MATSHELL.
> >>
> >> it should be
> >> 2.96782e+08
> >> 1.41731e+09
> >> and not (as computed)
> >> 1.10918e+08
> >> 2.06459e+08
> >
> >   What do you mean "as computed"? The output file does not contain
> >> 1.10918e+08
> >> 2.06459e+08
> > anywhere.
> >
> >   Are you modifying the example and running it again to get the
> incorrect value?
>
> Yes, my bad. I did not explain it correctly
> From maint, if you just run ex88 you will get the incorrect output, which
> is not caught in the nightlyies because floating point values are
> completely ignored.
>

Now that we ignore all values, tests need to be changed to check the
distance from the correct vector.

   Matt


>
> [szampini at localhost tests]$ ./ex88
> Matrix of type: shell
> Mat Object: 1 MPI processes
>   type: seqdense
> 2.9678190300000000e+08 3.9288008100000000e+08
> 6.1374683500000000e+08 1.4173141580000000e+09
> Vec Object: 1 MPI processes
>   type: seq
> 3.92973e+19
> 8.54197e+19
> Vec Object: 1 MPI processes
>   type: seq
> 1.10918e+08
> 2.06459e+08
> MatDiagonalSet not tested on MATSHELL
> ….
>
> >
> >  Barry
> >
> >>
> >> --
> >> Stefano
> >
>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180430/07b778b7/attachment.html>


More information about the petsc-dev mailing list