[petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

zakaryah zakaryah at gmail.com
Tue Mar 19 14:22:07 CDT 2019


Regarding differences in speed, I defer to Matt - I know nothing about that.

Matlab's h5read, passed the name of the vector, will read that vector from
the HDF5 file and return a Matlab vector, yes.  I am not sure about sparse
matrices - I know HDF5 supports indexing, but I don't think PETSc supports
MatView with sparse matrices and HDF5.  It doesn't make much sense to me to
do that anyway - just use binary.  Dense matrices might work.

On Tue, Mar 19, 2019 at 3:04 PM Yuyun Yang <yyang85 at stanford.edu> wrote:

> It's simply for visualization purposes. I wasn't sure if HDF5 would
> perform better than binary, and what specific functions are needed to load
> the PETSc vectors/matrices, so wanted to ask for some advice here. Since
> Matt mentioned it's not likely to be much faster than binary, I guess there
> is no need to make the change?
>
> So running h5read will load the vector from the hdf5 file directly to a
> Matlab vector? And similarly so for matrices?
>
> Thanks,
> Yuyun
>
> Get Outlook for iOS <https://aka.ms/o0ukef>
> ------------------------------
> *From:* petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of
> zakaryah via petsc-users <petsc-users at mcs.anl.gov>
> *Sent:* Tuesday, March 19, 2019 11:54:02 AM
> *To:* petsc-users at mcs.anl.gov
> *Subject:* Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in
> Matlab
>
> Hi Yuyun,
>
> I'm not sure exactly what you want to do but I use Matlab to work with and
> visualize HDF5 files from PETSc all the time.  Matlab has h5info and h5read
> routines, then I visualize with my own routines.  Is there something
> specific you need from Matlab?
>
> On Tue, Mar 19, 2019 at 1:18 PM Yuyun Yang via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
>> Got it, thanks!
>>
>>
>>
>> *From:* Matthew Knepley <knepley at gmail.com>
>> *Sent:* Tuesday, March 19, 2019 10:10 AM
>> *To:* Yuyun Yang <yyang85 at stanford.edu>
>> *Cc:* petsc-users at mcs.anl.gov
>> *Subject:* Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in
>> Matlab
>>
>>
>>
>> On Tue, Mar 19, 2019 at 11:58 AM Yuyun Yang via petsc-users <
>> petsc-users at mcs.anl.gov> wrote:
>>
>> Hello team,
>>
>>
>>
>> Currently we’re using the PETSc binary file format to save Vecs and Mats
>> and visualize them in Matlab. It looks like HDF5 works more efficiently
>> with large data sets (faster I/O), and we’re wondering if PETSc Vecs/Mats
>> saved in HDF5 viewer can be visualized in Matlab as well?
>>
>>
>>
>> We do not have code for that. I am using Paraview to look at HDF5 since
>> everything I do is on 2D and 3D meshes. Note that HDF5 is not likely to
>> have faster I/O than the PETSc binary.
>>
>>
>>
>>   Thanks,
>>
>>
>>
>>     Matt
>>
>>
>>
>>
>>
>> Thanks for your help,
>>
>> Yuyun
>>
>>
>>
>>
>> --
>>
>> 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
>>
>>
>>
>> https://www.cse.buffalo.edu/~knepley/
>> <http://www.cse.buffalo.edu/~knepley/>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190319/506c4584/attachment.html>


More information about the petsc-users mailing list