[petsc-users] Do I need to VecRestoreArray after VecGetArray if nothing's modified?

Jed Brown jedbrown at mcs.anl.gov
Mon Oct 10 08:18:36 CDT 2011


On Mon, Oct 10, 2011 at 08:16, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> If only read from a pointer obtained via VecGetArray, but not modify
> any values, is VecRestoreArray still mandatory?
>

Yes. Note that you can use VecGetArrayRead() if you only want const access.
(You still restore, but cached norms remain valid.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111010/bdae68c5/attachment.htm>


More information about the petsc-users mailing list