2: #ifndef __VIEWERHDF5IMPL_H
5: #if defined(H5_VERSION)
6: # error "viewerhdf5impl.h must be included *before* any other HDF5 headers"
7: #else
8: # define H5_USE_18_API
9: #endif
10: #include <petscviewerhdf5.h> 12: #if defined(PETSC_HAVE_HDF5)
14: #define PetscStackCallHDF5(func,args) do { \ 15: herr_t _status; \ 16: PetscStackPush(#func);_status = func args;PetscStackPop; if (_status) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in HDF5 call %s() Status %d",#func,(int)_status); \ 17: } while (0) 19: #define PetscStackCallHDF5Return(ret,func,args) do { \ 20: PetscStackPush(#func);ret = func args;PetscStackPop; if (ret < 0) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in HDF5 call %s() Status %d",#func,(int)ret); \ 21: } while (0) 23: typedef struct PetscViewerHDF5GroupList {
24: const char *name;
25: struct PetscViewerHDF5GroupList *next;
26: } PetscViewerHDF5GroupList;
28: typedef struct {
29: char *filename;
30: PetscFileMode btype;
31: hid_t file_id;
32: hid_t dxpl_id; /* H5P_DATASET_XFER property list controlling raw data transfer (read/write). Properties are modified using H5Pset_dxpl_* functions. */
33: PetscInt timestep;
34: PetscViewerHDF5GroupList *groups;
35: PetscBool basedimension2; /* save vectors and DMDA vectors with a dimension of at least 2 even if the bs/dof is 1 */
36: PetscBool spoutput; /* write data in single precision even if PETSc is compiled with double precision PetscReal */
37: } PetscViewer_HDF5;
39: #endif
40: #endif