<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Another possibility is that the Matlab file wasn’t saved in HDF5. Try resaving it with the “-v7.3” option.
<div><br>
</div>
<div>Samar<br>
<div><br>
<blockquote type="cite">
<div>On Jul 25, 2023, at 10:18 AM, Matthew Knepley <knepley@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">
<div dir="ltr">On Tue, Jul 25, 2023 at 3:12 AM maitri ksh <<a href="mailto:maitri.ksh@gmail.com">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>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>