[petsc-users] Scattering PetscScalar

Peter Brune prbrune at gmail.com
Mon Jun 9 13:02:48 CDT 2014


If you have created a vector with the desired PETSc layout, you may use
VecGetOwnershipRanges()

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetOwnershipRanges.html

to get the ownership ranges for each processor indexable by rank, but with
type PetscInt instead of PetscScalar.  It's generally discouraged to use
types such as PetscScalar to denote index or length quantities.

- Peter


On Mon, Jun 9, 2014 at 12:59 PM, Likun Tan <tlk0812 at hotmail.com> wrote:

> Dear Petsc developers,
>
> I defined PetscScalar *len to store the number of nodes in each processor,
> MPI_Comm_rank(PETSC_COMM_WPRLD, rank);
> len[rank]=NumNode;
>
> but I want the elements in len to be seen in all the processors. Is there
> any function in Petsc being able to do this job?
>
> Many thanks,
> Likun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140609/0bdb3455/attachment.html>


More information about the petsc-users mailing list