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>
41 lines
1.9 KiB
C++
41 lines
1.9 KiB
C++
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "RugnuxResultBlocks.h"
|
|
|
|
PlacedModelMessage PlacedModelFromStructure(const gemmi::Structure &st, const UnitCell &cell,
|
|
const std::string &data_space_group_name) {
|
|
PlacedModelMessage p;
|
|
p.name = st.name;
|
|
p.unit_cell = cell;
|
|
p.space_group_name = data_space_group_name;
|
|
p.model_space_group_name = st.spacegroup_hm;
|
|
bool has_aniso = false;
|
|
for (const gemmi::Model &m : st.models)
|
|
for (const gemmi::Chain &ch : m.chains)
|
|
for (const gemmi::Residue &r : ch.residues)
|
|
for (const gemmi::Atom &a : r.atoms) {
|
|
p.model_number.push_back(m.num);
|
|
p.chain.push_back(ch.name);
|
|
p.residue_name.push_back(r.name);
|
|
p.seq_num.push_back(*r.seqid.num);
|
|
p.icode.push_back(static_cast<uint8_t>(r.seqid.icode));
|
|
p.het_flag.push_back(static_cast<uint8_t>(r.het_flag));
|
|
p.atom_name.push_back(a.name);
|
|
p.element.push_back(a.element.name());
|
|
p.altloc.push_back(static_cast<uint8_t>(a.altloc));
|
|
p.charge.push_back(a.charge);
|
|
p.x.push_back(a.pos.x);
|
|
p.y.push_back(a.pos.y);
|
|
p.z.push_back(a.pos.z);
|
|
p.b_iso.push_back(a.b_iso);
|
|
p.occupancy.push_back(a.occ);
|
|
p.aniso.insert(p.aniso.end(), {a.aniso.u11, a.aniso.u22, a.aniso.u33,
|
|
a.aniso.u12, a.aniso.u13, a.aniso.u23});
|
|
has_aniso = has_aniso || a.aniso.nonzero();
|
|
}
|
|
if (!has_aniso)
|
|
p.aniso.clear();
|
|
return p;
|
|
}
|