Molecular replacement: the CPU translation function gathers its grid once per setup, straight into FFTW's input, output unchanged
On the CPU every orientation's translation function scattered its terms into a complex<double> grid, converted that to an FPhiGrid, which MapFromFPhi copied into FFTW's input, transformed, and copied out again into a map the statistics then read: 24 bytes a grid point, 1.6 GB an orientation on 4nwv's cell, with the 2 x 32 orientations of the groups' functions in flight at once. Now, once per setup and for all its orientations (a new TranslationFunction over a list of rotations, which the search calls), each half-grid point's entries are listed in the order the terms and pairs come, cross terms after; an orientation sums each point over its own list - the same additions in the same order as the scatter - writes it conjugated into FFTW's input as MapFromFPhi would (MapFromFPhiExecute, the same plan) and reads the statistics off FFTW's output scaled as MapFromFPhi scales it: 8 bytes a point. CPU-only (--no-gpu), timing benchmark on 4nwv: the translation stage 61.5 -> 17.7 s, provisional (load average 24-31 during both runs, and every other stage moved by as much again with no change). Reports, MR candidate lines, reflection files, maps and placed models byte-identical on myob, cytc and 4nwv, CPU-only and on the GPU. [MolecularReplacement] passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa535f95a8
commit
2881e6255e
4 files changed
+116
-45
No files matched your search
@@ -78,6 +78,11 @@ gemmi::FPhiGrid<float> MapToFPhi(const gemmi::Grid<float> &map) {
|
||||
return hkl;
|
||||
}
|
||||
|
||||
void MapFromFPhiExecute(int nu, int nv, int nw, std::complex<float> *in, float *out) {
|
||||
static_assert(sizeof(std::complex<float>) == sizeof(fftwf_complex));
|
||||
fftwf_execute_dft_c2r(PlanFor(nu, nv, nw, true), reinterpret_cast<fftwf_complex *>(in), out);
|
||||
}
|
||||
|
||||
gemmi::Grid<float> MapFromFPhi(const gemmi::FPhiGrid<float> &hkl) {
|
||||
if (hkl.axis_order == gemmi::AxisOrder::ZYX || !hkl.half_l)
|
||||
gemmi::fail("MapFromFPhi(): only an XYZ half-l grid is supported");
|
||||
|
||||
Reference in new issue
Block a user