[petsc-users] Output portability, binary, HDF5, ascii

Barry Smith bsmith at mcs.anl.gov
Thu Feb 18 16:07:31 CST 2010

On Feb 18, 2010, at 3:58 PM, Arturo Fountain wrote:

> Aha. Thanks for the head's up; I was unaware the Matlab could read
> PETSc matrices; they certainly do not advertise this fact (at least
> for our semi-ancient version 7.5.0) which is a shame!

   it is in bin/matlab/PetscBinaryRead()


> For a 'real' application I would never want to use such an
> intermediate step, but I only want to do so to create pictures for use
> in papers.
> Thanks again for the help,
> Arturo
> On Thu, Feb 18, 2010 at 2:10 PM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>> On Feb 18, 2010, at 2:35 PM, Arturo Fountain wrote:
>>> Greetings:
>>> I've been using the PETSc libraries for a few weeks now and am very
>>> impressed with the software. Great work folks!
>>> I'm writing with an issue I've been unable to work around. I'd  
>>> like to
>>> save output and import it into an external program (hdfview or  
>>> matlab,
>>> for example). Vectors are no problem to output but as mentioned at
>>> https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2010-January/005796.html 
>>> ,
>>> this is not possible in PETSc for matrices.
>>    This is an indirect way of doing but since PETSc can dump  
>> vectors and
>> sparse matrices in PETSc format rapidly and they can be read into  
>> Matlab
>> rapidly, could you then use Matlab's HDF5 capability to write then  
>> into any
>> HDF5 format you like? I realize this is not ideal, but it is just a  
>> single
>> extra postprocessing step.
>>    You could also write your own PETSc object viewers that wrote to  
>> HDF5,
>> for sparse matrices, but I think it is easy just to dump to Matlab  
>> and have
>> it save it in the format you want.
>>    ASCII is just SO slow for large data sets I think it is  
>> impractical.
>>   Barry
>>> Furthermore: "It won't buy
>>> you any speed, disk space, or portability."
>>> Certainly the PETSc binary format works fine for PETSc I/O but I am
>>> unable to find anything to convert between this format and any  
>>> other.
>>> I'm most concerned with portability; I would like to utilize  
>>> external
>>> visualization packages. Is it standard practice to simply use ASCII
>>> output? I can certainly do that but for larger problems size will
>>> certainly become an impending issue....
>>> Thanks in advance for any help you can offer,
>>> Arturo

More information about the petsc-users mailing list