[petsc-users] Getting correct local size using VecScatterCreateToAll

Matthew Knepley knepley at gmail.com
Fri Jan 6 18:21:13 CST 2023


On Fri, Jan 6, 2023 at 6:22 PM Venugopal, Vysakh (venugovh) via petsc-users
<petsc-users at mcs.anl.gov> wrote:

> Hello,
>
>
>
> I have created a global vector V using DMCreateGlobalVector of size m. For
> n processes, the local size of V is m/n.
>
>
>
> Subsequently, I am using VecScatterCreateToAll to get a sequential copy of
> the V, let's call it V_seq of local size m. It passes through a function
> and outputs the vector V_seq_hat (of local size m).
>
>
>
> Is there a way for me to substitute the values of V_seq_hat (at the
> correct indices) to the original V (with local size m/n)?
>
>
>
> When I use VecScatterCreateToAll (with SCATTER_REVERSE), I am getting a
> vector V with new values from V_seq_hat but with local size m. This is
> causing issues in the rest of my code where the size of V needs to be m/n.
>

You do not create a new scatter. You use the same scatter you got in the
first place, but with SCATTER_REVERSE.

  Thanks,

     Matt


> Any help would be really appreciated!
>
>
>
> Thanks,
>
>
>
> ---
>
> Vysakh Venugopal
>
> Ph.D. Candidate
>
> Department of Mechanical Engineering
>
> University of Cincinnati, Cincinnati, OH 45221-0072
>
>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230106/e3f6f51e/attachment.html>


More information about the petsc-users mailing list