[petsc-users] Memory corruption with two-dimensional array and PetscMemzero

Jed Brown jed at jedbrown.org
Wed May 21 08:21:47 CDT 2014


Christophe Ortiz <christophe.ortiz at ciemat.es> writes:
> I tried and it works. The advantage is that it avoids setting up and
> using pointers.  However, I found out that it is significantly slower
> than using explicit pointers of pointers **.

Are you creating and destroying in an inner loop?  What gets set up is
the same, and it's fewer allocations than what you were doing with many
calls to malloc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140521/1fea18d7/attachment.pgp>


More information about the petsc-users mailing list