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

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


Christophe Ortiz <christophe.ortiz at ciemat.es> writes:
> In some sense, yes. I create and destroy inside FormIJacobian() (my
> Jacobian evaluation routine). Therefore it is called at each timestep. I
> guess this takes time. But it is slower than doing the many malloc.

What communicator (you should use VecCreateSeq)?  Be sure to profile a
configure --with-debugging=0.

How many elements do you have on each process?  How big are the
elements?

> How can I create a global vector that would be passed to FormIJacobian() ?
> Creating it only once instead of doing it at each timestep would save time.

You can/should always put this stuff in the user context (which comes in
via the last argument).

> I need to use this vector (size dof*dof) with classes and methods inside
> FormIJacobian() to calculate the different blocks that are passed to the
> Jacobian with MatSetValuesBlocked(). However, I cannot pass it as argument
> of FormIJacobian() since there is no room for it in the arguments.

-------------- 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/c9cb1530/attachment.pgp>


More information about the petsc-users mailing list