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

maitri ksh maitri.ksh at gmail.com
Tue Jul 25 08:40:58 CDT 2023


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"',
*saving* the *MATLAB file* with  “*-v7.3*” option *solved* the issue.

Thank you, Matthew & Samar.

On Tue, Jul 25, 2023 at 12:18 PM Matthew Knepley <knepley at gmail.com> wrote:

> On Tue, Jul 25, 2023 at 3:12 AM maitri ksh <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/bc93726f/attachment.html>


More information about the petsc-users mailing list