Expand description
Asynchronous observation archive over a ConCorpus.
Active-learning consumers (GP surrogates pruning their training sets) need a durable record of every configuration an expensive oracle evaluated: the active set is a view, the archive is the ledger. This module owns that contract once, behind a C ABI, so every consumer shares one implementation instead of re-deriving frame serialization, threading, and read-back ordering.
Writes follow the async-logger shape: ObservationArchive::append
copies the row into a channel and returns; a dedicated writer
thread drains the channel and commits each row as a single-frame
trajectory built natively with ConFrameBuilder (no temporary
files, no serialization on the caller thread). Disk-side failures
are counted, never raised into the caller. Readers synchronize with
ObservationArchive::flush; LMDB’s MVCC makes the read snapshot
safe against the concurrent writer.
Atom ordering: CON groups atoms by type, so stored frames are a
permutation of the caller’s order. ObservationArchive::fetch
inverts that permutation through the stored atom_ids and returns
rows in the caller’s original order — the property a training-set
consumer actually needs.
Structs§
- Observation
Archive - Fixed-composition archive of oracle evaluations.
Functions§
- rkrdb_
archive_ ⚠append - Enqueue one evaluation: flat
3 * natomsposition and force buffers in caller order plus the total energy. Non-blocking; disk failures are counted viarkrdb_archive_dropped. - rkrdb_
archive_ ⚠appended - Rows accepted by append, including any still queued (prior runs included). Key cache refreshes on this; fetch bounds on rkrdb_archive_count after a flush.
- rkrdb_
archive_ ⚠close - Drain the writer, close the corpus, release the handle.
- rkrdb_
archive_ ⚠count - Rows committed to the corpus (including prior runs).
- rkrdb_
archive_ ⚠dropped - Rows the writer thread could not persist.
- rkrdb_
archive_ ⚠fetch - Fetch committed row
indexin the caller’s original atom order.positionsandforcesreceive3 * natomsdoubles;out_energythe total energy. Flush first for a complete snapshot. - rkrdb_
archive_ ⚠flush - Block until every enqueued row is committed or counted dropped.
- rkrdb_
archive_ ⚠open - Open (or create) an observation archive at
dirfor a fixed composition:zis the per-atom atomic-number list in caller order (natomsentries),cell3the three orthorhombic box lengths. Writes the opaque handle toout_id.