{
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17",
  "slug": "hdf5-swmr",
  "term": "HDF5 SWMR",
  "aliases": [
    "HDF5 single-writer/multiple-reader"
  ],
  "definition": "HDF5 SWMR is an access mode that permits one writer and multiple readers to use an HDF5 file with ordered metadata flushing under the required filesystem semantics.",
  "note": "Mechanism: metadata flush dependencies prevent readers following references to unflushed child structures. This requires compatible POSIX write semantics. [swmr-design]\n\nReader protocol: h5py writers flush datasets and readers refresh them; notifications are separate. Objects are created before switching to SWMR. [h5py-swmr]\n\nApplication boundary: Hesela observed unequal lengths in two readable arrays, and showed that a publication count does not prevent mutation of previously published values. This was a paused-writer observation, not a crash or power-loss test. [hesela-swmr]\n\nMetadata retries: HDF5 can retry inconsistent checksummed metadata reads under a bounded attempt policy. The retry information API describes library metadata reads, not NAND recovery counters or device-failure rates; the linked Hesela experiment does not measure retries. [h5-retries]\n\nProcess-exit boundary: a separate post-flush experiment retained write/SWMR status flags after os._exit. Ordinary opens were rejected while SWMR reads worked; readable but unpublished payloads still selected no pairs. This is not power-loss evidence, and status flags do not establish whether a writer is alive. [hesela-exit] [h5-flags]",
  "related": [
    "hdf5",
    "crash-consistency",
    "advisory-file-lock"
  ],
  "advantages": [],
  "limitations": [
    {
      "text": "The documented SWMR scope forbids adding or deleting objects while SWMR writing is active; plan groups, datasets and attributes before switching modes.",
      "citationIds": [
        "swmr-design",
        "h5py-swmr"
      ]
    },
    {
      "text": "The HDF Group's cited scope excludes modification or append operations on variable-length, string and region-reference datatypes.",
      "citationIds": [
        "swmr-design"
      ]
    },
    {
      "text": "Correct SWMR behavior requires the documented POSIX write semantics; an HDF5-readable path alone does not establish filesystem suitability.",
      "citationIds": [
        "swmr-design",
        "h5py-swmr"
      ]
    },
    {
      "text": "Reader visibility is not a cross-dataset transaction or proof of recovery after power loss; the measured example assumes immutable published rows.",
      "citationIds": [
        "hesela-swmr"
      ]
    }
  ],
  "citations": [
    {
      "id": "h5py-swmr",
      "title": "h5py 3.15: Single Writer Multiple Reader",
      "url": "https://docs.h5py.org/en/3.15.0/swmr.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "swmr-design",
      "title": "The HDF Group: SWMR metadata flush dependencies",
      "url": "https://support.hdfgroup.org/releases/hdf5/2.2.0/documentation/hdf5-2.2.0.doxygen/_s_w_m_r_t_n.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-swmr",
      "title": "HDF5 SWMR: a readable file is not a complete measurement",
      "url": "https://hesela.com/analyses/hdf5-swmr-application-consistency/",
      "accessed": "2026-10-17"
    },
    {
      "id": "h5-retries",
      "title": "The HDF Group: H5Fget_metadata_read_retry_info and metadata read attempts",
      "url": "https://portal.hdfgroup.org/documentation/hdf5/latest/group___s_w_m_r.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-exit",
      "title": "Hesela: HDF5 process-exit observations",
      "url": "https://hesela.com/analyses/hdf5-swmr-application-consistency/#process-exit",
      "accessed": "2026-10-17"
    },
    {
      "id": "h5-flags",
      "title": "The HDF Group: File locking and superblock status",
      "url": "https://support.hdfgroup.org/documentation/hdf5/latest/_file_lock.html",
      "accessed": "2026-10-17"
    }
  ],
  "provenance": [
    "Documentation scope: h5py 3.15 and the cited HDF5 2.2.0 technical note. Hesela's observations used h5py 3.15.0 with HDF5 1.14.6; restrictions on other datatypes were documented, not experimentally tested."
  ]
}
