Getting values of a parallel vector
Satish Balay
balay at mcs.anl.gov
Mon Mar 24 10:59:09 CDT 2008
On Mon, 24 Mar 2008, Jaime Suarez wrote:
> Good morning,
>
> My question is about getting the values of a parallel vector in the
> PETSc subroutines using Fortran 90.
>
> As far as I know, I can invoke:
> CALL VecGetArrayF90
> in order to get the full array that is being considered in each
> processor. However, I cannot employ this tool since I need to have also
> the values that are stored in other processors. Is there a straight way
> to get the value of the n-th element of a parallel vector, no matter
> where this element is stored?
>
> I am aware of the difficulty of this task, since it would involve
> transfer of information between different processors.
>
> Thanking you in advance,
Check the manpage for VecScatterCreate(). You'll have to create
the VecScatter object corresponding to the off-proc values you
need - and then scatter them.
After the scatter, the values will be available locally [Now you can
use VecGetArrayF90 to access the values]
Satish
More information about the petsc-users
mailing list