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

Matthew Knepley knepley at gmail.com
Wed Jan 23 07:53:00 CST 2008


On Jan 22, 2008 11:01 PM, Yujie <recrusader at gmail.com> wrote:
> Dear Matt:
>
> thank you for your reply. Do you have any method to generate an ascii file
> of the huge sparse matrix? thanks

I think you miss my point. The PETSc function is not a bad way to generate
ASCII matrices. ASCII matrices make "no sense" for large operators.

   Matt

> Regards,
> Yujie
>
>
>
> On 1/23/08, Matthew Knepley <knepley at gmail.com> wrote:
> > On Jan 22, 2008 8:50 PM, Yujie <recrusader at gmail.com> wrote:
> > > Hi everyone:
> > >
> > > #include "petsc.h"
> > >  PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char
> > > name[],PetscViewer *lab)
> > >
> > > #include "petsc.h"
> > >  PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char
> > > name[],PetscFileMode type,PetscViewer *binv)
> > >
> > > if the difference between them is that one for ASCII output and the
> other
> > > for Binary output, why are there different parameters?
> >
> > It is historical. If you want to be generic, you should use
> >
> >   PetscViewerCreate()
> >   PetscViewerSetType()
> >   PetscViewerFileSetMode()
> >   PetscViewerFileSetName()
> >
> > which can create both.
> >
> > > The speed to output matrix is very fast when I use
> PetscViewerBinaryOpen.
> > > However, when I use PetscViewerASCIIOpen, I can't get the matrix output.
> the
> > > code always is running and it has taken about one day! what's the
> problem?
> > > thank you.
> >
> > ASCII files do not make sense for large matrices. You should use binary
> files.
> >
> >    Matt
> >
> > > Regards,
> > > Yujie
> > >
> > >
> > >
> >
> >
> >
> > --
> > 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
> >
> >
>
>



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