[petsc-users] DAVecGetArray, ghost access

Matthew Knepley knepley at gmail.com
Mon May 3 10:49:38 CDT 2010


2010/4/29 Павел Чувахов <pavel_chuvahov at mail.ru>

> Dear PETSc team, all!
>
> I'm involved in developing PETSc-assisted code and recently came across the
> following problem.
>
> As described in user manual (rev.3.1, p.48), elements of vector that is
> managed by DA object can be directly accessed by DAVecGetArray(...) and
> DAVecRestoreArray(...) where the vector is either local or global. Besides,
> there's written that GHOSTED values can be accessed in this way. It seems to
> be not applicable for global vectors, but for local ones only.
>
> As far as I understand, it's proposed to get ghosts by creating a new local
> vector, that contains full local part of global vector plus ghosts.
> Therefore the memory is just twice we really need, not to mention excessive
> data coping.
>
> So the question arises. In what way can user get access to ghosted values
> without creating additional DA local vector?
>

That does not really make sense. Ghosted values exist in the memory of other
processes. So either

  1) You think copying takes to much time

      Measure the time. It is insignificant.

  2) You want to use less memory

      You can build a VecScatter to get only the values you want. Since we
solve mostly implicit problems,
      the memory has not been an issue.

    Matt

    RSVP
>     Best Wishes, Pavel V. Chouvakhov.
>



-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100503/088cb0a5/attachment.htm>


More information about the petsc-users mailing list