#if !defined(__HDF5_FIX_H) #define __HDF5_FIX_H #include #include PetscErrorCode PetscViewerHDF5ReadAttribute_fix(PetscViewer viewer, const char parent[], const char name[], PetscDataType datatype, void *value) { hid_t h5, obj, attribute, dtype; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1); PetscValidPointer(parent, 2); PetscValidPointer(name, 3); PetscValidPointer(value, 4); ierr = PetscDataTypeToHDF5DataType(datatype, &dtype);CHKERRQ(ierr); ierr = PetscViewerHDF5GetFileId(viewer, &h5);CHKERRQ(ierr); PetscStackCallHDF5Return(obj,H5Oopen,(h5, parent, H5P_DEFAULT)); PetscStackCallHDF5Return(attribute,H5Aopen_name,(obj,name)); PetscStackCallHDF5(H5Aread,(attribute,dtype,value)); PetscStackCallHDF5(H5Aclose,(attribute)); PetscStackCallHDF5(H5Oclose,(obj)); PetscFunctionReturn(0); } #endif //__HDF5_FIX_H