[petsc-users] PETSc VecLoad not obeying HDF5 group?
Barry Smith
bsmith at mcs.anl.gov
Thu Nov 13 22:19:14 CST 2014
Sorry no one answered this before, I had assumed someone who knew something about HDF5 would answer but instead looks like I have to.
Could you please send a simple example code (and data file) that reproduces the problem. I looked at the code and (in theory) it should handle the group ok.
Again sorry for the long delay in anyone answering.
Barry
> On Nov 6, 2014, at 2:24 AM, Håkon Strandenes <haakon at hakostra.net> wrote:
>
> Hi,
>
> I am trying to load a dataset from a HDF5 file and into a vector in PETSc. For that purpose I use VecView etc in the following way:
>
> PetscViewerHDF5Open(PETSC_COMM_WORLD, "input.h5", FILE_MODE_READ, &H5viewer);
>
> PetscViewerHDF5PushGroup(H5viewer, "/FIELDS");
>
> VecLoad(gSol, H5viewer);
>
> PetscViewerDestroy(&H5viewer);
>
> And yes, I also check the return variables for errors, I have just omitted them from this example to make it easier to read.
>
> My problem is:
> If I place a dataset, with the correct name and dimensions, in the group "/FIELDS" in my input.h5, PETSc can't find it and won't load it. If I place the same dataset in the root of my HDF5 file, the dataset is loaded and everything works, even with PetscViewerHDF5PushGroup set to "/FIELDS"...
>
> Does actually VecLoad obey the group set by PetscViewerHDF5PushGroup?
>
> Best regards,
> Håkon Strandenes
More information about the petsc-users
mailing list