[petsc-users] error in petsc-dev

Jed Brown jedbrown at mcs.anl.gov
Wed Apr 25 06:33:20 CDT 2012


On Wed, Apr 25, 2012 at 00:53, Mohammad Mirzadeh <mirzadeh at gmail.com> wrote:

> Even more than that, I get lots of errors apparently complaining that I
> have not preallocated the matrix:
>

You are not checking error codes, otherwise you wouldn't see all the
subsequent errors.


> I do not see these with 3.2-p6. Does 3.2-p6 has any mechanism for such
> alerts?
>

The default behavior was changed in petsc-dev because forgetting to
preallocate was too common of a mistake.
http://www.mcs.anl.gov/petsc/documentation/changes/dev.html

* Preallocation routines now automatically set
MAT_NEW_NONZERO_ALLOCATION_ERR, if you intentionally preallocate less than
necessary then use
MatSetOption(mat,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE) to disable the
error generation.
* You MUST now call MatXXXSetPreallocation() or MatSetUp() on any matrix
you create directly (not using DMCreateMatrix()) before calling
MatSetValues(), MatSetValuesBlocked() etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120425/cf557b1e/attachment-0001.htm>


More information about the petsc-users mailing list