all + | +This causes debugging output from all packages to be sent to the standard error stream. + | +
all -t -s + | +Debugging output for all packages except datatypes and data spaces will appear on the standard error stream. + | +
-all ac 255 t,s + | +This disables all debugging even if the default was to debug something, then output +from the meta data cache is send to the standard error stream and output from data types +and spaces is sent to file descriptor 255 which should be redirected by the shell. + | +
The HDF5 library contains a number of debugging features to - make programmers' lives easier including the ability to print - detailed error messages, check invariant conditions, display - timings and other statistics, and trace API function calls and - return values. - -
NDEBUG
is defined during compiling, the
- library will include code to verify that invariant conditions
- have the expected values. When a problem is detected the
- library will display the file and line number within the
- library and the invariant condition that failed. A core dump
- may be generated for post mortem debugging. The code to
- perform these checks can be included on a per-package bases.
-
- The statistics and tracing can be displayed on any output - stream (including streams opened by the shell) with output from - different packages even going to different streams. - -
By default any API function that fails will print an error - stack to the standard error stream. - -
-
-
- |
-
The error handling package (H5E) is described - elsewhere. - -
To include checks for invariant conditions the library should
- be configured with --disable-production
, the
- default for versions before 1.2. The library designers have made
- every attempt to handle error conditions gracefully but an
- invariant condition assertion may fail in certain cases. The
- output from a failure usually looks something like this:
-
-
-
-
- |
-
Code to accumulate statistics is included at compile time by
- using the --enable-debug
configure switch. The
- switch can be followed by an equal sign and a comma-separated
- list of package names or else a default list is used.
-
-
-
Name | -Default | -Description | -
---|---|---|
a | -No | -Attributes | -
ac | -Yes | -Meta data cache | -
b | -Yes | -B-Trees | -
d | -Yes | -Datasets | -
e | -Yes | -Error handling | -
f | -Yes | -Files | -
g | -Yes | -Groups | -
hg | -Yes | -Global heap | -
hl | -No | -Local heaps | -
i | -Yes | -Interface abstraction | -
mf | -No | -File memory management | -
mm | -Yes | -Library memory management | -
o | -No | -Object headers and messages | -
p | -Yes | -Property lists | -
s | -Yes | -Data spaces | -
t | -Yes | -Datatypes | -
v | -Yes | -Vectors | -
z | -Yes | -Raw data filters | -
In addition to including the code at compile time the
- application must enable each package at runtime. This is done
- by listing the package names in the HDF5_DEBUG
- environment variable. That variable may also contain file
- descriptor numbers (the default is `2') which control the output
- for all following packages up to the next file number. The
- word all
refers to all packages. Any word my be
- preceded by a minus sign to turn debugging off for the package.
-
-
-
all |
- This causes debugging output from all packages to be - sent to the standard error stream. | -
all -t -s |
- Debugging output for all packages except datatypes - and data spaces will appear on the standard error - stream. | -
-all ac 255 t,s |
- This disables all debugging even if the default was to - debug something, then output from the meta data cache is - send to the standard error stream and output from data - types and spaces is sent to file descriptor 255 which - should be redirected by the shell. | -
The components of the HDF5_DEBUG
value may be
- separated by any non-lowercase letter.
-
-
The HDF5 library can trace API calls by printing the
- function name, the argument names and their values, and the
- return value. Some people like to see lots of output during
- program execution instead of using a good symbolic debugger, and
- this feature is intended for their consumption. For example,
- the output from h5ls foo
after turning on tracing,
- includes:
-
-
-
-
- |
-
The code that performs the tracing must be included in the
- library by specifying the --enable-trace
- configuration switch (the default for versions before 1.2). Then
- the word trace
must appear in the value of the
- HDF5_DEBUG
variable. The output will appear on the
- last file descriptor before the word trace
or two
- (standard error) by default.
-
-
-
To display the trace on the standard error stream:
-
- |
-
To send the trace to a file:
-
- |
-
If the library was not configured for tracing then there is no
- unnecessary overhead since all tracing code is excluded.
- However, if tracing is enabled but not used there is a small
- penalty. First, code size is larger because of extra
- statically-declared character strings used to store argument
- types and names and extra auto variable pointer in each
- function. Also, execution is slower because each function sets
- and tests a local variable and each API function calls the
- H5_trace()
function.
-
-
If tracing is enabled and turned on then the penalties from the - previous paragraph apply plus the time required to format each - line of tracing information. There is also an extra call to - H5_trace() for each API function to print the return value. - -
The tracing mechanism is invoked for each API function before - arguments are checked for validity. If bad arguments are passed - to an API function it could result in a segmentation fault. - However, the tracing output is line-buffered so all previous - output will appear. - -
There are two API functions that don't participate in
- tracing. They are H5Eprint()
and
- H5Eprint_cb()
because their participation would
- mess up output during automatic error reporting.
-
-
On the other hand, a number of API functions are called during - library initialization and they print tracing information. - -
For those interested in the implementation here is a
- description. Each API function should have a call to one of the
- H5TRACE()
macros immediately after the
- FUNC_ENTER()
macro. The first argument is the
- return type encoded as a string. The second argument is the
- types of all the function arguments encoded as a string. The
- remaining arguments are the function arguments. This macro was
- designed to be as terse and unobtrousive as possible.
-
-
In order to keep the H5TRACE()
calls synchronized
- with the source code we've written a perl script which gets
- called automatically just before Makefile dependencies are
- calculated for the file. However, this only works when one is
- using GNU make. To reinstrument the tracing explicitly, invoke
- the trace
program from the hdf5 bin directory with
- the names of the source files that need to be updated. If any
- file needs to be modified then a backup is created by appending
- a tilde to the file name.
-
-
-
-
- |
-
Note: The warning message is the result of a comment of the
- form /*NO TRACE*/
somewhere in the function
- body. Tracing information will not be updated or inserted if
- such a comment exists.
-
-
Error messages have the same format as a compiler so that they - can be parsed from program development environments like - Emacs. Any function which generates an error will not be - modified.
-+ * \image html H5DS_fig1.png "Figure 1. The relationship between a Dimension and a Dimension Scale." + * | + *
+ * \image html H5DS_fig2.png "Figure 2. The definition of a Dimension Scale and its attributes." + * | + *
Field | + *Datatype | + *Dataspace | + *Storage Properties | + *Notes | + *
---|---|---|---|---|
<data> | + *Any | + *Any | + *Any | + *These are the values of the Dimension Scale. | + *
Attribute Name | + *Datatype and Dimensions | + *Value | + *Required / Optional | + *Notes | + *
---|---|---|---|---|
CLASS | + *#H5T_STRING length = 16 | + *“DIMENSION_SCALE” | + *Required | + *This attribute distinguishes the dataset as a Dimension scale object. This is set by + * #H5DSset_scale |
+ *
NAME | + *#H5T_STRING length = <user defined> | + *<user defined> The name does not have to be the same as the HDF5 path name for the dataset. + * The name does not have to be related to any labels. Several Dimension Scales may have the same name. |
+ * Optional, (Maximum of 1) | + *The user defined label of the Dimension Scale. This is set by #H5DSset_label |
+ *
REFERENCE_LIST | + *Array of Dataset Reference Type (Compound Datatype), variable length. | + *[ {dataset1, ind1 }, …] [,…] ….] | + *Optional, required when scale is attached | + *See Table 3. This is set by #H5DSattach_scale. | + *
SUB_CLASS | + *#H5T_STRING length = <profile defined> | + *“HDF4_DIMENSION”, “NC4_DIMENSION”, |
+ * Optional, defined by other profiles | + *This is used to indicate a specific profile was used. | + *
<Other attributes> | + *+ * | + * | Optional | + *For example, UNITS. | + *
Field | + *Datatype | + *Value | + *Notes | + *
---|---|---|---|
DATASET | + *Object Reference. | + *Pointer to a Dataset that refers to the scale | + *Set by #H5DSattach_scale. Removed by #H5DSdetach_scale. |
+ *
INDEX | + *#H5T_NATIVE_INT | + *Index of the dimension the dataset pointed to by DATASET | + *Set by #H5DSattach_scale. Removed by #H5DSdetach_scale. |
+ *
Attribute Name | + *Datatype and Dimensions | + *Value | + *Required / Optional | + *Notes | + *
---|---|---|---|---|
DIMENSION_LIST | + *The HDF5 datatype is ARRAY of Variable Length #H5T_STD_REF_OBJ with rank of the dataspace. | + *[[{object__ref1, object__ref2, … object__refn}, …] […] ..] | + *Optional, required if scales are attached | + *Set by #H5DSattach_scale. Entries removed by #H5DSdetach_scale. |
+ *
DIMENSION_LABELLIST | + *The HDF5 datatype is ARRAY of #H5T_STRING with rank of the dataspace. | + *[ <Label1>, <Label2>, …, <Label3>] | + *Optional, required for scales with a label | + *Set by #H5DSset_label. | + *
+ * | No scale | + *Scale with no name | + *Scale with name | + *
---|---|---|---|
No label | + *Dimension has no label or scale (default) | + *Dimension has an anonymous scale | + *Dimension has scale, the scale is called “name” | + *
Label | + *Dimension has label | + *Dimension has scale with a label. | + *Dimension has scale with both a label and name. A shared dimension has one name, + * but may have several labels | + *
+ * \image html UML_Attribute.jpg "The UML model for an HDF5 attribute" + * | + *
+ * \image html H5DS_fig3.png "Figure 3. Example dataset and scales." + * | + *
+ * \image html H5DS_fig4.png "Figure 4. Example labels, names, and attached scales." + * | + *
+ * \image html H5DS_fig5.png "Figure 5. The table of dimension references, stored as an attribute of the + * Dataset." + * | + *
Dataset Dimension | + *Label | + *
---|---|
0 | + *“LX” | + *
1 | + *“LZ” | + *
2 | + *“LQ” | + *
3 | + *“” | + *
Reference | + *Dataset Reference Record | + *
---|---|
0 | + *{Object reference to Dataset D, 0} | + *
1 | + *{Object reference to other Dataset, ?} | + *
Reference | + *Dataset Reference Record | + *
---|---|
0 | + *{Object reference to Dataset D, 0} | + *
Reference | + *Dataset Reference Record | + *
---|---|
0 | + *{Object reference to Dataset D, 1} | + *
1 | + *{Object reference to Dataset D, 3} | + *
Reference | + *Dataset Reference Record | + *
---|---|
0 | + *{Object reference to Dataset D, 3} | + *
- * \image html Dmodel_fig14_c.gif " Another HDF5 file structure with groups and datasets" + * \image html Dmodel_fig14_d.gif " Another HDF5 file structure with groups and datasets" * | *