[petsc-users] how to select values from certain positions of a vec from different process to process 0.

Barry Smith bsmith at mcs.anl.gov
Wed Jul 31 11:34:31 CDT 2013


On Jul 31, 2013, at 7:55 AM, 丁老师 <ztdepyahoo at 163.com> wrote:

> Does the function  VecScatterCreateToZero  resolve this problem?
> 

   What problem? I told you how to do it, there is no problem. VecScatterCreateToZero() moves ALL values to process 0 which for large problems is not scalable, so if you only want some values then do what I suggest otherwise use VecScatterCreateToZero.

   Barry

> 
> 
> 
> 
> 
> At 2013-07-31 09:08:26,"Barry Smith" <bsmith at mcs.anl.gov> wrote:
> >
> >
> >  create an IS with the global indices you want on process 0 and a seq Vec of the same size,
> >
> >  create an IS of size 0 on all the other processes and a seq Vec of the size zero on all other processes
> >
> >  create a VecScatter using these IS, the global Vec and the seq Vec.
> >
> >  use VecScatterBegin/End to send over the values.
> >
> >   Barry
> >
> >
> >On Jul 30, 2013, at 6:37 PM, 丁老师 <ztdepyahoo at 163.com> wrote:
> >
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >
> 
> 
> 



More information about the petsc-users mailing list