[petsc-dev] Vector operations on ghosted vectors

Barry Smith bsmith at mcs.anl.gov
Thu Feb 28 10:39:05 CST 2013


On Feb 28, 2013, at 7:30 AM, John Mousel <elafint.john at gmail.com> wrote:

> Let me rephrase. Is a functionality like this something that is worth adding to the PETSc source, or should I just write and use my own wrapper.

   Just write and use your own wrapper.

  Barry

> 
> 
> On Wed, Feb 27, 2013 at 4:51 PM, Matthew Knepley <knepley at gmail.com> wrote:
> On Wed, Feb 27, 2013 at 4:56 PM, John Mousel <john.mousel at gmail.com> wrote:
> Is there a possibility of adding a wrapper function around a few basic vector operations such as VecCopy, VecAXPY, VECAXPYPZ... to operate on ghosted vectors? I perform a lot of vector operations including the ghost region to avoid communication. It really clutters code to see stuff like
> 
>     CALL VecGhostGetLocalForm(solver%u,uk,ierr)
>     CALL VecGhostGetLocalForm(solver%ukm1,ukm1,ierr)
>     CALL VecGhostGetLocalForm(solver%p,pk,ierr)
>     CALL VecGhostGetLocalForm(solver%pkm1,pkm1,ierr)
>     CALL VecCopy(uk,ukm1,ierr)
>     CALL VecCopy(pk,pkm1,ierr)
>     CALL VecGhostRestoreLocalForm(solver%u,uk,ierr)
>     CALL VecGhostRestoreLocalForm(solver%ukm1,ukm1,ierr)
>     CALL VecGhostRestoreLocalForm(solver%p,pk,ierr)
>     CALL VecGhostRestoreLocalForm(solver%pkm1,pkm1,ierr)
> 
> Maybe there's a good reason for this not already existing, or maybe it does exist and I haven't found it, but I'd think something like VecCopyGhosted would be fairly useful.
> 
> Is there something we could do that would be better than you defining a function VecCopyGhosted()?
> 
>   Thanks,
> 
>      Matt
>  
> John
> -- 
> 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
> 




More information about the petsc-dev mailing list