Docs · Context Assimilation Engine
Inside the assimilation engine.
The CAE is a runtime module that copies, or lazily maps, outside data into CTE tags. Its work is done by assimilators, one class per kind of source, chosen by the source URL. This page names the pieces and follows a transfer through them.
- Module
- clio_cae_core (pool 400.0)
- Methods
- ParseOmni, ImportData (HDF5), ExportData, ProcessHdf5Dataset, plus CTE forwarding
- Fault I/O threads
- CLIO_CAE_REF_IO_THREADS (32)
The pieces
A transfer, step by step
- Load. The
clio-caetool's OMNI loader reads the YAML, expands each entry into an assimilation context (source, destination, format, range, dataset filters, credentials) and submits the list as oneParseOmnitask. The CEE and the language clients build the same contexts directly. - Choose. In the runtime, the core asks the assimilator factory for the class that handles each source's scheme.
- Assimilate. The assimilator's schedule coroutine reads the source and puts blobs into the destination tag through the CTE client: a
descriptionblob plus 1 MiBchunk_Nblobs for files and objects, one tag per dataset for HDF5, one blob for a string. Puts go to the CAE'snext_pool_id, so imports pass the cache, indexer and replication like any other write. The HTTP(S) and Globus assimilators are the exception: they download to afile::path (or, for Globus, another endpoint), not into a tag. - Finish. Transfers run in order, each completing before the next starts, and the task returns one status.
Assimilators
An assimilator is a C++ class implementing a small base interface. Besides scheduling a whole transfer, it can optionally produce the bytes of one destination blob on request (for ingest on fault) and describe the source's page layout (for pagify). The shipped ones cover local files, inline strings, HDF5, HTTP and HTTPS, S3 (with a pooled keep-alive connection set and forwarded credentials, since the daemon does not inherit the client's environment), Google Cloud Storage and Globus. Of these, only the local-file assimilator implements per-blob reads, so only file:: sources can be ingested on fault. Extending the CAE adds a new one.
Where each source lands
hdf5_vol stages the file in
the VOL connector's cache layout instead). Accented outputs are CTE tags,
written through the CAE's next_pool_id; the last two rows write
files outside the CTE. Only the file assimilator can serve a single blob, so
only it supports on_fault.Ingest on fault
With on_fault set, a transfer copies nothing. The core records the context in a registry under a hashed id, and the destination carries that id as its fault parameters. When a read misses a blob, the CTE sends a get for that blob to the tag's fault pool, the CAE, carrying the id; the core looks up the context and asks the source's assimilator for exactly that blob, stores it, and lets the read continue. Source reads can take seconds on a parallel filesystem, so they run on a separate pool of threads (32 by default, CLIO_CAE_REF_IO_THREADS) while the fault task yields, keeping runtime workers free. Because the source is readable from every node, a fault tag's blobs are served and kept on whichever node reads them, rather than on a hashed owner. CLIO_CAE_FAULT_STATS=1 logs per-stage counters every five seconds.
Ingested blobs can always be fetched again, so they never take the last of a tier: a fault is served from the source without being stored when the node's free space would drop below a reserve (512 MiB, CLIO_CAE_FAULT_RESERVE_MB), and for the next 256 faults after a store fails. CLIO_CAE_FAULT_STORE=0 turns storing off entirely, making the tag a pure read-through.
The fault path
file::/data/run.bin to
iowarp::run, registered with on_fault. The first read
of chunk_7 misses in the CTE, which hands the whole get to the CAE;
the CAE reads just that megabyte from the source off the runtime workers,
stores it as an eager import would have, and answers the read. Its own
registry read and put carry kNoFault so they cannot fault back
into it.Pagify and page maps
Paged consumers such as memory expansion and clio-ml address data only as page 0, 1, 2 and so on. A page map is an ordered list of extents saying which bytes of which blob occupy which range of page space. It travels with the data, as a blob named pagemap in the tag; the assimilator interface has a hook for producing one, though no shipped assimilator overrides it yet. Pagify uses it to build a page: a get through the CAE for a blob named page:<N> loads the tag's map once, fetches the slices straight into the caller's buffer, composes pages made of several blobs, and zero-fills uncovered ranges. The split keeps the arithmetic pure and testable and the I/O injectable.
The summarizer
The optional summarizer module is a CTE interposer: it forwards every operation, and after a matching put sends the content to the configured language model endpoint (it speaks the Ollama protocol by default) and stores the label as a sibling blob. The model call runs inline on the put's task, so every matching put waits for the model. Enable it only for data you want described.
Costs of this design
| Decision | Buys | Costs |
|---|---|---|
| One task per transfer list | One round trip; ordered, simple status | Transfers in a list do not run in parallel |
| Writes through the chain | Imported data is indexed, cached and made durable | Imports pay every composed module's cost |
| Ingest on fault | Instant registration of huge sources | First reads pay source latency |
| Separate reference I/O pool | Slow sources never stall workers | Extra threads per runtime |