[petsc-users] Copy entries of unequal size vector

Matthew Knepley knepley at gmail.com
Sat Jun 4 06:21:07 CDT 2011


http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecStrideScatterAll.html

  Matt

On Sat, Jun 4, 2011 at 5:01 AM, khalid ashraf <khalid_eee at yahoo.com> wrote:

> Hi,
> I want to copy 3 parallel vectors of size N into a vector of size 3N where
> the 3 vector entries goes as
> dest(3*i)=vec1(i);
> dest(1+3*i)=vec2(i);
> dest(2+3*i)=vec3(i);
>
> Could you please suggest what would be the most efficient way to copy for
> parallel performance.
>
> I guess it would be best if all the vectors have the same parallel layout.
> Is there a way to make sure that the vectors vec1(N elements) and dest(3N
> elements) have similar parallel layout ?
>
> Thanks in advance.
>
> Khalid
>
>


-- 
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/20110604/d3f58f44/attachment.htm>


More information about the petsc-users mailing list