<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>