what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()?

Satish Balay balay at mcs.anl.gov
Tue Feb 12 14:23:38 CST 2008


On Tue, 12 Feb 2008, Yujie wrote:

> On 1/23/08, Matthew Knepley <knepley at gmail.com> wrote:

> > > In addition, do you have any better methods to save the sparsity
> > > structure picture of the matrix? Now, I use "-mat_view_draw" to
> > > do this. However, the speed is very slow and the picture is
> > > small. I want to get a big picture and directly save it to the
> > > disk?  could you give me some advice? thanks a lot.

> > We do not have a better way to make the sparsity picture. I assume
> >you could write something that decides how many pixels to use,
> >calculates an average occupancy per pixel, and writes a BMP or
> >something.

Couple of notes on this.

- -mat_view_draw can be slow for parallel runs [because all the data
  is moved to proc-0, from where its displayed]. If you wish to speed
  up, you can either:
  * run it sequentially [depending upon your code, the matrix generated
  could be different - so its not suitable]
  * do a binary dump [with MatView() on a binary viewer] - and
  then reload this matrix with a sequential code and then do mat_view
  [check mat/examples/tests/ex33.c,ex43.c]

- you can use the option '-draw_pause -1' to make the window not
  disappear. Now you can zoom-in & zoom-out [with mouse-left or
  mouse-right click]

- Take the snapshot of this window with xv or gnome-screenshot or
other screen-dump tool [ like 'xwd | xpr -device ps > dump.ps']

- Alternatively you can dump the matrix is matlab format - and use
Matlab visualization tools.

Satish





More information about the petsc-users mailing list