When you called VecCreateSeq(PETSC_COMM_SELF,5,&seqx); you created a sequential vector on each process - not just on rank 0.
On 1 August 2013 12:11, 丁老师 <ztdepya...@163.com> wrote: > 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. > > > VecCreateSeq(PETSC_COMM_SELF,5,&seqx); > VecView(seqx,PETSC_VIEWER_STDOUT_WORLD); > double *seqarry; > VecGetArray(seqx,&seqarry); > > for(int i=0;i<n;i++) > cout<<MyRank<<" seqarry "<<s eqarry[i]<<endl; > > > > > > >