HDF5 documents and links Introduction to HDF5 HDF5 User Guide |
And in this document, the
HDF5 Reference Manual H5 H5A H5D H5E H5F H5G H5I H5P H5R H5S H5T H5Z Tools Datatypes Collective Calls in Parallel |
(PDF of complete manual formatted as print volume) |
HDF5-related tools are available to assist the user in a variety of activities, including examining or managing HDF5 files, converting raw data between HDF5 and other special-purpose formats, moving data and files between the HDF4 and HDF5 formats, measuring HDF5 library performance, and managing HDF5 library and application compilation, installation and configuration. Unless otherwise specified below, these tools are distributed and installed with HDF5.
https://support.hdfgroup.org/products/java/hdf-java-html/
)
HDFview
-- a browser that
works with both HDF4 and HDF5 files and
can be used to transfer data between the two formats
https://support.hdfgroup.org/h4toh5/
)
https://support.hdfgroup.org/tools5.html
)
h5dump
[
OPTIONS]
file
h5dump
enables the user to examine
the contents of an HDF5 file and dump those contents, in human
readable form, to an ASCII file.
h5dump
dumps HDF5 file content to standard output.
It can display the contents of the entire HDF5 file or
selected objects, which can be groups, datasets, a subset of a
dataset, links, attributes, or datatypes.
The --header
option displays object header
information only.
Names are the absolute names of the objects. h5dump
displays objects in the order same as the command order. If a
name does not start with a slash, h5dump
begins
searching for the specified object starting at the root group.
If an object is hard linked with multiple names,
h5dump
displays the content of the object in the
first occurrence. Only the link information is displayed in later
occurrences.
h5dump
assigns a name for any unnamed datatype in
the form of
#
oid1:
oid2, where
oid1 and oid2 are the object identifiers
assigned by the library. The unnamed types are displayed within
the root group.
Datatypes are displayed with standard type names. For example,
if a dataset is created with H5T_NATIVE_INT
type
and the standard type name for integer on that machine is
H5T_STD_I32BE
, h5dump
displays
H5T_STD_I32BE
as the type of the dataset.
h5dump
can also dump a subset of a dataset.
This feature operates in much the same way as hyperslabs in HDF5;
the parameters specified on the command line are passed to the
function
H5Sselect_hyperslab
and the resulting selection
is displayed.
The h5dump
output is described in detail in the
DDL for HDF5, the
Data Description Language document.
Note: It is not permissible to specify multiple
attributes, datasets, datatypes, groups, or soft links with one
flag. For example, one may not issue the command
WRONG:
h5dump -a /attr1 /attr2 foo.h5
to display both /attr1
and /attr2
.
One must issue the following command:
CORRECT:
h5dump -a /attr1 -a /attr2 foo.h5
It's possible to select the file driver with which to open the HDF5 file by using the --filedriver (-f) command-line option. Acceptable values for the --filedriver option are: "sec2", "family", "split", "multi", and "stream". If the file driver flag isn't specified, then the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file.
One byte integer type data is displayed in decimal by default. When displayed in ASCII, a non-printable code is displayed in 3 octal digits preceeded by a back-slash unless there is a C language escape sequence for it. For example, CR and LF are printed as \r and \n. Though the NUL code is represented as \0 in C, it is printed as \000 to avoid ambiguity as illustrated in the following 1 byte char data (since this is not a string, embedded NUL is possible).
141 142 143 000 060 061 062 012 a b c \0 0 1 2 \nh5dump prints them as "abc\000012\n". But if h5dump prints NUL as \0, the output is "abc\0012\n" which is ambiguous.
--xml
option, h5dump
generates
XML output. This output contains a complete description of the file,
marked up in XML. The XML conforms to the HDF5 Document Type
Definition (DTD) available at
https://support.hdfgroup.org/DTDs/HDF5-File.dtd
.
The XML output is suitable for use with other tools, including the HDF5 Java Tools.
-h
or
--help
-n
or
--contents
-B
or
--bootblock
-H
or
--header
-A
-i
or
--object-ids
-r
or
--string
-e
-V
or
--version
-a P
or
--attribute=P
-d P
or
--dataset=P
-y
-p
or
--properties
-f D
or
--filedriver=D
-g P
or
--group=P
-l P
or
--soft-link=P
-o F
or
--output=F
-t P
or
--datatype=P
-w N
or
--width=N
-b B
or
--binary=B
B
.
B
must have one of the following values:
LE
Little-endian
BE
Big-endian
MEMORY
Memory datatype
FILE
File datatype
-d
and -o
options.
-x
or
--xml
-u
or
--use-dtd
-D U
or
--xml-dtd=U
-X S
or
--xml-dns=S
--
-
), which could
confuse the tool’s command-line parser.)
start
and count
parameters
are mandatory if subsetting is to be performed;
the stride
and block
parameters
are optional and will default to 1
(one).
-s L
or
--start=L
-S L
or
--stride=L
-c L
or
--count=L
-k L
or
--block=L
--dataset="/foo/mydataset[START;STRIDE;COUNT;BLOCK]"
;
) are required, even when
a parameter value is not specified.
When not specified, default parameter values are used.
0 | Succeeded. |
>0 | An error occurred. |
/GroupFoo/GroupBar
in the file
quux.h5
:
h5dump -g /GroupFoo/GroupBar quux.h5
Fnord
, which is in the group
/GroupFoo/GroupBar
in the file quux.h5
:
h5dump -d /GroupFoo/GroupBar/Fnord quux.h5
metadata
of the dataset
Fnord
, which is in group
/GroupFoo/GroupBar
in the file quux.h5
:
h5dump -a /GroupFoo/GroupBar/Fnord/metadata quux.h5
metadata
which is an
attribute of the root group in the file quux.h5
:
h5dump -a /metadata quux.h5
bobo.h5
,
saving the listing in the file bobo.h5.xml
:
h5dump --xml bobo.h5 > bobo.h5.xml
/GroupFoo/databar/
in the file quux.h5
h5dump -d /GroupFoo/databar --start="1,1" --stride="2,3"
--count="3,19" --block="1,1" quux.h5
h5dump -d "/GroupFoo/databar[1,1;2,3;3,19;1,1]" quux.h5
/GroupD/FreshData/
in the file quux.h5
, with data written in little-endian
form, to the output file FreshDataD.bin
:
h5dump -d "/GroupD/FreshData" -b LE -o "FreshDataD.bin"
quux.h5
h5dump
displays the
following information:
h5ls
[
OPTIONS]
file
[
OBJECTS...]
h5ls
prints selected information about file objects
in the specified format.
-h
or
-?
or
--help
-a
or
--address
-d
or --data
-e
or
--errors
-f
or
--full
-g
or
--group
-l
or
--label
-r
or
--recursive
-s
or
--string
-S
or
--simple
-w
N or
--width=
N
-v
or
--verbose
-V
or
--version
-x
or
--hexdump
%%05d
to open a file family.
printf(3C)
integer format such
as "%05d" to open a file family.
0 | Succeeded. |
>0 | An error occurred. |
h5diff
file1 file2
[OPTIONS]
[object1 [object2 ] ]
h5diff
is a command line tool that compares
two HDF5 files, file1 and file2, and
reports the differences between them.
Optionally, h5diff
will compare two objects
within these files.
If only one object, object1, is specified,
h5diff
will compare
object1 in file1
with object1 in file2.
In two objects, object1 and object2,
are specified, h5diff
will compare
object1 in file1
with object2 in file2.
These objects must be HDF5 datasets.
object1 and object2 must be expressed as absolute paths from the respective file's root group.
h5diff
has the following four modes of output:
Normal mode: Print the number of differences found and where
they occurred.
Report mode (-r): Print the above plus the differences.
Verbose mode (-v): Print the above plus a list of objects and warnings.
Quiet mode (-q): Do not print output
(h5diff always returns an exit code of 1 when differences are found).
Additional information, with several sample cases, can be found in the document H5diff Examples.
h5diff
and NaNs:
h5diff
detects when a value in a dataset is a NaN
(a "not a number" value), but does not differentiate among various
types of NaNs.
Thus, when one NaN is compared with another NaN, h5diff
treats them as equal; when a NaN is compared with a valid number,
h5diff
treats them as not equal.
Note that NaN detection is computationally expensive and slows
h5diff
performance dramatically.
If you do not have NaNs in your files, or do not care about NaNs,
use the -N
option below to turn off NaN detection.
Similarly, if h5diff -N
produces unexpected differences,
running h5diff
without -N
should reveal
whether any of the differences are associated with NaN values.
-h
-r
-v
-q
-N
h5diff
and NaNs” above.
-n
count
-d
delta
|a–b| > delta
,
where a
is a value in file1 and
b
is a value in file2).
-p
relative
1
and the ratio of two corresponding values
is greater than relative
(e.g., |1–(b/a)| > relative
where a
is a value in file1 and
b
is a value in file2).
--use-system-epsilon
a
is a data value in one dataset,
b
is the corresponding data value in the
dataset with which the first dataset is being compared, and
epsilon
is the system epsilon,
return a difference if and only if
|a-b| > epsilon
.
h5diff
checks for strict equality.
0 | No differences were found. |
1 | Some differences were found. |
>1 | An error occurred. |
h5diff
call compares
the object /a/b
in file1
with the object /a/c
in file2
: h5diff file1 file2 /a/b /a/c
This h5diff
call compares
the object /a/b
in file1
with the same object in file2
:
h5diff file1 file2 /a/b
And this h5diff
call compares
all objects in both files:
h5diff file1 file2
file1
and file2
can be the same file.
Use:
h5diff
file1 file1 /g1/dset1 /g1/dset2
to compare /g1/dset1
and /g1/dset2
in the same file.
Release | Command Line Tool |
1.6.0 | Tool introduced in this release. |
1.6.10 |
--use-system-epsilon
option added in this release. |
h5repack
[-h]
[-v]
[-m
number]
[-n]
[-f '
filter']
[-l '
layout']
[-e
file]
in_file
out_file
h5repack
is a command line tool that
applies HDF5 filters to an input file in_file,
saving the output in a new output file, out_file.
-h
-v
-m
number
-n
h5repack
generated
files only with native datatypes.
-f
filter
filter is a string with the following format:
<list of objects> is a comma separated list of object names meaning apply compression only to those objects. If no object names are specified, the filter is applied to all objects.
<name of filter> can be one of the following:
GZIP
, to apply the HDF5 GZIP filter
(GZIP compression)
SZIP
, to apply the HDF5 SZIP filter
(SZIP compression)
SHUF
, to apply the HDF5 shuffle filter
FLET
, to apply the HDF5 checksum filter
NONE
, to remove the filter
<filter parameters> conveys optional compression
information:
SHUF
(no parameter)
FLET
(no parameter)
GZIP=
<deflation level> from 1-9
SZIP=
<pixels per block,coding>
Pixels per block is a even number in the range 2-32.
Coding method is EC
or NN
.
-l
layout
layout is a string with the following format:
<list of objects> is a comma separated list of object names, meaning that layout information is supplied for those objects. If no object names are specified, the layout is applied to all objects.
<layout type> can be one of the following:
CHUNK
, to apply chunking layout
COMPA
, to apply compact layout
CONTI
, to apply continuous layout
<layout parameters> is present only in the
CHUNK
case and specifies the chunk size of
each dimension in the following format with no intervening
spaces:
dim_1 × dim_2 × ...
dim_n
-e
file
0 | Succeeded. |
>0 | An error occurred. |
h5repack -f GZIP=1 -v file1 file2
file1
and saves the output in file2
.
Prints verbose output.
h5repack -f dset1:SZIP=8,NN file1 file2
dset1
.
h5repack -l dset1,dset2:CHUNK=20x10 file1 file2
dset1
and dset2
.
h5repart
[-v]
[-V]
[-[b|m]
N[g|m|k]]
source_file
dest_file
h5repart
splits a single file into a family of
files, joins a family of files into a single file, or copies
one family of files to another while changing the size of the
family members. h5repart
can also be used to
copy a single file to a single file with holes.
Sizes associated with the -b
and -m
options may be suffixed with g
for gigabytes,
m
for megabytes, or k
for kilobytes.
File family names include an integer printf
format such as %d
.
-v
-V
-b
N
-m
N
0 | Succeeded. |
>0 | An error occurred. |
h5import
infile in_options
[infile in_options ...]
-o outfile
h5import
infile in_options
[infile in_options ...]
-outfile outfile
h5import -h
h5import -help
h5import
converts data
from one or more ASCII or binary files, infile
,
into the same number of HDF5 datasets
in the existing or new HDF5 file, outfile
.
Data conversion is performed in accordance with the
user-specified type and storage properties
specified in in_options
.
The primary objective of h5import
is to
import floating point or integer data.
The utility's design allows for future versions that
accept ASCII text files and store the contents as a
compact array of one-dimensional strings,
but that capability is not implemented in HDF5 Release 1.6.
Input data and options:
Input data can be provided in one of the following forms:
infile
,
contains a single n-dimensional
array of values of one of the above types expressed
in the order of fastest-changing dimensions first.
Floating point data in an ASCII input file may be expressed either in the fixed-point form (e.g., 323.56) or in scientific notation (e.g., 3.23E+02) in an ASCII input file.
Each input file can be associated with options specifying the datatype and storage properties. These options can be specified either as command line arguments or in a configuration file. Note that exactly one of these approaches must be used with a single input file.
Command line arguments, best used with simple input files, can be used to specify the class, size, dimensions of the input data and a path identifying the output dataset.
The recommended means of specifying input data options is in a configuration file; this is also the only means of specifying advanced storage features. See further discussion in "The configuration file" below.
The only required option for input data is dimension sizes; defaults are available for all others.
h5import
will accept up to 30 input files in a single call.
Other considerations, such as the maximum length of a command line,
may impose a more stringent limitation.
Output data and options:
The name of the output file is specified following
the -o
or -output
option
in outfile
.
The data from each input file is stored as a separate dataset
in this output file.
outfile
may be an existing file.
If it does not yet exist, h5import
will create it.
Output dataset information and storage properties can be specified only by means of a configuration file.
Dataset path | If the groups in the path leading to the dataset
do not exist, h5import will create them.If no group is specified, the dataset will be created as a member of the root group. If no dataset name is specified, the default name is dataset1 for the first input dataset,
dataset2 for the second input dataset,
dataset3 for the third input dataset,
etc.h5import does not overwrite a pre-existing
dataset of the specified or default name.
When an existing dataset of a conflicting name is
encountered, h5import quits with an error;
the current input file and any subsequent input files
are not processed.
| |
Output type | Datatype parameters for output data | |
Output data class | Signed or unsigned integer or floating point | |
Output data size | 8-, 16-, 32-, or 64-bit integer 32- or 64-bit floating point | |
Output architecture | IEEE STD NATIVE (Default)Other architectures are included in the h5import design
but are not implemented in this release.
| |
Output byte order | Little- or big-endian. Relevant only if output architecture is IEEE , UNIX , or STD ;
fixed for other architectures.
| |
Dataset layout and storage properties | Denote how raw data is to be organized on the disk. If none of the following are specified, the default configuration is contiguous layout and with no compression. | |
Layout | Contiguous (Default) Chunked | |
External storage | Allows raw data to be stored in a non-HDF5 file or in an
external HDF5 file. Requires contiguous layout. | |
Compressed | Sets the type of compression and the
level to which the dataset must be compressed. Requires chunked layout. | |
Extendable | Allows the dimensions of the dataset increase over time
and/or to be unlimited. Requires chunked layout. | |
Compressed and extendable | Requires chunked layout. | |
Command-line arguments:
The h5import
syntax for the command-line arguments,
in_options
, is as follows:
h5import infile -d dim_list
[-p pathname]
[-t input_class]
[-s input_size]
[infile ...]
-o outfile or h5import infile -dims dim_list
[-path pathname]
[-type input_class]
[-size input_size]
[infile ...]
-outfile outfile or h5import infile -c config_file
[infile ...]
-outfile outfile
|
-c config_file
option is used with
an input file, no other argument can be used with that input file.
If the -c config_file
option is not used with
an input data file, the -d dim_list
argument
(or -dims dim_list
)
must be used and any combination of the remaining options may be used.
Any arguments used must appear in exactly the order used
in the syntax declarations immediately above.
The configuration file:
A configuration file is specified with the
-c config_file
option:
h5import infile -c config_file
[infile -c config_file2 ...]
-outfile outfile
|
The configuration file is an ASCII file and must be
organized as "Configuration_Keyword Value" pairs,
with one pair on each line.
For example, the line indicating that
the input data class (configuration keyword INPUT-CLASS
)
is floating point in a text file (value TEXTFP
)
would appear as follows:
INPUT-CLASS TEXTFP
A configuration file may have the following keywords each
followed by one of the following defined values.
One entry for each of the first two keywords,
RANK
and DIMENSION-SIZES
,
is required; all other keywords are optional.
Keyword Value
| Description | ||
---|---|---|---|
RANK
| The number of dimensions in the dataset. (Required) | ||
rank
| An integer specifying the number of dimensions in the dataset. Example: 4 for a 4-dimensional dataset.
| ||
DIMENSION-SIZES
| Sizes of the dataset dimensions. (Required) | ||
dim_sizes
| A string of space-separated integers
specifying the sizes of the dimensions in the dataset.
The number of sizes in this entry must match the value in
the RANK entry.
The fastest-changing dimension must be listed first.Example: 4 3 4 38 for a 38x4x3x4 dataset.
| ||
PATH
| Path of the output dataset. | ||
path
| The full HDF5 pathname identifying the output dataset
relative to the root group within the output file. I.e., path is a string consisting of
optional group names, each followed by a slash,
and ending with a dataset name.
If the groups in the path do no exist, they will be
created.If PATH is not specified, the output dataset
is stored as a member of the root group and the
default dataset name is
dataset1 for the first input dataset,
dataset2 for the second input dataset,
dataset3 for the third input dataset, etc.Note that h5import does not overwrite a
pre-existing dataset of the specified or default name.
When an existing dataset of a conflicting name is
encountered, h5import quits with an error;
the current input file and any subsequent input files
are not processed.Example: The configuration file entry
dataset1 will
be written in the group grp2/ which is in
the group grp1/ ,
a member of the root group in the output file.
| ||
INPUT-CLASS
| A string denoting the type of input data. | ||
TEXTIN
| Input is signed integer data in an ASCII file. | ||
TEXTUIN
| Input is unsigned integer data in an ASCII file. | ||
TEXTFP
| Input is floating point data in either fixed-point notation (e.g., 325.34) or scientific notation (e.g., 3.2534E+02) in an ASCII file. | ||
IN
| Input is signed integer data in a binary file. | ||
UIN
| Input is unsigned integer data in a binary file. | ||
FP
| Input is floating point data in a binary file. (Default) | ||
STR
| Input is character data in an ASCII file.
With this value, the configuration keywords
RANK , DIMENSION-SIZES ,
OUTPUT-CLASS , OUTPUT-SIZE ,
OUTPUT-ARCHITECTURE , and OUTPUT-BYTE-ORDER
will be ignored.(Not implemented in this release.) | ||
INPUT-SIZE
| An integer denoting the size of the input data, in bits. | ||
8 16 32 64
| For signed and unsigned integer data:
TEXTIN , TEXTUIN ,
IN , or UIN .
(Default: 32 )
| ||
32 64
| For floating point data:
TEXTFP
or FP .
(Default: 32 )
| ||
OUTPUT-CLASS
| A string denoting the type of output data. | ||
IN
| Output is signed integer data. (Default if INPUT-CLASS is
IN or TEXTIN )
| ||
UIN
| Output is unsigned integer data. (Default if INPUT-CLASS is
UIN or TEXTUIN )
| ||
FP
| Output is floating point data. (Default if INPUT-CLASS is not specified or is
FP or TEXTFP )
| ||
STR
| Output is character data,
to be written as a 1-dimensional array of strings. (Default if INPUT-CLASS is STR )(Not implemented in this release.) | ||
OUTPUT-SIZE
| An integer denoting the size of the output data, in bits. | ||
8 16 32 64
| For signed and unsigned integer data:
IN or UIN .
(Default: Same as INPUT-SIZE , else 32 )
| ||
32 64
| For floating point data:
FP .
(Default: Same as INPUT-SIZE , else 32 )
| ||
OUTPUT-ARCHITECTURE
| A string denoting the type of output architecture. | ||
NATIVE STD IEEE INTEL * CRAY * MIPS * ALPHA * UNIX *
| See the "Predefined Atomic Types" section
in the "HDF5 Datatypes" chapter
of the HDF5 User's Guide
for a discussion of these architectures. Values marked with an asterisk (*) are not implemented in this release. (Default: NATIVE )
| ||
OUTPUT-BYTE-ORDER
| A string denoting the output byte order. This entry is ignored if the OUTPUT-ARCHITECTURE
is not specified or if it is not specified as IEEE ,
UNIX , or STD .
| ||
BE
| Big-endian. (Default) | ||
LE
| Little-endian. | ||
The following options are disabled by default, making the default storage properties no chunking, no compression, no external storage, and no extensible dimensions. | |||
CHUNKED-DIMENSION-SIZES | Dimension sizes of the chunk for chunked output data. | ||
chunk_dims
| A string of space-separated integers specifying the
dimension sizes of the chunk for chunked output data.
The number of dimensions must correspond to the value
of RANK .The presence of this field indicates that the output dataset is to be stored in chunked layout; if this configuration field is absent, the dataset will be stored in contiguous layout. | ||
COMPRESSION-TYPE
| Type of compression to be used with chunked storage. Requires that CHUNKED-DIMENSION-SIZES
be specified.
| ||
GZIP
| Gzip compression. Other compression algorithms are not implemented in this release of h5import .
| ||
COMPRESSION-PARAM
| Compression level. Required if COMPRESSION-TYPE is specified.
| ||
1 through 9
| Gzip compression levels:
1 will result in the fastest compression
while 9 will result in the
best compression ratio.(Default: 6. The default gzip compression level is 6; not all compression methods will have a default level.) | ||
EXTERNAL-STORAGE
| Name of an external file in which to create the output dataset. Cannot be used with CHUNKED-DIMENSIONS-SIZES ,
COMPRESSION-TYPE , OR MAXIMUM-DIMENSIONS .
| ||
external_file
| A string specifying the name of an external file. | ||
MAXIMUM-DIMENSIONS
| Maximum sizes of all dimensions. Requires that CHUNKED-DIMENSION-SIZES be specified.
| ||
max_dims
| A string of space-separated integers specifying the
maximum size of each dimension of the output dataset.
A value of -1 for any dimension implies
unlimited size for that particular dimension.The number of dimensions must correspond to the value of RANK . | ||
The help
option:
The help option, expressed as one of
h5import -h or h5import -help | |
prints the h5import usage summary | |
h5import -h[elp], OR
| |
then exits. |
infile(s)
in_options
-dims
argument
is required, arguments must used in the order in which they are listed below.
-d dim_list
-dims dim_list
dim_list
is a string of
comma-separated numbers with no spaces
describing the dimensions of the input data.
For example, a 50 × 100 2-dimensional array would be
specified as -dims 50,100
.-p pathname
-pathname pathname
pathname
is a string consisting of
one or more strings separated by slashes (/
)
specifying the path of the dataset in the output file.
If the groups in the path do no exist, they will be
created.dataset1
for the first input dataset,
dataset2
for the second input dataset,
dataset3
for the third input dataset,
etc.h5import
does not overwrite a pre-existing
dataset of the specified or default name.
When an existing dataset of a conflicting name is
encountered, h5import
quits with an error;
the current input file and any subsequent input files
are not processed.
-t input_class
-type input_class
input_class
specifies the class of the
input data and determines the class of the output data.FP
.
-s input_size
-size input_size
input_size
specifies the size in bits
of the input data and determines the size of the output data.8
, 16
, 32
, and 64
.32
and 64
.32
.
-c config_file
config_file
specifies a
configuration file.infile
and
-o outfile
outfile
0 | Succeeded. |
>0 | An error occurred. |
h5import infile -dims 2,3,4 -type TEXTIN -size 32 -o out1
| |
This command creates a file out1 containing
a single 2x3x4 32-bit integer dataset.
Since no pathname is specified, the dataset is stored
in out1 as /dataset1 .
| |
h5import infile -dims 20,50 -path bin1/dset1 -type FP -size 64 -o out2
| |
This command creates a file out2 containing
a single a 20x50 64-bit floating point dataset.
The dataset is stored in out2 as /bin1/dset1 .
|
outfile
at /work/h5/pkamat/First-set
.PATH work/h5/pkamat/First-set INPUT-CLASS TEXTFP RANK 3 DIMENSION-SIZES 5 2 4 OUTPUT-CLASS FP OUTPUT-SIZE 64 OUTPUT-ARCHITECTURE IEEE OUTPUT-BYTE-ORDER LE CHUNKED-DIMENSION-SIZES 2 2 2 MAXIMUM-DIMENSIONS 8 8 -1The next configuration file specifies the following:
NATIVE
format
(as the output architecture is not specified).outfile
at /Second-set
.
PATH Second-set INPUT-CLASS IN RANK 5 DIMENSION-SIZES 6 3 5 2 4 OUTPUT-CLASS IN OUTPUT-SIZE 32 CHUNKED-DIMENSION-SIZES 2 2 2 2 2 COMPRESSION-TYPE GZIP COMPRESSION-PARAM 7
Release | Command Line Tool |
1.6.0 | Tool introduced in this release. |
gif2h5
gif_file h5_file
gif2h5
accepts as input the GIF file gif_file
and produces the HDF5 file h5_file as output.
h52gif
h5_file gif_file
-i
h5_image
[-p
h5_palette]
h52gif
accepts as input the HDF5 file h5_file
and the names of images and associated palettes within that file
as input and produces the GIF file gif_file,
containing those images, as output.
h52gif
expects at least
one h5_image.
You may repeat
-i
h5_image
[-p
h5_palette]
up to 50 times, for a maximum of 50 images.
-i
h5_image
-p
h5_palette
h5toh4 -h
h5toh4
h5file
h4fileh5toh4
h5fileh5toh4 -m
h5file1
h5file2
h5file3 ...
h5toh4
is an HDF5 utility which reads
an HDF5 file, h5file, and converts all
supported objects and pathways to produce an HDF4 file,
h4file. If h4file already exists,
it will be replaced.
If only one file name is given, the name must end in
.h5
and is assumed to represent the
HDF5 input file. h5toh4
replaces the
.h5
suffix with .hdf
to form
the name of the resulting HDF4 file and proceeds as above.
If a file with the name of the intended HDF4 file already
exists, h5toh4
exits with an error without
changing the contents of any file.
The -m
option allows multiple HDF5 file
arguments. Each file name is treated the same as the
single file name case above.
The -h
option causes the following
syntax summary to be displayed:
h5toh4 file.h5 file.hdf h5toh4 file.h5 h5toh4 -m file1.h5 file2.h5 ...
The following HDF5 objects occurring in an HDF5 file are converted to HDF4 objects in the HDF4 file:
Attributes associated with any of the supported HDF5 objects are carried over to the HDF4 objects. Attributes may be of integer, floating point, or fixed length string datatype and they may have up to 32 fixed dimensions.
All datatypes are converted to big-endian. Floating point datatypes are converted to IEEE format.
h5toh4
and h4toh5
utilities
are no longer part of the HDF5 product;
they are distributed separately through the page
Converting between HDF (4.x) and HDF5.
-h
-m
h4toh5 -h
h4toh5
h4file
h5fileh4toh5
h4fileh4toh5
is a file conversion utility that reads
an HDF4 file, h4file (input.hdf
for example),
and writes an HDF5 file, h5file (output.h5
for example), containing the same data.
If no output file h5file is specified,
h4toh5
uses the input filename to designate
the output file, replacing the extension .hdf
with .h5
.
For example, if the input file scheme3.hdf
is
specified with no output filename, h4toh5
will
name the output file scheme3.h5
.
The -h
option causes a syntax summary
similar to the following to be displayed:
h4toh5 inputfile.hdf outputfile.h5 h4toh5 inputfile.hdf
Each object in the HDF4 file is converted to an equivalent HDF5 object, according to the mapping described in Mapping HDF4 Objects to HDF5 Objects.
In this initial version, h4toh5
converts the following
HDF4 objects:
HDF4 Object | Resulting HDF5 Object |
---|---|
SDS | Dataset |
GR, RI8, and RI24 image | Dataset |
Vdata | Dataset |
Vgroup | Group |
Annotation | Attribute |
Palette | Dataset |
h4toh5
and h5toh4
utilities
are no longer part of the HDF5 product;
they are distributed separately through the page
Converting between HDF (4.x) and HDF5.
-h
h5perf
[-h
| --help
]
h5perf
[options]
h5perf
is a tool for testing the performance
of the Parallel HDF5 Library.
The tool can perform testing with 1-dimensional and 2-dimensional
buffers and datasets.
For details regarding data organization and access, see
“h5perf,
a Parallel File System Benchmarking Tool.”
The following environment variables have the following
effects on h5perf
behavior:
HDF5_NOCLEANUP |
If set, h5perf does not remove data files.
(Default: Data files are removed.) | |
HDF5_MPI_INFO |
Must be set to a string containing a list of semi-colon separated
key=value pairs for the MPI INFO object.
Example: | |
HDF5_PARAPREFIX | Sets the prefix for parallel output data files. |
These terms are used as follows in this section: | |
file | A filename |
size | A size specifier, expressed as an integer
greater than or equal to 0 (zero) followed by a size indicator:
K for kilobytes (1024 bytes)
M for megabytes (1048576 bytes)
G for gigabytes (1073741824 bytes)
Example: 37M specifies 37 megabytes or
38797312 bytes. |
N | An integer greater than or equal to 0 (zero) |
-h , --help |
||||||||||||||||||||||
Prints a usage message and exits. | ||||||||||||||||||||||
-a size,
--align= size |
||||||||||||||||||||||
Specifies the alignment of objects in the HDF5 file.
(Default: 1 ) |
||||||||||||||||||||||
-A api_list,
--api= api_list |
||||||||||||||||||||||
Specifies which APIs to test. api_list
is a comma-separated list with the following valid values:
Example, --api=mpiio,phdf5 specifies that the MPI I/O
and Parallel HDF5 APIs are to be monitored. |
||||||||||||||||||||||
-B size,
--block-size= size |
||||||||||||||||||||||
Controls the block size within the transfer buffer.
(Default: Half the number of bytes per process per dataset)
Block size versus transfer buffer size:
Transfer buffer size is discussed below with the
The pattern in which the blocks are written to the file is
described in the discussion of the |
||||||||||||||||||||||
-c ,
--chunk |
||||||||||||||||||||||
Creates HDF5 datasets in chunked layout.
(Default: Off) |
||||||||||||||||||||||
-C ,
--collective |
||||||||||||||||||||||
Use collective I/O for the MPI I/O and
Parallel HDF5 APIs.
(Default: Off, i.e., independent I/O)
If this option is set and the MPI-I/O and PHDF5 APIs are in use,
all the blocks of every process will be written at once
with an MPI derived type. |
||||||||||||||||||||||
-d N,
--num-dsets N |
||||||||||||||||||||||
Sets the number of datasets per file.
(Default: 1 ) |
||||||||||||||||||||||
-D debug_flags,
--debug= debug_flags |
||||||||||||||||||||||
Sets the debugging level. debug_flags
is a comma-separated list of debugging flags with the following
valid values:
Example:
Throughput values are computed by dividing the total amount of
transferred data (excluding metadata) over the time spent
by the slowest process.
Several time counters are defined to measure the data transfer
time and the total elapsed time; the latter includes the time
spent during file open and close operations.
A number of iterations can be specified with the
option for each iteration initialize elapsed time counter initialize data transfer time counter for each file start and accumulate elapsed time counter file open start and accumulate data transfer time counter access entire file stop data transfer time counter file close stop elapsed time counter end file save elapsed time counter save data transfer time counter end iteration The reported write throughput is based on the accumulated data transfer time, while the write open-close throughput uses the accumulated elapsed time. |
||||||||||||||||||||||
-e size,
--num-bytes= size |
||||||||||||||||||||||
Specifies the number of bytes per process per
dataset.
(Default: 256K for 1D,
8K for 2D)
Depending on the selected geometry, each test dataset
can be a linear array of size
bytes-per-process * num-processes
or a square array of size
(bytes-per-process * num-processes) ×
(bytes-per-process * num-processes).
The number of processes is set by the
|
||||||||||||||||||||||
-F N,
--num-files= N |
||||||||||||||||||||||
Specifies the number of files.
(Default: 1 ) |
||||||||||||||||||||||
-g ,
--geometry |
||||||||||||||||||||||
Selects 2D geometry for testing.
(Default: Off, i.e., 1D geometry) |
-i N,
--num-iterations= N |
|
Sets the number of iterations to perform.
(Default: 1 ) |
|
-I ,
--interleaved |
|
Sets interleaved block I/O.
(Default: Contiguous block I/O)
Interleaved and contiguous patterns in 1D geometry:
For example, with a three process run, 512KB bytes-per-process, 256KB transfer buffer size, and 64KB block size, each process must issue two transfer requests to complete access to the dataset.
Contiguous blocks of the first transfer request are written
as follows:
Interleaved blocks of the first transfer request are written
as follows:
The actual number of I/O operations involved in a transfer request depends on the access pattern and communication mode. When using independent I/O with an interleaved access pattern, each process performs four small non-contiguous I/O operations per transfer request. If collective I/O is turned on, the combined content of the buffers of the three processes will be written using one collective I/O operation per transfer request. For details regarding the impact of performance and access patterns in 2D, see “h5perf, a Parallel File System Benchmarking Tool.” |
-m , --mpi-posix |
Sets use of MPI-posix driver for HDF5 I/O.
(Default: MPI-I/O driver) |
-n , --no-fill |
Specifies to not write fill values to HDF5 datasets.
This option is supported only in HDF5 Release v1.6 or later.
(Default: Off, i.e., write fill values) |
-o file,
--output= file |
Sets the output file for raw data to file.
(Default: None) |
-p N,
--min-num-processes= N |
Sets the minimum number of processes to be used.
(Default: 1 ) |
-P N,
--max-num-processes= N
|
Sets the maximum number of processes to be used.
(Default: All MPI_COMM_WORLD processes) |
-T size,
--threshold= size |
Sets the threshold for alignment of objects in the
HDF5 file.
(Default: 1 ) |
-w , --write-only |
Performs only write tests, not read tests.
(Default: Read and write tests) |
-x size,
--min-xfer-size= size |
Sets the minimum transfer buffer size.
(Default: Half the number of bytes per processor per dataset)
This option and the |
-X size,
--max-xfer-size= size |
Sets the maximum transfer buffer size.
(Default: The number of bytes per processor per dataset) |
0 | Succeeded. |
>0 | An error occurred. |
Release | Change |
1.6.0 | Tool introduced in this release. |
1.6.8 and 1.8.0 |
Option -g , --geometry introduced
in this release. |
h5jam -u user_block -i in_file.h5 [-o out_file.h5] [--clobber]
h5jam -h
h5unjam -i in_file.h5
[-u user_block | --delete] [
-o out_file.h5]
h5unjam -h
h5jam
concatenates a user_block
file and an HDF5 file to create an HDF5 file with a user block.
The user block can be either binary or text.
The output file is padded so that the HDF5 header begins on
byte 512, 1024, etc.. (See the HDF5 File Format.)
If out_file.h5
is given, a new file is created with the user_block
followed by the contents of in_file.h5.
In this case, infile.h5
is unchanged.
If out_file.h5
is not specified, the user_block
is added to in_file.h5
.
If in_file.h5 already has a user block, the contents of user_block
will be added to the end of the existing user block, and the file shifted to the next boundary. If -clobber
is set, any existing user block will be overwritten.
h5unjam
splits an HDF5 file, writing the
user block to a file or stdout and the HDF5 file to an HDF5 file with a header at byte
0 (i.e., with no user block).
If out_file.h5
is given, a new file is created with the in_file.h5
without the user block.
In this case, infile.h5
is unchanged.
If out_file.h5
is not specified, the user_block
is removed and in_file.h5
is rewritten, starting at byte 0.
If user_block
is set,the user block will be written to user_block
. If user_block
is not set, the user block (if any) will be written to stdout. If
-delete
is selected, the user block will not be not written.
newfile.h5
, with the text in file mytext.txt
as the user block for the HDF5 file file.h5
.
h5jam -u mytext.txt -i file.h5 -o newfile.h5Add text in file
mytext.txt
to front of HDF5 dataset, file.h5
.
h5jam -u mytext.txt -i file.h5Overwrite the user block (if any) in
file.h5
with the contents of mytext.txt
.
h5jam -u mytext.txt -i file.h5 --clobberFor an HDF5 file,
with_ub.h5
, with a user block, extract the user block to user_block.txt
and the HDF5 file to wo_ub.h5
.
h5unjam -i with_ub.h5 -u user_block.txt -o wo_ub.h5
0 | Succeeded. |
>0 | An error occurred. |
The most efficient way to create a user block is to create the file
with a user block (see H5Pset_user_block
), and write
the user block data into that space from a program.
The user block is completely opaque to the HDF5 library and to the h5jam and h5unjam tools. The user block is simply read or written as a string of bytes, which could be text or any kind of binary data. It is up to the user to know what the contents of the user block means and how to process it.
When the user block is extracted, all the data is written to the output, including any padding or unwritten data.
This tool moves the HDF5 file through byte copies, i.e., it does not read or interpret the HDF5 objects.
h5check
[OPTIONS]
file
H5check
is a validation tool designed to verify that an HDF5 file is encoded
according to the HDF5 File Format
Specification. The purpose is to ensure data model integrity and
long-term compatibility between evolving versions of the HDF5 Library.
Independent Verification Tool:
Note that H5check
is designed to operate independently of the
HDF5 Library:
H5check
is distributed separately; see
“HDF5
Tools and Software.”
h5check
scans through the encoded content,
verifying it against the defined library format.
If it finds any non-compliance, h5check
prints the error and
the reason behind the non-compliance; if possible, it continues the scanning.
If h5check
does not find any non-compliance, it prints an
approval statement upon completion.
By default, the file is verified against the latest version of the
file format; as of this writing, that is the format recognized by the
HDF5 Release 1.8.x series. A format version can be explicitly specified
with the -fn
(or --format=n
) option.
For example, -f16
(or --format=16
) would specify
verification against the format recognized by the HDF5 Release 1.6.x series.
-h, --help
-V, --version
-vn, --verbose n
n=0
| Terse | Indicate only whether file is compliant. |
n=1
| Normal | Print progress and all errors found. (Default) |
n=2
| Verbose | Print all known information; usually used for debugging. |
-fn, --format n
n=16
| Validate according to HDF5 Release 1.6.x series. |
n=18
| Validate according to HDF5 Release 1.8.x series. (Default) |
-oa, --object a
a
is the address of the object header to be validated.
0
| Succeeded. |
1
| Command failures, such as argument errors. |
2
| Format compliance errors found. |
Release | Change |
1.8.5 | Tool first distributed shortly before this release. |
h5redeploy
[help
| -help
]
h5redeploy
[-echo
]
[-force
]
[-prefix=
dir]
[-tool=
tool]
[-show
]
h5redeploy
updates the HDF5 compiler tools after
the HDF5 software has been installed in a new location.
help
, -help
-echo
-force
-prefix=
dir
lib/
and
include/
.-tool=
tool
h5cc
)
-show
Release | Command Line Tool |
1.6.0 | Tool introduced in this release. |
h5cc
[
OPTIONS ]
compile_line
h5pcc
[
OPTIONS ]
compile_line
h5cc
and h5pcc
can be used in much
the same way as mpicc
by MPICH is used to compile
an HDF5 program.
These tools take care of specifying on the command line
the locations of the HDF5 header files and libraries.
h5cc
is for use in serial computing environments;
h5pcc
is for parallel environments.
h5cc
and h5pcc
subsume all other
compiler scripts in that if you have used a set of scripts to compile
the HDF5 library, then h5cc
and h5pcc
also use those scripts.
For example, when compiling an MPICH program, you use the
mpicc
script.
If you have built HDF5 using MPICH, then h5cc
uses the MPICH program for compilation.
Some programs use HDF5 in only a few modules.
It is not necessary to use h5cc
or h5pcc
to compile those modules which do not use HDF5.
In fact, since h5cc
and h5pcc
are only
convenience scripts, you can still compile HDF5 modules in the
normal manner, though you will have to specify the HDF5 libraries
and include paths yourself.
Use the -show
option to see the details.
An example of how to use h5cc
to compile the program
hdf_prog
, which consists of the modules
prog1.c
and prog2.c
and uses the HDF5
shared library, would be as follows.
h5pcc
is used in an identical manner.
# h5cc -c prog1.c # h5cc -c prog2.c # h5cc -shlib -o hdf_prog prog1.o prog2.o
-help
-echo
-prefix=DIR
DIR
to find the HDF5
lib/
and include/
subdirectories.
-show
-shlib
-noshlib
h5cc
and h5pcc
use the
same compiler you used to compile HDF5;
check your compiler's manual for more information
on which options are needed.
h5cc
and h5pcc
defaults.
HDF5_CC
HDF5_CLINKER
HDF5_USE_SHLIB=[yes|no]
h5fc
[
OPTIONS ]
compile_line
h5pfc
[
OPTIONS ]
compile_line
h5fc
and h5pfc
can be used in much the
same way mpif90
by MPICH is used to compile
an HDF5 program.
These tools take care of specifying on the command line
the locations of the HDF5 header files and libraries.
h5fc
is for use in serial computing environments;
h5pfc
is for parallel environments.
h5fc
and h5pfc
subsume all other
compiler scripts in that if you have used a set of scripts to compile
the HDF5 Fortran library, then h5fc
and h5pfc
also use those scripts. For example, when
compiling an MPICH program, you use the mpif90
script. If you have built HDF5 using MPICH, then h5fc
uses the MPICH program for compilation.
Some programs use HDF5 in only a few modules. It is not necessary
to use h5fc
and h5pfc
to compile those
modules which do not use HDF5.
In fact, since h5fc
and h5pfc
are only
convenience scripts, you can still compile HDF5 Fortran modules in
the normal manner, though you will have to specify the
HDF5 libraries and include paths yourself.
Use the -show
option to see the details.
An example of how to use h5fc
to compile the program
hdf_prog
, which consists of the modules
prog1.f90
and prog2.f90
and uses the HDF5 Fortran library, would be as follows.
h5pfc
is used in an identical manner.
# h5fc -c prog1.f90 # h5fc -c prog2.f90 # h5fc -o hdf_prog prog1.o prog2.o
-help
-echo
-prefix=DIR
DIR
to find HDF5
lib/
and include/
subdirectories.
-show
h5fc
and h5pfc
use the
same compiler you used to compile HDF5;
check your compiler's manual for more information
on which options are needed.
h5fc
and h5pfc
defaults.
HDF5_FC
HDF5_FLINKER
Release | Command Line Tool |
1.6.0 | Tool introduced in this release. |
h5c++
[
OPTIONS]
<compile line>
h5c++
can be used in much the same way
mpiCC
by MPICH is used to compile an HDF5 program.
It takes care of specifying where the
HDF5 header files and libraries are on the command line.
h5c++
subsumes all other compiler scripts in that
if you've used one set of compiler scripts to compile the
HDF5 C++ library, then h5c++
uses those same scripts.
For example, when compiling an MPICH program,
you use the mpiCC
script.
Some programs use HDF5 in only a few modules. It isn't necessary
to use h5c++
to compile those modules which don't use
HDF5. In fact, since h5c++
is only a convenience
script, you are still able to compile HDF5 C++ modules in the
normal way. In that case, you will have to specify the HDF5 libraries
and include paths yourself.
Use the -show
option to see the details.
An example of how to use h5c++
to compile the program
hdf_prog
, which consists of modules
prog1.cpp
and prog2.cpp
and uses the HDF5 C++ library, would be as follows:
# h5c++ -c prog1.cpp # h5c++ -c prog2.cpp # h5c++ -o hdf_prog prog1.o prog2.o
-help
-echo
-prefix=DIR
DIR
to find HDF5
lib/
and include/
subdirectories
-show
h5c++
uses the same compiler you used
to compile HDF5. Check your compiler's manual for
more information on which options are needed.
h5c++
.
HDF5_CXX
HDF5_CXXLINKER
Release | Command Line Tool |
1.6.0 | Tool introduced in this release. |
HDF5 documents and links Introduction to HDF5 HDF5 User Guide |
And in this document, the
HDF5 Reference Manual H5 H5A H5D H5E H5F H5G H5I H5P H5R H5S H5T H5Z Tools Datatypes Collective Calls in Parallel |
(PDF of complete manual formatted as print volume) |