[petsc-users] Question about HDF5 viewer groups
Matthew Knepley
knepley at gmail.com
Thu Sep 13 04:56:49 CDT 2018
On Wed, Sep 12, 2018 at 9:56 PM Ellen M. Price <ellen.price at cfa.harvard.edu>
wrote:
> Hi there,
>
> I'm running a complex PETSc program that outputs a LOT of data to an
> HDF5 file. As such, I'd like to separate my output into groups to make
> it easier to traverse in the analysis phase.
>
> I'm either confused about the nomenclature or the usage of
> PetscViewerHDF5PushGroup/PetscViewerHDF5PopGroup. From a quick skim of
> the source, it looks like the PushGroup function builds up a linked list
> of group names? Also, just the name suggests that there should be a
> "stack" of group names stored somewhere.
>
> So I would expect, after calling PetscViewerHDF5PushGroup twice, say,
>
> PetscViewerHDF5PushGroup(h5viewer, "group1");
> PetscViewerHDF5PushGroup(h5viewer, "group2");
> VecView(x, h5viewer);
>
> that I would get my vector output in /group1/group2/x. This is obviously
> not what's actually happening. If I run
>
> http://www.mcs.anl.gov/petsc/petsc-current/src/vec/vec/examples/tutorials/ex19.c
> ,
> for example, I get, from h5dump:
>
> HDF5 "ex19.h5" {
> FILE_CONTENTS {
> group /
> dataset /TestVec
> group /testBlockSize
> dataset /testBlockSize/TestVec2
> group /testTimestep
> dataset /testTimestep/TestVec2
> }
> }
>
> even though multiple groups are "pushed" in sequence.
>
> My question is, have I misunderstood the connotation of pushing/popping
> groups? How can I properly create a group and then a subgroup? Every
> attempt at doing this:
>
> PetscViewerHDF5PushGroup(h5viewer, "/group1");
> PetscViewerHDF5PushGroup(h5viewer, "/group1/group2");
>
This form works. Here is an example of me doing it:
https://bitbucket.org/petsc/petsc/src/624d5184b94bda975877076c18f8637740f06a35/src/dm/impls/plex/plexhdf5.c#lines-430
Note that PushGroup just points us somewhere. If you want that 'directory'
created, you have to do something like
https://bitbucket.org/petsc/petsc/src/624d5184b94bda975877076c18f8637740f06a35/src/dm/impls/plex/plexhdf5.c#lines-380
HDF5 is terrible, its just that everything else is worse.
Thanks,
Matt
> VecView(x, h5viewer);
>
> leads to a long string of HDF5 library errors, like:
>
> HDF5-DIAG: Error detected in HDF5 (1.8.16) MPI-process 0:
> #000: ../../../src/H5L.c line 824 in H5Lexists(): unable to get link info
> major: Symbol table
> minor: Object not found
> #001: ../../../src/H5L.c line 2765 in H5L_exists(): path doesn't exist
> major: Symbol table
> minor: Object already exists
> #002: ../../../src/H5Gtraverse.c line 861 in H5G_traverse(): internal
> path traversal failed
> major: Symbol table
> minor: Object not found
> #003: ../../../src/H5Gtraverse.c line 755 in H5G_traverse_real():
> component not found
> major: Symbol table
> minor: Object not found
> HDF5-DIAG: Error detected in HDF5 (1.8.16) MPI-process 0:
> #000: ../../../src/H5G.c line 314 in H5Gcreate2(): unable to create group
> major: Symbol table
> minor: Unable to initialize object
> #001: ../../../src/H5Gint.c line 194 in H5G__create_named(): unable to
> create and link to group
> major: Symbol table
> minor: Unable to initialize object
> #002: ../../../src/H5L.c line 1638 in H5L_link_object(): unable to
> create new link to object
> major: Links
> minor: Unable to initialize object
> #003: ../../../src/H5L.c line 1882 in H5L_create_real(): can't insert
> link
> major: Symbol table
> minor: Unable to insert object
> #004: ../../../src/H5Gtraverse.c line 861 in H5G_traverse(): internal
> path traversal failed
> major: Symbol table
> minor: Object not found
> #005: ../../../src/H5Gtraverse.c line 755 in H5G_traverse_real():
> component not found
> major: Symbol table
> minor: Object not found
>
> Thanks in advance,
> Ellen Price
>
--
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/20180913/38adedd2/attachment.html>
More information about the petsc-users
mailing list