xnn.common.data.grid_pairs#
The unique pairs of an orthorhombic periodic cell from a grid of cells, on the GPU (or on the CPU, one lane per
program, through xnn.common.cpu_kernels).
The cell is divided into at least 2 SPAN + 1 cells per axis, each at least the
cutoff over SPAN wide, so every pair within the cutoff joins an atom to one of the
(2 SPAN + 1)^3 cells around it, and in exactly one image (SPAN 1 on a GPU, 2 on
a CPU where the grid allows: fewer candidates in smaller cells). One program per atom walks those cells twice: first
to count its partners of higher index, then to write them at its offset in the
prefix sum of the counts. The pairs come out sorted by their first atom, in the
same order in every run, with no atomic adds and no host read but the total.
A cell too small for the grid, with every edge over the cutoff, is searched
without one: each atom against every atom of higher index (a GPU).
Functions
|
|
|
Every pair within |
|
The pairs |
|
The cells per axis of a grid over an orthorhombic cell with edges |