tree_d_3d.kernels.quadtree_scatter.quadtree_scatter_pyccel
The Pyccel version (CPU) of the quadtree_scatter kernel of the Barnes-Hut and FMM solvers.
quadtree_scatter_cuda.cu next to this file is the CUDA version (GPU) and
quadtree_scatter_numpy.py the version for machines without Pyccel, all with the
same arguments; the folder’s __init__.py declares the kernel (see
:mod:tree_d_3d.kernels). The flat quadtree is described in
:mod:tree_d_3d.flat_tree.
Functions
| Name | Description |
|---|---|
quadtree_scatter | One level of the tree build: move every particle of a split node into its child. |
quadtree_scatterfunction#
def quadtree_scatter(perm: int64[:], slot_node: int64[:], quadrant: int64[:], below: int64[:, :], node_start: int64[:], node_child: int64[:], new_perm: int64[:], new_slot_node: int64[:]) -> NoneOne level of the tree build: move every particle of a split node into its child.
below[k, q] counts the slots up to and including k in quadrant q
(the cumulative sum of the one-hot quadrant), so a particle’s rank among
its node’s particles of the same quadrant is a difference of two entries: the
partition is stable, as a serial one. node_start of the children must be
set. Particles of unsplit nodes (quadrant -1) stay in their slot.