Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2bdcf9e
port distributed to arraycontext
alexfikl Jun 26, 2022
3a36792
add tests for DeviceDataRecord based on arraycontext
alexfikl Jun 22, 2022
be2e6f5
port test_traversal to arraycontext
alexfikl Jun 22, 2022
9c89fff
port test_tree to arraycontext
alexfikl Jun 23, 2022
c630a90
port test_fmm to arraycontext
alexfikl Jun 23, 2022
661b53c
port test_cost_model to arraycontext
alexfikl Jun 23, 2022
c09487a
port test_distributed to arraycontext
alexfikl Jun 26, 2022
5477ef1
port examples to arraycontext
alexfikl Jun 26, 2022
d5e8e0a
remove ImmutableHostDeviceArray
alexfikl Jun 26, 2022
8c04036
docs: add arraycontext
alexfikl Jun 24, 2022
31f92d3
update fmm interface for sumpy
alexfikl Sep 7, 2022
4978392
point ci to modified downstreams
alexfikl Aug 2, 2022
1347b65
change BoundingBoxFinder to a function
alexfikl Sep 10, 2022
b25c9f9
make GappyCopyAndMap and MapValues into functions
alexfikl Sep 10, 2022
e25bdd8
cache make_particle_array kernels in actx
alexfikl Sep 10, 2022
665c9a3
turn MaskCompressorKernel into a function
alexfikl Sep 10, 2022
b2a6bd0
make PeerListFinder a function
alexfikl Sep 10, 2022
dcd2dfa
make SpaceInvaderQueryBuilder a function
alexfikl Sep 10, 2022
8a8258e
make LeavesToBallsLookupBuilder and AreaQueryBuilder functions
alexfikl Sep 10, 2022
15d7c37
fix some porting bugs
alexfikl Sep 10, 2022
4a8f443
make RotationClassesBuilder a function
alexfikl Sep 10, 2022
24b7f04
make TranslationClassesBuilder a function
alexfikl Sep 10, 2022
bd19348
fix porting changes
alexfikl Sep 10, 2022
a40668b
make _ListMerger a function
alexfikl Sep 10, 2022
412c839
cache FMMCostModel kernels in arraycontext
alexfikl Sep 11, 2022
2381033
make FMMLibRotationDataInterface an ABC
alexfikl Sep 11, 2022
5ee7ff5
make FMMTraversalBuilder a function
alexfikl Sep 11, 2022
b65a831
remove some more manual event handling
alexfikl Sep 14, 2022
162a6c0
make TreeBuilder a function
alexfikl Sep 14, 2022
4089d57
remove uses of TreeBuilder
alexfikl Sep 14, 2022
c255cc8
cache kernels in link_point_sources
alexfikl Sep 14, 2022
7b921ed
make ParticleListFilter a function
alexfikl Sep 14, 2022
15da61e
cache distributed code on the arraycontext
alexfikl Sep 14, 2022
e3313d7
make BoxMasks an array container
alexfikl Sep 14, 2022
1a9e3a2
add allocators and queues to all kernel invocations
alexfikl Sep 14, 2022
162f313
fix flake8 issues
alexfikl Sep 14, 2022
d6ab627
remove stray allocators
alexfikl Sep 15, 2022
7c00c1d
store root_extent_stretch_factor in tree
alexfikl Sep 15, 2022
deb0b1f
remove more stray allocators
alexfikl Sep 15, 2022
189b9fc
fix some memoized kernel keys
alexfikl Sep 17, 2022
5d1bb3e
fix builder incompatibilities
alexfikl Sep 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ jobs:
. ./ci-support-v0

export PYTEST_ADDOPTS="-k 'not slowtest'"
if [[ "$DOWNSTREAM_PROJECT" == "pytential" && "$GITHUB_HEAD_REF" == "rename-nterms" ]]; then
DOWNSTREAM_PROJECT=https://github.com/gaohao95/pytential.git@rename-nterms

if [[ "$GITHUB_HEAD_REF" == "towards-array-context" ]]; then
DOWNSTREAM_PROJECT=https://github.com/alexfikl/${DOWNSTREAM_PROJECT}.git@towards-array-context
fi
test_downstream "$DOWNSTREAM_PROJECT"

# vim: sw=4
4 changes: 0 additions & 4 deletions .pylintrc-local.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
- arg: extension-pkg-whitelist
val: pyfmmlib

# Needed for boxtree.tools
- arg: init-hook
val: import sys; sys.setrecursionlimit(2000)
50 changes: 24 additions & 26 deletions boxtree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
"""

from boxtree.tree import Tree, TreeWithLinkedPointSources, box_flags_enum
from boxtree.tree_build import TreeBuilder
from boxtree.tree_build import TreeBuilder, build_tree

__all__ = [
"Tree", "TreeWithLinkedPointSources",
"TreeBuilder", "box_flags_enum"]
"TreeBuilder", "build_tree", "box_flags_enum"]

__doc__ = r"""
:mod:`boxtree` can do three main things:

