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

2019-03-19 Thread Yuyun Yang via petsc-users
Sounds good, thanks for the advice!

-Original Message-
From: Jed Brown  
Sent: Tuesday, March 19, 2019 1:23 PM
To: Yuyun Yang ; zakaryah ; 
petsc-users@mcs.anl.gov
Subject: Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

Yuyun Yang via petsc-users  writes:

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

There is no speed benefit.  The advantage of HDF5 is that it supports better 
metadata, including the data types and sizes.  The PETSc data format is quick, 
dirty, and fast.



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

2019-03-19 Thread Jed Brown via petsc-users
Yuyun Yang via petsc-users  writes:

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

There is no speed benefit.  The advantage of HDF5 is that it supports
better metadata, including the data types and sizes.  The PETSc data
format is quick, dirty, and fast.


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

2019-03-19 Thread Yuyun Yang via petsc-users
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  on behalf of zakaryah via 
petsc-users 
Sent: Tuesday, March 19, 2019 11:54:02 AM
To: petsc-users@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 
mailto:petsc-users@mcs.anl.gov>> wrote:
Got it, thanks!

From: Matthew Knepley mailto:knep...@gmail.com>>
Sent: Tuesday, March 19, 2019 10:10 AM
To: Yuyun Yang mailto:yyan...@stanford.edu>>
Cc: petsc-users@mcs.anl.gov<mailto:petsc-users@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 
mailto:petsc-users@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/>


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

2019-03-19 Thread Yuyun Yang via petsc-users
Got it, thanks!

From: Matthew Knepley 
Sent: Tuesday, March 19, 2019 10:10 AM
To: Yuyun Yang 
Cc: petsc-users@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 
mailto:petsc-users@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/>


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

2019-03-19 Thread Yuyun Yang via petsc-users
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?

Thanks for your help,
Yuyun