[petsc-users] PETSc VecLoad not obeying HDF5 group?

Håkon Strandenes haakon at hakostra.net
Thu Nov 6 02:24:37 CST 2014


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