* it can sort particles into an adaptively refined quad/octree,
see :class:`boxtree.Tree` and :class:`boxtree.TreeBuilder`.
see :class:`boxtree.Tree` and :class:`boxtree.build_tree`.

* it can compute fast-multipole-like interaction lists on this tree structure,
see :mod:`boxtree.traversal`. Note that while this traversal generation
builds on the result of particle sorting,
it is completely distinct in the software sense.
see :mod:`boxtree.traversal`. Note that, while this traversal generation
builds on the result of particle sorting, it is completely distinct in the
software sense.

* It can compute geometric lookup structures based on a :class:`boxtree.Tree`,
see :mod:`boxtree.area_query`.
Expand All @@ -48,16 +48,16 @@

* one where no distinction is made between sources and targets. In this mode,
all participants in the interaction are called 'particles'.
(``targets is None`` in the call to :meth:`boxtree.TreeBuilder.__call__`)
(``targets`` is *None* in the call to :meth:`boxtree.build_tree`)

* one where a distinction between sources and targets is made.
(``targets is not None`` in the call to :meth:`boxtree.TreeBuilder.__call__`)
(``targets`` is not *None* in the call to :meth:`boxtree.build_tree`)

* one where a distinction between sources and targets is made,
and where sources and/or targets are considered to have an extent, given by an
:math:`l^\infty` radius.
(``targets is not None`` and ``source_radii is not None or target_radii is
not None`` in the call to :meth:`boxtree.TreeBuilder.__call__`)
:math:`\ell^p` radius.
(``targets`` is not *None* and ``source_radii`` is not *None* or *target_radii*
is not *None* in the call to :meth:`boxtree.build_tree`)

If sources have an extent, it is possible to 'link' each source with a number
of point sources. For this case, it is important to internalize this bit of
Expand All @@ -69,9 +69,8 @@
-------------------------------

:attr:`Tree.source_radii` and :attr:`Tree.target_radii` specify the
radii of of :math:`l^\infty` 'circles' (that is, squares) centered at
:attr:`Tree.sources` and :attr:`Tree.targets` that contain the entire
extent of that source or target.
radii of of :math:`\ell^p` 'circles' centered at :attr:`Tree.sources` and
:attr:`Tree.targets` that contain the entire extent of that source or target.

:mod:`boxtree.traversal` guarantees that, in generating traversals, all
interactions to targets within the source extent and from sources within the
Expand All @@ -89,9 +88,9 @@
* **user target order**
* **tree target order** (tree/box-sorted)

:attr:`Tree.user_source_ids` helps translate source arrays into
tree order for processing. :attr:`Tree.sorted_target_ids`
helps translate potentials back into user target order for output.
:attr:`Tree.user_source_ids` helps translate source arrays into tree order for
processing. :attr:`Tree.sorted_target_ids` helps translate potentials back into
user target order for output.

If each 'original' source above is linked to a number of point sources,
the point sources have their own orderings:
Expand All @@ -107,24 +106,23 @@
CSR-like interaction list storage
---------------------------------

Many list-like data structures in :mod:`boxtree` consists of
two arrays, one whose name ends in ``_starts``, and another whose
name ends in ``_lists``. For example,
suppose we would like to find the colleagues of box #17 using
:attr:`boxtree.traversal.FMMTraversalInfo.colleagues_starts`
Many list-like data structures in :mod:`boxtree` consists of two arrays, one
whose name ends in ``_starts``, and another whose name ends in ``_lists``. For
example, suppose we would like to find the colleagues of box #17 using
:attr:`boxtree.traversal.FMMTraversalInfo.same_level_non_well_sep_boxes_starts`
and
:attr:`boxtree.traversal.FMMTraversalInfo.colleagues_lists`.
:attr:`boxtree.traversal.FMMTraversalInfo.same_level_non_well_sep_boxes_lists`.

The following snippet of code achieves this::

ibox = 17
start, end = colleagues_starts[ibox:ibox+2]
ibox_colleagues = colleagues_lists[start:end]
start, end = same_level_non_well_sep_boxes_starts[ibox:ibox+2]
ibox_colleagues = same_level_non_well_sep_boxes_lists[start:end]

This indexing scheme has the following properties:

* If the underlying indexing array (say the list of all boxes) has *n* entries,
then the ``_starts`` array has *n+1* entries. The very last entry determines
then the ``_starts`` array has *n + 1* entries. The very last entry determines
the length of the last list.

* The lists in ``_lists`` are stored contiguously. The start of the next list
Expand Down
Loading