<div dir="ltr">I tried using '$PETSC_DIR/$PETSC_ARCH/bin/h5dump myfile.mat', but it gave 'h5dump error: unable to open file "/path/to/directory/myfile.mat"', <b>saving</b> the <b>MATLAB file</b> with “<b>-v7.3</b>” option <b>solved</b> the issue.<div><br></div><div>Thank you, Matthew & Samar. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 25, 2023 at 12:18 PM Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Jul 25, 2023 at 3:12 AM maitri ksh <<a href="mailto:maitri.ksh@gmail.com" target="_blank">maitri.ksh@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, <div>I am new to Petsc, here are some details of the relevant softwares I am using:</div><div>1. petsc-3.19.3 (on wsl-ubuntu22.04 platform)</div><div>2. MATLAB-R2022a</div><div>3. hdf5-1.10.7 (checked using 'pkg-config --modversion hdf5')</div><div>4. configured using: './configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-matlab --with-matlab-dir=/usr/local/MATLAB/R2022a --download-hdf5 --with-hdf5=1'</div><div><br></div><div>I am trying to read a '.mat' file ('<b>myfile.mat</b>') using 'PetscViewerHDF5Open' (the source code '<b>read_Matrix.c</b>' is attached herewith). I could compile the source code with no error, but I am getting an error ('<b>ERROR.txt</b>') indicating that there is an issue opening the HDF5 file. Could you please help me to resolve this issue</div></div></blockquote><div><br></div><div>HDF5 thinks that this is not an HDF5 file. Since PETSc built HDF5 for you, you can check this using</div><div><br></div><div> $PETSC_DIR/$PETSC_ARCH/bin/h5dump myfile.mat</div><div><br></div><div>It could be a version incompatibility between the HDF5 on your machine and the one you asked PETSc to download.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Maitri</div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>