H5CPP

the first non-intrusive persistence

for modern C++

Created by Steven Varga in co-operation with Gerd Heber, HDFGroup

Online version of this presentation: http://chicago.h5cpp.ca

The first non-intrusive persistence for modern C++

  • Support for Objects: The STL, 7 popular Linear Algebra Systems arbitrarily deep POD struct, arrays, raw pointers...
  • True usability / flexibility trade-off
  • Can start with zero HDF5 knowledge
  • Zero overhead over HDF5 CAPI

templates: create | write | read | append


h5::fd_t fd = h5::create("example.h5",H5F_ACC_TRUNC);
std::vector vec = h5::utils::get_test_data(20);
h5::write(fd, "path/to/object",  vec,
    h5::current_dims{100},  h5::max_dims{H5S_UNLIMITED},
    h5::offset{3}, h5::block{2}, h5::stride{2},
    h5::chunk{20} | h5::gzip{9} );

RAII idiom for file,dataset,property descriptors

Fundamental,POD struct or arrays of them

The object is marked with h5::write template call

type-safe arguments in any order

how is it done?

  • template meta-programming for piecewise construction of functions
  • file|dataset|property descriptors are binary compatible with CAPI: interop governed by conversion policy
  • no virtual tables: Curiously Recurrent Templates - static polymorphism

Compiler

what does it do

  • LLVM7.0.0 based parser generates the AST of the TU Translation Unit
  • objects marked/painted with the operators are identified,
  • topological reordering of dependency graph
  • elimination
  • code generation: HDF5 Data Description Language
  • include the generated header file into your TU translation unit
  • second stage: invoke your favourite compiler: intel, gcc, cray, ibm, pg, ...

Goodies

  • H5CPP.CA
  • LIVE DEMO: http://h5cpp.ca/cgi/redirect.py
  • ami-38726547

The first non-intrusive persistence for modern C++

  • Support for Objects: The STL, 7 popular Linear Algebra Systems arbitrarily deep POD struct, arrays, raw pointers...
  • True usability / flexibility trade-off
  • Can start with zero HDF5 knowledge
  • Zero overhead over HDF5 CAPI