pyoctree | Python Octree Implementation | GPU library
kandi X-RAY | pyoctree Summary
kandi X-RAY | pyoctree Summary
Based on [1], which is clearly derived from [2]. Consulted tutorial at [3], which has example source code at [4]. Developed and tested on 64-bit Linux with Python 2.7.3 and 3.3.0.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Insert a node into the tree
- Insert a new node
- Finds the index of a branch
- Find position in the tree
- Return the position of the given position
- Iterate over all nodes in the tree
- Iterate through all branches of OctTree
pyoctree Key Features
pyoctree Examples and Code Snippets
Community Discussions
Trending Discussions on pyoctree
QUESTION
I am building a distributed spatial index in Python with a wrapped C++ extension. I am trying to use Dask (for the first time) instead of MPI. The current implementation works, but has several problems.
The critical part is the large overhead compared to serial execution. I would expect an almost linear speed-up from the algorithm.
Persist does not seem to do what I expect, as timings of the first query are much longer than in the second.
for my eyes the code looks unidiomatic, but as said, I am new to Dask. Is there a better way of doing this?
I need to to do some indexing into the delayed objects when using 2d chunks. That does not occur with 1d chunks and feels weird.
The algorithm builds sorts list of particles and then builds an octree, where nodes reference contiguous blocks of particles by in the sorted array by a pair of (start, end) indices. Queries take a boundary box and search overlapping nodes in the octree collect particles actually in the boundary box from the resulting candidates. Both building and queries are purely serial.
Parallelisation is done by randomly splitting up the particles, building tree on each subset. Queries are broadcast across all sub-indices and results are concatenated back together. Dask felt like a natural fit here. I use persist to generate the index once and keep it around as I expect many queries per index.
I tried map_blocks
but this only seems to work for array to array transformations. Further, various permutations of persist/compute have been tried.
ANSWER
Answered 2019-Nov-09 at 20:15It's hard to tell without profiling, but my guess is that you're including your spatial index in every task, and so are being hurt by excessive serialization.
I recommend reading through this document to learn how to identify costs: https://docs.dask.org/en/latest/phases-of-computation.html
And this document to learn about avoiding the serialization of large objects: https://docs.dask.org/en/latest/delayed-best-practices.html#avoid-repeatedly-putting-large-inputs-into-delayed-calls
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyoctree
You can use pyoctree like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page