[petsc-users] PETSC ERROR: Argument out of range New nonzero at (55, 157) caused a malloc

Matthew Knepley knepley at gmail.com
Fri Jan 5 21:45:06 CST 2018

On Fri, Jan 5, 2018 at 10:43 PM, Hao Zhang <hbcbh1999 at gmail.com> wrote:

> when PETSc crashed and reported this message. it also gives the following
> message
> matsetoption(a mat_new_nonzero_allocation_err petsc_false) to turn off
> this check
> is this a workaround or? Thanks!

1) Your preallocation is wrong for your matrix

2) If you do not care about performance, then you can use the call to
MatSetOption() to remove the error.
    If you do, please preallocate the matrix correctly.



> --
> Hao Zhang
> Dept. of Applid Mathematics and Statistics,
> Stony Brook University,
> Stony Brook, New York, 11790

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-users/attachments/20180105/2e04ad40/attachment.html>

More information about the petsc-users mailing list