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 <[email protected]> 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
