<div dir="ltr">If you have created a vector with the desired PETSc layout, you may use VecGetOwnershipRanges()<div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetOwnershipRanges.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetOwnershipRanges.html</a></div>
<div><br></div><div>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.</div>
<div><br></div><div>- Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 12:59 PM, Likun Tan <span dir="ltr"><<a href="mailto:tlk0812@hotmail.com" target="_blank">tlk0812@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Petsc developers,<br>
<br>
I defined PetscScalar *len to store the number of nodes in each processor,<br>
MPI_Comm_rank(PETSC_COMM_WPRLD, rank);<br>
len[rank]=NumNode;<br>
<br>
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?<br>
<br>
Many thanks,<br>
Likun</blockquote></div><br></div>