SLURM may be built with HDF5, then used for profiling as outlined here. This requires SLURM compiled with HDF5, and is the optional but not the general usage pattern for the HDF5 libraries on a cluster.
Depending on your filesystem setup you have options:
parallel FS: HDF5 should be compiled with parallel support: ./configure --enable-parallel and here is a A Brief Introduction to Parallel HDF5 by Quincey Koziol & Scot Breitenfeld (171 slides). This approach gives option to collective IO, where all processes can write into the same dataset concurrently.
POSIX serial FS: this is the default setting with configure, each process must have separate file to write at a time.
The advantage of parallel FS over regular POSIX FS such as EXT4 are: aggregated bandwidth, collective IO where you can write into single dataset resulting in a cleaner code.