diff --git a/image_analysis/rotation_indexer/RotationIndexer.cpp b/image_analysis/rotation_indexer/RotationIndexer.cpp index 9b911ae3d..2a25e8ec7 100644 --- a/image_analysis/rotation_indexer/RotationIndexer.cpp +++ b/image_analysis/rotation_indexer/RotationIndexer.cpp @@ -629,9 +629,13 @@ void RotationIndexer::RunIndexingLocked() { float kept_count = -1.0f; float last_count = 0.0f; LatticeSearchResult kept_class, last_class; + // One chain runs at a time here, with the candidate solves done, so it takes the cores + // they had. Ceres sums its per-thread cost and gradient pieces, so the thread count moves + // the result at rounding level. + constexpr int kChainCeresThreads = 16; for (int r = 0; r < ROT_REFINE_OUTER_ROUNDS; ++r) { XtalOptimizerData d = best; - if (!XtalOptimizer(d, v_, kCeresThreads)) + if (!XtalOptimizer(d, v_, kChainCeresThreads)) break; const double d1 = std::abs(d.geom.GetPoniRot1_rad() - best.geom.GetPoniRot1_rad()); const double d2 = std::abs(d.geom.GetPoniRot2_rad() - best.geom.GetPoniRot2_rad());