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

Using numpy API from rust changes how threading works #27

Open
clbarnes opened this issue Feb 22, 2022 · 0 comments
Open

Using numpy API from rust changes how threading works #27

clbarnes opened this issue Feb 22, 2022 · 0 comments
Labels

Comments

@clbarnes
Copy link
Owner

clbarnes commented Feb 22, 2022

Previously, users had fine-grained control over the number of threads to use on every query.

In the process of converting ncollpyde to be able to read arguments directly from numpy's buffers #1 (which significantly improves speed and memory profile), this fine-grained control was lost: queries either happen in serial or using the global rayon thread pool. This additionally saves on the overhead of building a thread pool was built for every call to a Volume method.

You can set the number of threads in the rayon thread pool by setting the environment variable RAYON_NUM_THREADS before the global pool is built (probably on the first query, but setting it before ncollpyde is imported may be safest). By default, the number of logical CPUs is used. More information is available here. You can find out how many threads are being used with the ncollpyde.n_threads() function.

ncollpyde's API will remain unchanged for the moment, but deprecation warnings will be thrown when non-boolean values are given.

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

No branches or pull requests

1 participant