question about VecLoad (pls disregard previous one)

Matthew Knepley knepley at
Thu May 15 10:45:24 CDT 2008

2008/5/15 tsjb00 <tsjb00 at>:
> Many thanks to all for the reply!
> I use the code:
>  PetscViewerBinaryOpen(PETSC_COMM_WORLD,"out.dat",FILE_MODE_READ,viewer);
>  VecLoad(viewer,VECMPI,&v1);
> to get the vector storing values of var.
> My problem is, it seems that the vector global is evenly distributed over processors; while in my program, a DA is defined and according to DA global vectors are not distributed the same way. Would anybody please tell me how to deal with that?

The output vector, using VecView(), is in natural order. It has no
idea about distribution over processes. When it is read in,
using VecLoad(), it is redistributed according to the current partition.


> Thanks in advance!
> JB
> _________________________________________________________________
> MSN 中文网,最新时尚生活资讯,白领聚集门户。

What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener

More information about the petsc-users mailing list