Repository navigation
Archive modes: one writer with switches, four named modes, a serial HDF5 driver, the log in the document (C1) - #98
Merged
Merged
Conversation
…DF5 driver, the log in the document (C1.2, C1.4, C1 modes)
AR_base takes mode=, incremental=, driver=, includeLog= and inline=; a
mode names a combination of the switches and an explicit switch wins:
without-a-net incremental off: the .h5 alone during the run, the .ymf
derived at close (and again by gatherTimes: the net)
split the default: the .h5 and a .ymf current at every step
kitchen-sink split, plus the run's log and provenance in the .ymf
ymf-only no .h5: the arrays are copied into the document
driver="serial" opens one .h5 on master alone; the other ranks gather
their arrays to it (create_dataset_sync assembles the owned slices,
create_dataset_async the per-rank arrays). It needs no parallel HDF5
and writes the file the mpio driver writes, byte for byte in the
datasets; it cannot be hot started on several ranks, and says so. The
writers test ar.writesDatasets rather than ar.hdfFile, which is None
on the ranks that hold no file.
includeLog puts the run's log under extra: proteus in the document at
close; every document now carries proteus's version, the command line,
the rank count and the mode there, from the first step's header on, so
a killed run's document says what wrote it.
inline keeps the arrays on master by dataset name and, at every sync,
replaces each reference in the step's grids with the values; the
document is built a step at a time and appended like any other, with
no file beside it.
parun: --archive-mode and --archive-driver; NumericalSolution passes
them through. 13 new tests, including the serial driver against the
mpio driver at 1-3 ranks and both layouts, and without-a-net's
document rebuilt from the .h5 byte for byte.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… leave equal documents pro run and parun of the same model are compared byte for byte, and the command line is the one thing about them that differs. The version, the rank count and the mode are what two runs of one computation share; the command line joins the log under includeLog (kitchen-sink), where the document is meant to say everything. The write_field stub names its driver and inline switches, which writesDatasets reads. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C1: the archive modes, as four modes of one writer
Stacked on #97 (retire XDMF); needs cekees/ymf#20 merged first, as #97 does.
The decision recorded in the roster (2026-10-23): C1's four pathways are four modes of one writer, and the modes are combinations of switches. This PR adds the switches to
AR_base, names the modes, and covers the combinations..ymf.ymfwithout-a-netsplit(default)kitchen-sinkymf-onlyA switch given explicitly (
incremental=,driver=,document=,includeLog=,inline=) wins over the mode.parunandpro runtake--archive-mode,--archive-driverand--archive-document;RunOptionscarries them andNumericalSolutionpasses them through.The drivers and the document layouts (C1.4, both halves)
driver="serial": one.h5that master alone opens; the other ranks gather their arrays to it. Needs no parallel HDF5 and writes the file the mpio driver writes: the datasets agree byte for byte at 1, 2 and 3 ranks in both dataset layouts. Cannot be hot started on several ranks, and refuses to.driver="per-rank": every rank writes its own<name>_p<rank>.h5with plain HDF5 and no communication. Per-rank files hold per-rank datasets, so this driver turnsglobal_syncoff (and says so in the log). With it,documentchooses where the grids are described:"global"(the roster's layout B): one<name>.ymfwhose every step is a spatial collection of the ranks' grids, each referencing its own rank's file; master gathers the grids and writes its file's metadata table, soreadArchiveDomain(name)andgatherTimesrebuild the document from master's file alone."per-rank"(layout C): one<name>_p<rank>.ymfper rank, each step a single grid, each rank appending its own document with no collective step and no single point of failure.ar.writesDatasetsinstead ofar.hdfFile is not None, which is wrong on the ranks that hold no file.The rest
includeLog(C1.2): the run's log goes underextra: proteusin the document at close, with its file name and the command line. Every document, in every mode, carries proteus's version, the rank count, the mode and the driver (and the rank, for a per-rank document) from the first step's header on, so a killed run's document already says what wrote it. The command line is kitchen-sink only, on purpose: two runs of the same computation (pro runandparun, which a test compares byte for byte) leave identical documents.inline(ymf-only): master keeps the arrays by dataset name and at every sync replaces each reference in the step's grids with the values; the document is built a step at a time and appended like the others. A reference with no values behind it is refused.without-a-netis named and tested: no.ymfexists until close, and the document close writes equals, byte for byte, the onereadArchiveDomainrebuilds from the.h5.sync()took its two barriers only on ranks holding the file.Covering the combinations
check_archiveintest_archive_parallel_metadata.pyis the integrity check every layout goes through: each document the run left validates; each collection has its two steps in the expected shape (one grid, or one per rank); every data item names a dataset that exists in the file it says, with the dimensions it declares (load_arrayon each); the files on disk are exactly the expected ones; and a per-rank-file global document is rebuilt from master's file. It runs over the single-file drivers × both dataset layouts × 1–3 ranks (12 runs) and the per-rank driver × both document layouts × 1–3 ranks (6 runs), plus the per-rank hot start, the per-rank running documents, the serial driver's datasets against mpio's, the modes and the invalid combinations refused by name.pro run --archive-mode kitchen-sink --archive-driver serialis checked end to end. The file is 83 tests.🤖 Generated with Claude Code