[petsc-users] UNABLE to read '.mat' file with 'PetscViewerHDF5Open' (WSL-Ubuntu22.04)

Samar Khatiwala samar.khatiwala at earth.ox.ac.uk
Tue Jul 25 04:42:33 CDT 2023


Another possibility is that the Matlab file wasn’t saved in HDF5. Try resaving it with the “-v7.3” option.

Samar

On Jul 25, 2023, at 10:18 AM, Matthew Knepley <knepley at gmail.com> wrote:

On Tue, Jul 25, 2023 at 3:12 AM maitri ksh <maitri.ksh at gmail.com<mailto:maitri.ksh at gmail.com>> wrote:
Hi,
I am new to Petsc, here are some details of the relevant softwares I am using:
1. petsc-3.19.3 (on wsl-ubuntu22.04 platform)
2. MATLAB-R2022a
3. hdf5-1.10.7 (checked using 'pkg-config --modversion hdf5')
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'

I am trying to read a '.mat' file ('myfile.mat') using 'PetscViewerHDF5Open'  (the source code 'read_Matrix.c' is attached herewith). I could compile the source code with no error, but I am getting an error ('ERROR.txt') indicating that there is an issue opening the HDF5 file. Could you please help me to resolve this issue

HDF5 thinks that this is not an HDF5 file. Since PETSc built HDF5 for you, you can check this using

  $PETSC_DIR/$PETSC_ARCH/bin/h5dump myfile.mat

It could be a version incompatibility between the HDF5 on your machine and the one you asked PETSc to download.

  Thanks,

    Matt

Maitri



--
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/20230725/23259506/attachment-0001.html>


More information about the petsc-users mailing list