[petsc-dev] Strange array indexing in MatDestroySubMatrices

Hong hzhang at mcs.anl.gov
Wed Jul 12 14:20:36 CDT 2017


MatCreateSubMatrices_xxx() calloc an array of size n+1, n=ismax and
submat[n]=null as default.

For MatCreateSubMatrices_MPIAIJ(), I calloc ismax+nstages and use
submat[n] ... to store some datastructures for reuse.

When submat[n] != null, these data structures are destroyed.

Hong

On Wed, Jul 12, 2017 at 11:29 AM, Stefano Zampini <stefano.zampini at gmail.com
> wrote:

> Is line number 6890 of matrix.c correct???
>
> https://bitbucket.org/petsc/petsc/src/b02a13eda23b9fabea7dbfcadcfb98
> e3258ee49d/src/mat/interface/matrix.c?at=master&fileviewer=
> file-view-default#matrix.c-6890
>
> --
> Stefano
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170712/1fd12b98/attachment.html>


More information about the petsc-dev mailing list