<div dir="ltr">You should be pass the same communicator into VecView() as was used when you created the vector. <br>Do this<br>ierr = VecView(seqx,PETSC_VIEWER_STDOUT_SELF);CHKERRQ(ierr);<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 1 August 2013 13:08, ¶¡ÀÏʦ <span dir="ltr"><<a href="mailto:ztdepyahoo@163.com" target="_blank">ztdepyahoo@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="line-height:1.7;font-size:14px;font-family:arial">but when we use vecveiw to veiw the seqx, it gives value only with 1 process<div><div class="h5"><br><br><br><br><br><div></div><div></div><br>At 2013-08-01 18:36:09,"Dave May" <<a href="mailto:dave.mayhem23@gmail.com" target="_blank">dave.mayhem23@gmail.com</a>> wrote:<br>
 <blockquote style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><div dir="ltr"><div>When you called<br>  VecCreateSeq(PETSC_COMM_SELF,5,&seqx);<br></div>you created a sequential vector on each process - not just on rank 0.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">
On 1 August 2013 12:11, ¶¡ÀÏʦ <span dir="ltr"><<a href="mailto:ztdepyahoo@163.com" target="_blank">ztdepyahoo@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial">I create a sequential vec seqx, and i get it value with VecGetArrary, since seqx is created  only in process 0, why every process can output the value of the seqx. <br>

<div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial"><div style="line-height:1.7;font-size:14px;font-family:arial"><br><br> VecCreateSeq(PETSC_COMM_SELF,5,&seqx);<br>

<span title="neteasefooter"><span></span></span></div> VecView(seqx,PETSC_VIEWER_STDOUT_WORLD);<br> double *seqarry;<br> VecGetArray(seqx,&seqarry);<br><span title="neteasefooter"><span></span></span></div><br> for(int i=0;i<n;i++)<br>

   cout<<MyRank<<"  seqarry "<<s
 
 eqarry[i]<<endl;<br><span title="neteasefooter"><span></span></span></div><br><br><span title="neteasefooter"><span></span></span></div><br><br><span title="neteasefooter"><span></span></span></div><br><br><span title="neteasefooter"><span></span></span></blockquote>

</div><br></div>
</blockquote></div></div></div><br><br><span title="neteasefooter"><span></span></span></blockquote></div><br></div>