Build Packages / build:viewer-tgz:cpu (push) Successful in 20m26s
Build Packages / build:viewer-tgz:cuda (push) Successful in 21m30s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 22m36s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 24m4s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 28m10s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 28m12s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 28m23s
Build Packages / XDS test (durin plugin) (push) Successful in 11m21s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 20m56s
Build Packages / build:rpm (rocky9) (push) Successful in 21m10s
Build Packages / Generate python client (push) Successful in 40s
Build Packages / Build documentation (push) Successful in 1m34s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (rocky8) (push) Successful in 25m28s
Build Packages / DIALS test (push) Successful in 21m15s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 21m26s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 25m51s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 10m53s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m41s
Build Packages / Unit tests (push) Successful in 2h21m29s
Build Packages / build:windows:nocuda (push) Successful in 1m15s
Build Packages / build:windows:cuda (push) Successful in 28m0s
Three independent changes to the CPU-bound parts of an offline rotation run, none of which alters a result. Candidate-cell refinement now splits across threads. RefineCandidateCells already took a (block, nblocks) partition, but the only call site passed nblocks=1, so the whole first pass of a two-pass rotation run sat on one thread per scheme - two threads, unchanged at every -N, for a third of the run. A block touches only its own scores(j) and cells rows and holds its own scratch, so the split is exact. The budget is a new IndexingSettings::RefineThreads, left at 1 by default and set only where few indexer threads exist: raising it unconditionally would oversubscribe the paths that already run one indexer per image across all workers. The mmCIF writer built a std::ostringstream per formatted number, twelve per reflection. snprintf gives the same digits for 0.535 -> 0.220 s per file. The space-group search built the same orbit mapping twice per candidate point group - once for the merge chi^2 and once for the systematic-error b, an apply_to_hkl and Canonicalize per observation per operator each time. Build it once and hand it to both. 18 Mpx rotation set 24.6 -> 18.7 s, 2.5 Mpx 13.0 -> 10.7 s, and the 37-crystal battery 13m55s -> 10m47s with no failures, the same 34/37 space groups, and statistics unchanged on 30 of 37 (the rest drift within the run-to-run spread the binary already had, which a control build with the split disabled reproduces). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
86 lines
3.9 KiB
C++
86 lines
3.9 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
enum class IndexingAlgorithmEnum {FFBIDX, FFT, FFTW, Auto, None};
|
|
// Flex = "let the pipeline decide": try several per-image refinements and keep whichever indexes the
|
|
// most spots (CLI -r flex; the legacy -r multi name is still accepted as an alias).
|
|
enum class GeomRefinementAlgorithmEnum {None, OrientationOnly, BeamCenter, Flex};
|
|
|
|
class IndexingSettings {
|
|
IndexingAlgorithmEnum algorithm;
|
|
int64_t fft_num_vectors = 16*1024;
|
|
float fft_max_unit_cell_A = 500.0;
|
|
float fft_min_unit_cell_A = 10.0;
|
|
float fft_max_angle_deg = 150.0;
|
|
float fft_min_angle_deg = 30.0;
|
|
float fft_high_resolution_A = 2.0;
|
|
float indexing_tolerance = 0.1;
|
|
float max_angle_from_ewald_deg = 2.0;
|
|
float unit_cell_dist_tolerance_vs_reference = 0.05; // relative
|
|
static constexpr float unit_cell_angle_tolerance_deg = 5.0; // degree
|
|
int64_t indexing_threads = 4;
|
|
// Threads splitting the candidate-cell refinement WITHIN one indexer call. 1 (the default) is the
|
|
// right answer whenever indexers already run one per image across all workers; it is raised only
|
|
// where few indexer threads exist and cores would otherwise sit idle.
|
|
int64_t refine_threads = 1;
|
|
int64_t viable_cell_min_spots = 9;
|
|
|
|
int64_t max_extra_lattices = 2;
|
|
|
|
bool blocking_behavior = true;
|
|
bool index_ice_rings = false;
|
|
|
|
bool enable_rotation_indexing = false;
|
|
float rotation_indexing_min_angular_range_deg = 20.0;
|
|
float rotation_indexing_angular_stride_deg = 0.5;
|
|
|
|
GeomRefinementAlgorithmEnum refinement = GeomRefinementAlgorithmEnum::BeamCenter;
|
|
public:
|
|
IndexingSettings();
|
|
|
|
IndexingSettings& ViableCellMinSpots(int64_t input);
|
|
IndexingSettings& Algorithm(IndexingAlgorithmEnum input);
|
|
IndexingSettings& FFT_MaxUnitCell_A(float input);
|
|
IndexingSettings& FFT_MinUnitCell_A(float input);
|
|
IndexingSettings& FFT_MaxAngle_deg(float input);
|
|
IndexingSettings& FFT_MinAngle_deg(float input);
|
|
IndexingSettings& FFT_NumVectors(int64_t input);
|
|
IndexingSettings& FFT_HighResolution_A(float input);
|
|
IndexingSettings& Tolerance(float input);
|
|
IndexingSettings& IndexingThreads(int64_t input);
|
|
IndexingSettings& RefineThreads(int64_t input);
|
|
IndexingSettings& UnitCellDistTolerance(float input);
|
|
IndexingSettings& GeomRefinementAlgorithm(GeomRefinementAlgorithmEnum input);
|
|
IndexingSettings& IndexIceRings(bool input);
|
|
IndexingSettings& RotationIndexing(bool input);
|
|
IndexingSettings& RotationIndexingMinAngularRange_deg(float input);
|
|
IndexingSettings& RotationIndexingAngularStride_deg(float input);
|
|
IndexingSettings& BlockingBehavior(bool input);
|
|
IndexingSettings& MaxExtraLattices(int64_t input);
|
|
|
|
[[nodiscard]] int64_t GetViableCellMinSpots() const;
|
|
[[nodiscard]] IndexingAlgorithmEnum GetAlgorithm() const;
|
|
[[nodiscard]] GeomRefinementAlgorithmEnum GetGeomRefinementAlgorithm() const;
|
|
[[nodiscard]] float GetFFT_MaxUnitCell_A() const;
|
|
[[nodiscard]] float GetFFT_MinUnitCell_A() const;
|
|
[[nodiscard]] int64_t GetFFT_NumVectors() const;
|
|
[[nodiscard]] float GetFFT_HighResolution_A() const;
|
|
[[nodiscard]] float GetTolerance() const;
|
|
[[nodiscard]] float GetFFT_MinAngle_deg() const;
|
|
[[nodiscard]] float GetFFT_MaxAngle_deg() const;
|
|
[[nodiscard]] int64_t GetIndexingThreads() const;
|
|
[[nodiscard]] int64_t GetRefineThreads() const;
|
|
[[nodiscard]] float GetUnitCellDistTolerance() const;
|
|
[[nodiscard]] float GetUnitCellAngleTolerance_deg() const;
|
|
[[nodiscard]] bool GetIndexIceRings() const;
|
|
[[nodiscard]] bool GetRotationIndexing() const;
|
|
[[nodiscard]] float GetRotationIndexingMinAngularRange_deg() const;
|
|
[[nodiscard]] float GetRotationIndexingAngularStride_deg() const;
|
|
[[nodiscard]] bool GetBlockingBehavior() const;
|
|
[[nodiscard]] int64_t GetMaxExtraLattices() const;
|
|
};
|