shamrock.NeighCacheStrategy#

class shamrock.NeighCacheStrategy#

Bases: pybind11_object

Strategy used to build the neighbours cache out of the tree traversal.

>>> from shamrock import NeighCacheStrategy
>>> cfg.set_neigh_cache_strategy(NeighCacheStrategy.SingleStage)

Members:

SingleStage

Single tree traversal per particle.

Each particle walks the tree itself and writes its neighbours straight to the cache. Prefer this one when the tree ends up with giant leaves, as on a chaotic disc: there the leaf bounding boxes grow so large that the two stage search makes each particle scan far more candidates than it keeps.

TwoStage

Two stage neighbours search (see the shamrock paper). This is the default.

A first pass walks the tree once per leaf to build a leaf to leaf neighbour map, then each particle only scans the particles held by its own leaf’s neighbour leaves. This is usually the faster of the two, since the tree traversal is paid once per leaf instead of once per particle.

SingleStageSharedOffload

Single tree traversal per particle, shared memory offload variant.

Same algorithm as SingleStage, but the tree traversal stack is placed in a work-group local memory allocation (one private slice per work-item) instead of a per-work-item std::array, and the kernel is launched over nd_range work-groups.

TwoStageSharedOffload

Two stage neighbours search, shared memory offload variant.

Same algorithm as TwoStage, but every tree traversal stack (leaf to leaf search and particle parent-leaf search) is placed in work-group local memory instead of a per-work-item std::array.

Methods

Attributes

SingleStage

SingleStageSharedOffload

TwoStage

TwoStageSharedOffload

name

value

Production run: Black hole disc & lense thirring effect

Production run: Black hole disc & lense thirring effect

Dusty settling SPH test with COALA coagulation

Dusty settling SPH test with COALA coagulation

Dusty settling SPH test

Dusty settling SPH test

Using Shamrock SPH rendering module

Using Shamrock SPH rendering module
property name#