No files. The receiver no longer makes a /tmp scratch directory or reads
rugnux's files back: AddToEndMessage moves the merged MtzTable and the map
coefficients out of ProcessResult::outputs and converts the placed model with
PlacedModelFromStructure (now given the data cell, as WritePlacedModel is).
FillRugnuxResultBlocks and MtzTableFromFile are gone; their test now builds the
blocks from the same in-memory outputs and still checks the writer reproduces
rugnux's own files byte for byte. The live status report is built from the
result with the writer's file prefix as its label. AddToEndMessage never
throws: a failure is logged and the END goes without the blocks.
Review fixes:
- MakeRugnuxLiveSetup sets nthreads_auto, as a bare `rugnux` does, so the
per-image loop keeps to GPUWorkersPerCard per card instead of starting one
GPU worker per CPU thread; the 60-degree probe gets a quarter of the
threads (at least 2).
- A failure setting rugnux up (start message, reader, thread start) marks the
live status Failed and nothing else; the collection goes on as in Lite.
MeasurementThread and ForwardThread also catch std::exception, so no
exception skips the latch or the reader's Ended().
- The ParallelFor pool is lowered to nice 10 only where it can be raised back
(CAP_SYS_NICE, or RLIMIT_NICE reaching 0); otherwise it is left alone and
that is logged once.
- The preview and metadata sockets get the END without the result blocks.
- Receiver plots and scan result are fed only from the canonical pass
(RugnuxObserver::OnImagePass): the pre-pass reports [0, E) again at the
header geometry and the plots accumulate, so it would count those images
twice. The canonical pass reads every image once.
- A collection the image buffer cannot hold is still not analysed, and now
says so in the broker status (Warning) as well as the rugnux status.
With rugnux live off nothing changes: the extra END resets are of empty
blocks and analysis_warning is empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rugnux library wrote its results itself: _process.h5 through a
FileWriter, the merged/twin/_mr reflection files, the unmerged MTZs, the
maps and their MTZ, the placed models, _detector.jpg and _plot.txt, and
on a doubled cell it renamed files on disk. It now writes none of them.
- MtzTable (common/MtzTable.h): an MTZ file's header, columns and batch
headers with no file behind it. It replaces MergedReflectionsMessage
and MapCoefficientsMessage in the END message, with one CBOR encoding.
WriteMtz (writer/WriteRugnuxFiles.h) is the one serialiser, used by
rugnux and jfjoch_writer alike; it refuses a table whose columns differ
in length, name a missing dataset, carry a malformed batch header or
name a space group gemmi does not know. MergedMtzTable and
UnmergedMtzTable build the tables the old writers built.
- ProcessResult::outputs (RugnuxOutputs) holds, for the output pass only:
the answer's merge (MTZ table plus what the .cif/.hkl are written from),
the twin hypothesis' and the model's choice's merges, the unmerged and
unmerged-partials tables, the maps (coefficients always; the grids only
with ProcessConfig::keep_map_grids), the placed models, the detector
JPEG and the per-image plot table, and the start message of the
no-lattice _process.h5. Map RMS is taken from the grid in memory, as the
CCP4 header stated it, whether or not the map is kept.
- The per-image analysis goes to a caller-supplied RugnuxImageSink;
rugnux and the viewer give a FileWriter-based ProcessFileSink. The
geometry pre-pass no longer makes a _01_process.h5.
- The doubled cell keeps both output sets: the answer's in outputs, the
other's in DoubledCell::other_outputs with its suffix; the report names
files by suffix after the caller's prefix.
- The output prefix, write_process_h5 and the observation dump path are
gone from ProcessConfig; --dump-observations is a callback.
- What used to be gated on having files to write (model validation and
MR, the twin-hypothesis merges, the finalist ledger, the scaled fulls,
the unmerged tables) is gated on the output pass instead, so a caller
with no prefix gets the same results.
- RugnuxOutputFiles (new library JFJochRugnuxOutput, linked by rugnux,
the viewer and the tests) writes every file from the result with the
names and formats rugnux has always used. The viewer writes its job's
files the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New gemmi-only library JFJochRugnuxFiles (writer/), linked by JFJochWriter, so
the writer needs no analysis library and builds with JFJOCH_WRITER_ONLY:
- WriteMergedMtz / WriteMapCoefficientsMtz / PlacedModelStructure make the
files from the structured blocks; WriteRugnuxResultFiles writes whichever
blocks END carries beside the master, each under a temporary name and renamed
into place, an existing file replaced only when the run's overwrite is set.
A file that fails costs only itself (logged), not the run.
- FillRugnuxResultBlocks reads the blocks back from the files rugnux wrote at
a prefix (p.mtz, p_maps.mtz, p_model.cif), for the broker to fill END.
WriteMtzReflections now goes through WriteMergedMtz (MergedReflectionsForWriter
builds the block); its output is byte-identical to before, checked by md5 on a
synthetic set in both the Friedel-merged and the anomalous layout.
StreamWriter writes the files after the master and before the END ACK, so the
ACK means they are in place; END receipt and each rename are logged at INFO
with the wall-clock time, for last-frame-to-files latency. The broker's direct
HDF5 pusher writes them too.
Test: rugnux's three files -> blocks -> CBOR -> writer reproduces all of them
(and _model.pdb) byte for byte; a ~25k-reflection END is 2.7 MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>