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

Add API parameter to cap thread usage #46

Merged
merged 9 commits into from
Jan 21, 2025

Conversation

aliddell
Copy link
Member

  • Adds a new API parameter to the settings struct, max_threads, which allows users to cap the number of threads used by the Zarr stream.
  • Updates tests and examples to reflect.
  • Updates the Python package version to 0.1.0.
  • Updates the description of the Python package from "Python bindings for acquire-zarr" to "Performant streaming to Zarr storage, on filesystem or cloud"

@aliddell aliddell linked an issue Jan 17, 2025 that may be closed by this pull request
@aliddell aliddell changed the title 24 api add parameter to cap thread usage Add API parameter to cap thread usage Jan 17, 2025
@aliddell aliddell requested a review from jeskesen January 17, 2025 20:12
Copy link
Contributor

@jeskesen jeskesen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Some small details:

  • std::thread::hardware_concurrency() can return zero if it can't determine the number of cores. Should this case be handled?
  • If a user sets a higher number than std::thread::hardware_concurrency(), it silently changes that value. a) should it let the user set a higher value if they want to? b) should there be at least a warning that the value is being changed, or an exception?

@aliddell
Copy link
Member Author

LGTM.

Some small details:

* std::thread::hardware_concurrency() can return zero if it can't determine the number of cores.  Should this case be handled?

* If a user sets a higher number than std::thread::hardware_concurrency(), it silently changes that value.  a) should it let the user set a higher value if they want to?  b) should there be at least a warning that the value is being changed, or an exception?

We will allow the user to set a higher value, and interpret setting 0 as "maximum hardware concurrency." We'll warn only if we can't determine what that is.

@aliddell aliddell merged commit 53f58f3 into main Jan 21, 2025
7 checks passed
@aliddell aliddell deleted the 24-api-add-parameter-to-cap-thread-usage branch January 21, 2025 15:55
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

Successfully merging this pull request may close these issues.

API: add parameter to cap thread usage
2 participants