diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index 45a20da2b..a36205b67 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -602,13 +602,16 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { const auto reseat_integrated = [&](const gemmi::Op &cob) { const gemmi::Mat33 basis = BasisMatrix(cob); const gemmi::Op hkl = HklOperator(cob); - for (auto &io : indexer->GetIntegrationOutcome()) { + // One image per task: each touches only its own outcome. + auto &outcomes = indexer->GetIntegrationOutcome(); + ParallelFor(static_cast(outcomes.size()), config_.nthreads, [&](int o) { + auto &io = outcomes[o]; io.latt = io.latt.Multiply(basis); for (auto &r : io.reflections) { const gemmi::Op::Miller h = hkl.apply_to_hkl({{r.h, r.k, r.l}}); r.h = h[0]; r.k = h[1]; r.l = h[2]; } - } + }); result.consensus_cell = CellInBasis(*result.consensus_cell, cob); end_msg.unit_cell = result.consensus_cell; if (end_msg.rotation_lattice.has_value())