VecDestroy and memory leak
nicolas aunai
nicolas.aunai at gmail.com
Sat Nov 28 09:53:23 CST 2009
ah yes this is it !
thanks a lot.
Nico
2009/11/28 Jed Brown <jed at 59a2.org>:
> On Sat, 28 Nov 2009 15:44:19 +0100, nicolas aunai <nicolas.aunai at gmail.com> wrote:
>> VecCreateSeq(PETSC_COMM_SELF, mx*my*dof, &ssol);
>> VecScatterCreateToAll(nsol, &ctx, &ssol);
> ^^^^^
>
> This is a new vector, the one you create on the line above is lost.
> From the man page:
>
> | Do NOT create a vector and then pass it in as the final argument vout! vout is created by this routine
> | automatically (unless you pass PETSC_NULL in for that argument if you do not need it).
>
>
> Jed
>
More information about the petsc-users
mailing list