Miscellaneous Example Programs
Most of these examples resulted from working with users,
and have only been tried on one or two platforms.
They are not considered "model" examples of code.
Attributes:
Datasets:
- Compressed with zlib compression: h5zip.c
- Compressed with szip compression: h5szip.c
- Datatypes - Datasets with different datatypes
- Dynamic arrays for reading/writing data:
- External Datasets:
h5_crtextd.c
extern.c
h5extt.c
- Moving a Dataset
- Read in data in exponential form that is of type double,
and write out to an HDF5 file:
crtc64.c
coordinates.txt - Text file read in
- Reading in data from text file (originally an
HDF 4.x raster image, dumped with hdp), and write
that out as an HDF5 file:
h5_ri.c
storm110.txt - Text file
- Read in floating point data from a text file
and write that out as an HDF5 file:
h5float.c
float.txt - Text file
- Split Files: create a dataset in which the data is in
a separate directory from the metadata:
h5dirsplit.c
- Unlimited Dimension Dataset (loop by slabs):
appslab.c
uslab.c - Similar to appslab.c, but uses H5Pset_buffer
- Write to Finite Dimension Dataset by slabs:
wrtslab.c
- Writing to 4D dataset by slab and how can have performance issue:
h5pmem.c
Dataspaces:
- How to use selections in memory and file dataspaces (see H5Dwrite in RM):
h5_write_sel.c
Datatypes:
File:
Groups:
Identifiers: (H5I)
Parallel:
- If you are having problems building/using Parallel HDF5, here are
some handy sample programs that you can run to be sure that MPI I/O
is installed properly on your machine for use with HDF5:
Sample MPI programs
- The following examples show how to write data collectively and
independently when one process doesn't have data or does not need to write
data.
- coll_test.c - Uses H5Sset_none to tell
H5Dwrite call that there will be no data. 4-th process HAS to participate
since we are in a collective mode.
- ind_test.c - Specifies which process writes data. H5Dwrite is not called by
the 4-th process at all in this case; this approach will work only when
independent mode is used.
Properties: (H5P)
- h5close.c - Using the File Close Degree Property
References:
- h5ref.c - How to get information about a
dereferenced object.
- h5ref2d.c - call H5Sget_select_hyper_blocklist
for 2D dataset
- h5ref3d.c - call H5Sget_select_hyper_blocklist
for 3D dataset
Selections:
These are example programs that you can use to experiment with
hyperslab selections for simple 1 and 2-Dimensional Datasets:
Last Modified: February 15, 2007