[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()?
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()?
- From: Yujie <recrusader@xxxxxxxxx>
- Date: Tue, 12 Feb 2008 11:06:51 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=Xu//dHmuXpl9WwuaJTQgB1kUF4iNRn2VN+VmNdks5GU=; b=woK7/hoEGXsCcgrqLuVVi+elIj/2rbMC50bigVVXHvzII+3s9RfhIUg1rsTv1gLbb9nekvRpiaybZGlJZpXcPF/w5mG5dlqkITu1+IiHe1FUQ/CidZYbzzS1dVgoQg4q7KND45FrQrE7E+2uz7m+qkGQppkk2EB//IylOmN9AXA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=oEEm1wu2ZOE0CyD/tflIVYUr0EZMv8MT4lesKpXY1bLLmUSQ+k5JiUXZH8S/KhR/Yn3UcEUrW+jlO083LLnKO0QJT5kcT6cK3DGjgAtFFS9rW4LzdIG8K0dd+ZiE9M6PiTllVzBhXBk7pEAQY10DqzMop7nSgXghjca6FsjIj9Q=
- In-reply-to: <a9f269830801231247m45fa1d60p5b7467a7ac9d465d@mail.gmail.com>
- References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <a9f269830801221925q721dde06ua29e4f2496d9cc72@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <a9f269830801230553r7c206040p5764d79db38a7fb6@mail.gmail.com> <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> <a9f269830801231247m45fa1d60p5b7467a7ac9d465d@mail.gmail.com>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
hi, Matt
If I output matrix with binary format, should the file format obtained from sequential output is the same with that from parallel output? I mean that I don't need to consider whether MatView_***_Binary() is parallel or sequential when I use the matrix file.
thanks a lot.
Regards,
Yujie
On 1/23/08, Matthew Knepley <knepley@xxxxxxxxx> wrote:
On Jan 23, 2008 2:18 PM, Yujie <recrusader@xxxxxxxxx> wrote:
> Thank you for your further explanation. I just want to use this data in
> other packages. I think that ASCII file is likely better. Because I don't
> know the format of the binary file? how to find it?
Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The
format is pretty simple.
> 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.
Matt
> Regards,
> Yujie
>
> On 1/23/08, Matthew Knepley <knepley@xxxxxxxxx > wrote:
> > On Jan 22, 2008 11:01 PM, Yujie <recrusader@xxxxxxxxx> 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@xxxxxxxxx> wrote:
> > > > On Jan 22, 2008 8:50 PM, Yujie < recrusader@xxxxxxxxx> 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
> >
> >
>
>
--
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