Docs · I/O adapters

I/O adapters.

The I/O adapters let an application that uses POSIX, STDIO, MPI-IO, HDF5 or ADIOS2 store its data in the Context Transfer Engine without changing its I/O code. They come from source builds, with Spack or CMake; the pip wheel and conda do not include them, and the Docker image has only the HDF5 VOL connector and the ADIOS2 engine.

Adapters
POSIX, STDIO, MPI-IO, HDF5 VOL, HDF5 VFD, ADIOS2
Source
context-transfer-engine/adapter/
Install
Spack or a CMake source build
Needs
A running clio-run runtime

The adapters

AdapterMechanismWhere the data livesLibraryCMake option
POSIXLD_PRELOAD interception of open, read, write, stat and friendsOnly in the CTE (clio-fs)libclio_cte_posix.soCLIO_CTE_ENABLE_POSIX_ADAPTER + CLIO_CORE_ENABLE_ELF
STDIOLD_PRELOAD interception of fopen, fread, fwrite and friendsOnly in the CTE (clio-fs)libclio_cte_stdio.soCLIO_CTE_ENABLE_STDIO_ADAPTER + CLIO_CORE_ENABLE_ELF
MPI-IOLD_PRELOAD interception of MPI_File_*Only in the CTE (clio-fs)libclio_cte_mpiio.soCLIO_CTE_ENABLE_MPIIO_ADAPTER + CLIO_CORE_ENABLE_ELF
HDF5 VOLHDF5 VOL connector clio, above the HDF5 libraryNative file first; dataset images cached in the CTElibclio_hdf5_vol.soCLIO_CTE_ENABLE_HDF5_VOL
HDF5 VFDHDF5 virtual file driver clio_vfd, below the HDF5 libraryNative file first; byte ranges optionally cached in the CTElibclio_vfd.soCLIO_CTE_ENABLE_VFD
ADIOS2ADIOS2 plugin engineOnly in the CTE: one blob per variable, step and ranklibiowarp_engine.soCLIO_CTE_ENABLE_ADIOS2_ADAPTER

The install page has the exact configure lines, dependencies and output paths.

Source builds

pip install iowarp-core, the conda packages and the .deb/.rpm/AppImage/Windows packages contain none of these libraries, and the Docker image has only the HDF5 VOL connector and the ADIOS2 engine. Build CLIO Core from source with Spack (each adapter is a variant) or with CMake and the options above; see Install.

Two designs

The adapters fall into two groups that treat the CTE very differently.

  • The CTE is the only home of the data. The POSIX, STDIO and MPI-IO interceptors hand a file to the filesystem module (clio_cte_filesystem), the same module behind Context FS. Nothing is written to the path on the host's own filesystem. The ADIOS2 engine writes blobs straight into a CTE tag. How durable the data is depends on the tiers the runtime composes.
  • The CTE is a cache. The HDF5 VOL connector and VFD write every byte to an ordinary HDF5 file first, synchronously. h5dump, h5py and every other tool read that file with or without CLIO. The cache can be lost or dropped at any time without losing data.

The clio:: path marker

The three interceptors take over a file only when its path contains a component that starts with clio::. The marker is removed, and the rest is the file's path in the clio-fs namespace:

The application opensIntercepted?clio-fs path
clio::/data/run1/out.binYes/data/run1/out.bin
/scratch/clio::run1/out.binYes/scratch/run1/out.bin
/scratch/run1/out.binNo: passed to the real librarynone

So the interceptors need a path you can choose: a command-line argument, an input deck, an environment variable. The HDF5 VFD is the opposite: it takes plain paths and refuses clio:: names. The VOL connector and ADIOS2 engine do not look at the marker.

What every adapter needs at run time

  1. A runtime

    Start one with clio-run start. The adapters attach to it as clients; the runtime reads CLIO_SERVER_CONF (default ~/.clio/clio.yaml), and so does every client.

  2. The right pools

    The interceptors need a clio_cte_filesystem pool, which the default configuration composes at 560.0. The HDF5 connectors and the ADIOS2 engine need a clio_cte_core pool; the HDF5 quickstart config names it clio_cte_core, the name clients look it up by. See the configuration reference.

  3. The adapter loaded

    LD_PRELOAD for an interceptor, HDF5_PLUGIN_PATH plus a selector for HDF5, ADIOS2_PLUGIN_PATH plus the plugin engine for ADIOS2. Each adapter page shows the exact lines.

Other adapters in the tree

The adapter directory holds a few more components. They are documented elsewhere or are not general-purpose I/O adapters:

  • FUSE (adapter/libfuse, option CLIO_CTE_ENABLE_FUSE_ADAPTER): the clio_cte_fuse daemon that mounts the clio-fs namespace as a directory. See Context FS.
  • Paged vectors (adapter/cpu_vector, adapter/gpu_vector): arrays larger than host or GPU memory whose pages are CTE blobs. See Memory expansion.
  • cuFile (GDS) interceptor (adapter/nvidia_gds, option CLIO_CTE_ENABLE_NVIDIA_GDS_ADAPTER, needs CLIO_CORE_ENABLE_CUDA=ON and ELF): libclio_cte_nvidia_gds.so replaces cuFileRead and cuFileWrite with a copy through a host buffer and pread/pwrite, so that with the POSIX interceptor also preloaded a clio:: path reaches the CTE. It is a compatibility shim, not GPU-direct I/O. Batch I/O goes to the real cuFile library unchanged.
  • kvhdf5 (adapter/kvhdf5, built when CLIO_CORE_ENABLE_CUDA=ON): a header-only, HDF5-like dataset API for CUDA kernels over the CTE. It is a GPU programming interface, not an adapter for existing HDF5 code.
  • mapper: an internal header used by the adapters, with no user-facing interface.

Where to go next