Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel query ? #237

Open
jschueller opened this issue Mar 18, 2024 · 4 comments
Open

parallel query ? #237

jschueller opened this issue Mar 18, 2024 · 4 comments

Comments

@jschueller
Copy link
Contributor

jschueller commented Mar 18, 2024

hello,
nanoflann supports the parallel build of the tree (by setting n_thread_build)
do you think it would also be possible to benefit from multithreading when querying several points at once (for knn) ?

@jlblancoc
Copy link
Owner

Yes, but on the side of the client user code:

  1. make sure of building the KD-tree index from one thread (even then, internally, multiple threads are used within nanoflann), wait for it to return, then
  2. Use TBB, std::thread, openmp, etc. to call the query methods in parallel. Query methods are reentrant and thread-safe.

@jschueller
Copy link
Contributor Author

jschueller commented Mar 19, 2024

@jlblancoc I would like the query of the k closests points of one unique reference point to use multithreading, not query the set of closest points of several reference points in parallel like you propose
do you think we can take advantage of parallel computations here ?

@jschueller
Copy link
Contributor Author

@jlblancoc could we consider reopening this issue ?

@jlblancoc jlblancoc reopened this Mar 27, 2024
@jlblancoc
Copy link
Owner

Sure!

I think it's difficult to obtain an advantage from parallel queries, except perhaps for very very large datasets. I don't have the bandwidth to try to implement to myself in the short term, though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants