[petsc-dev] reading vector from HDF5 with DMPlex

Adrian Croucher a.croucher at auckland.ac.nz
Thu Feb 11 23:07:52 CST 2016


hi

I'm having trouble reading in a vector on a DMPlex from an HDF5 file. 
The attached minimal program (readdmvec2.F90) illustrates the problem.

What it does is:
- reads in a DMPlex from file (ghotcol.exo) and sets it up (distributes, 
constructs ghost cells and default section)
- uses DMGetGlobalVector() to get the vector
- sets its object name to 'cell_geometry'
- opens the HDF5 file (hotcol_ss.h5) in a viewer and tries to read the 
vector using VecLoad()

The VecLoad() dies, saying "object 'cell_geometry' doesn't exist" in the 
HDF5 file. (Full error message is below.)

But it does exist- it shows up as a dataset in the '/' group in h5dump. 
I can also read it in from a Python script and h5py, e.g.:

 >>> import h5py
 >>> f = h5py.File('hotcol_ss.h5')
 >>> f['cell_geometry'][:]

Any idea why VecLoad() can't find it? I get the same error running on 
any number of processors.

The program that writes 'cell_geometry' to the HDF5 file also 
subsequently writes time-dependent simulation results to the same file 
(that's what the other datasets are in there) using 
DMSetOutputSequenceNumber() and VecView(). I am wondering if the problem 
is related to this, because if I just write a simple vector out to the 
file by itself it seems to read back in ok.

Cheers, Adrian

--
HDF5-DIAG: Error detected in HDF5 (1.8.8) MPI-process 0:
   #000: ../../../src/H5D.c line 334 in H5Dopen2(): not found
     major: Dataset
     minor: Object not found
   #001: ../../../src/H5Gloc.c line 430 in H5G_loc_find(): can't find object
     major: Symbol table
     minor: Object not found
   #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 641 in H5G_traverse_real(): 
traversal operator failed
     major: Symbol table
     minor: Callback failed
   #004: ../../../src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 
'cell_geometry' doesn't exist
     major: Symbol table
     minor: Object not found
[0]PETSC ERROR: --------------------- Error Message 
--------------------------------------------------------------
[0]PETSC ERROR: Error in external library
[0]PETSC ERROR: Error in HDF5 call H5Dopen2() Status -1
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html 
for trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.6.3-3170-g725a008  
GIT Date: 2016-01-19 11:34:55 -0600
[0]PETSC ERROR: readdmvec2

   `6` on a linux-gnu-c-opt named des108 by acro018 Fri Feb 12 17:36:00 
2016
[0]PETSC ERROR: Configure options --download-netcdf --download-exodusii 
--with-hdf5-dir=/usr --download-triangle --download-ptscotch --
download-chaco
[0]PETSC ERROR: #1 VecLoad_HDF5() line 269 in 
/home/acro018/software/PETSc/code/src/vec/vec/utils/vecio.c
[0]PETSC ERROR: #2 VecLoad_Default() line 411 in 
/home/acro018/software/PETSc/code/src/vec/vec/utils/vecio.c
[0]PETSC ERROR: #3 VecLoad_Plex_Local() line 214 in 
/home/acro018/software/PETSc/code/src/dm/impls/plex/plex.c
[0]PETSC ERROR: #4 VecLoad_Plex_HDF5() line 211 in 
/home/acro018/software/PETSc/code/src/dm/impls/plex/plexhdf5.c
[0]PETSC ERROR: #5 VecLoad_Plex() line 238 in 
/home/acro018/software/PETSc/code/src/dm/impls/plex/plex.c
[0]PETSC ERROR: #6 VecLoad() line 975 in 
/home/acro018/software/PETSc/code/src/vec/vec/interface/vector.c

-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 84611

-------------- next part --------------
A non-text attachment was scrubbed...
Name: readdmvec2.F90
Type: text/x-fortran
Size: 3098 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160212/353ab47f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghotcol.exo
Type: application/octet-stream
Size: 3516 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160212/353ab47f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hotcol_ss.h5
Type: application/x-hdf
Size: 70096 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160212/353ab47f/attachment.hdf>


More information about the petsc-dev mailing list