Category:HDF5 support

From VASP Wiki
Revision as of 14:53, 20 October 2023 by Miranda.henrique (talk | contribs) (Created page with "Since VASP 6.2.0 we started supporting the feature of reading and writing hdf5 files. The HDF5 file format {{cite|hdf5format:web}} is a hierarchical data file designed to stor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Since VASP 6.2.0 we started supporting the feature of reading and writing hdf5 files. The HDF5 file format [1] is a hierarchical data file designed to store large amounts of numeric data. This file format combines the flexibility and hierarchy of an XML file with the speed and size economy of binary files. The writing and reading of hdf5 files are handled by the HDF5 library which is written in C but wrappers for Fortran, python, and C++ are available.

Currently, VASP accepts the following HDF5 files:

Filename Usage
vaspin.h5 Contains the necessary inputs to start the calculation instead of INCAR, POSCAR, POTCAR and KPOINTS
vaspout.h5 Contains the outputs of the VASP calculation
vaspwave.h5 Contains the wavefunctions when LWAVEH5=.TRUE. and charge density LCHARGH5=.TRUE.

To enable the reading and writing of these files, VASP should be compiled with HDF5 support active. This is done by modifying the makefile.include accordingly.

As of VASP 6.2.0 we only support reading/writing of hdf5 files in serial mode. For extracting data from the vaspout.h5 file we strongly recommend using the py4vasp package.

Command line tools

The HDF5 library ships with a series of command-line tools that can be used to quickly inspect the contents of any HDF5 file.

In particular h5ls outputs the hierarchy of groups and datasets. It is useful to check which data is present in the file. For example:

$ h5ls vaspout.h5
input                    Group
intermediate             Group
original                 Group
results                  Group
version                  Group

Adding the -r modifier lists the contents of the groups recursively, giving an overview of the data contained in the file.

Another very useful tool is the h5dump command that with the -d variable_name argument outputs the contents of the variable to the screen. For example:

$ h5dump -d /intermediate/ion_dynamics/energies vaspout.h5
HDF5 "vaspout.h5" {
DATASET "/intermediate/ion_dynamics/energies" {
   DATATYPE  H5T_IEEE_F64LE
   DATASPACE  SIMPLE { ( 1, 3 ) / ( H5S_UNLIMITED, 3 ) }
   DATA {
   (0,0): -11.8515, -11.8515, -11.8515
   }
}
}

The meaning of each of the energy values can be printed by replacing energies by energies_tags in the command above. For a complete list of HDF5 tools, the user is referred to the official HDF5 documentation [2].

References

Pages in category "HDF5 support"

The following 3 pages are in this category, out of 3 total.