<div dir="ltr"><div class="gmail_default" style="font-size:small">Regarding differences in speed, I defer to Matt - I know nothing about that.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 19, 2019 at 3:04 PM Yuyun Yang <<a href="mailto:yyang85@stanford.edu">yyang85@stanford.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_-6944953660417355798compose-container" style="direction:ltr">
<span><span></span></span>
<div>
<div style="direction:ltr">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?</div>
<div><br>
</div>
<div style="direction:ltr">So running h5read will load the vector from the hdf5 file directly to a Matlab vector? And similarly so for matrices?</div>
<div><br>
</div>
<div style="direction:ltr">Thanks,</div>
<div style="direction:ltr">Yuyun</div>
<div><br>
</div>
<div class="gmail-m_-6944953660417355798acompli_signature">Get <a href="https://aka.ms/o0ukef" target="_blank">Outlook for iOS</a></div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-6944953660417355798divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> petsc-users <<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a>> on behalf of zakaryah via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Sent:</b> Tuesday, March 19, 2019 11:54:02 AM<br>
<b>To:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Yuyun,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">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?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Mar 19, 2019 at 1:18 PM Yuyun Yang via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-6944953660417355798gmail-m_-1611002607329925695WordSection1">
<p class="MsoNormal">Got it, thanks!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>
<br>
<b>Sent:</b> Tuesday, March 19, 2019 10:10 AM<br>
<b>To:</b> Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Mar 19, 2019 at 11:58 AM Yuyun Yang via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<u></u><u></u></p>
</div>
<div>
<blockquote style="border-style:none none none solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hello team,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Matt<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks for your help,<u></u><u></u></p>
<p class="MsoNormal">Yuyun<u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div>