HDF5

General Information

Home pageVersionsModule dependencies
CompilerMPT
www.hdfgroup.org1.8.7intelcomp/12.0.5.220mpt/2.06
1.8.9intelcomp/12.0.5.220mpt/2.06
1.8.11intelcomp/13.0.1mpt/2.06
1.8.12intelcomp/14.0.1mpt/2.09
1.8.14intelcomp/15.0.1mpt/2.10
1.8.16intelcomp/16.0.1mpt/2.13
1.8.17intelcomp/16.0.1mpt/2.14
1.8.18intelcomp/17.0.1mpt/2.14

Usage on Vilje

Load one of the hdf5, and the corresponding intel compiler and mpt modules to use HDF5 on Vilje, e.g.:

$ module load intelcomp/16.0.1 mpt/2.13 hdf5/1.8.16

Use the HDF5 wrapper scripts when compiling:

$ h5pcc hdf5_test.c             # C code
$ h5pfc hdf5_test.f90           # Fortran code

Notice, the HDF5 installations on Vilje include both static and shared libraries. By default, the HDF5 wrappers will compile with static libraries. If you want shared libraries, add the -shlib option when compiling, e.g.:

$ h5pfc -shlib hdf5_test.f90    # Fortran code, shared HDF5 libraries

PyTables

VersionsModule dependencies
HDF5Python
2.4.0hdf5/1.8.11python/2.7.3
3.0.0hdf5/1.8.12python/2.7.6
3.2.0hdf5/1.8.16python/2.7.11
3.2.0hdf5/1.8.18python/2.7.13

PyTables is a Python package built on top of the HDF5 library for managing hierarchical datasets and designed  to efficiently and easily cope with large amounts of data. PyTables is available when loading one of the hdf5/1.8.11 or hdf5/1.8.12 modules, and the corresponding python module.

For example, create a HDF5 file from python:

$ module load intelcomp/13.0.1 mpt/2.06 hdf5/1.8.11
$ module load python/2.7.3
$ python
>>> from numpy import *
>>> from tables import *
>>> fileh = open_file("test.h5", mode = "w", title="Testing")
>>> root = fileh.root
>>> a = array([1, 2, 4], int32)
>>> hdfarray = fileh.create_array(root, 'array', a, "Integer array")
>>> fileh.close()
>>> exit()

Check the output file with the HDF5 h5ls utility:

$ h5ls -d test.h5
array                    Dataset {3}
    Data:
        (0) 1, 2, 4

h5py

VersionsModule dependencies
HDF5Python
2.3.1hdf5/1.8.11python/2.7.3
2.4.0hdf5/1.8.14python/2.7.9
2.6.0hdf5/1.8.16python/2.7.11
2.6.0hdf5/1.8.18python/2.7.13

The h5py package is a Pythonic interface to the HDF5 binary data format.

Further Information

Scroll to Top