mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Adds HDF5Examples/C/H5PAR/ph5_comm_split.c, showing parallel HDF5 use on a communicator produced by MPI_Comm_split rather than on MPI_COMM_WORLD. The example splits MPI_COMM_WORLD by rank parity. The even ranks form a writer group that collectively creates a dataset with one row per writer rank, then reopens the file read-only on the same sub-communicator and verifies what it wrote. The odd ranks stand in for a group with other responsibilities and make no HDF5 calls at all. The comments cover the two rules this pattern depends on: MPI_Comm_split is collective over the parent communicator, so every rank must call it even if it never opens the file; and once a file is opened with a FAPL carrying a sub-communicator, every collective HDF5 call on that file is collective over that sub-communicator alone. The example runs with any number of MPI ranks.