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

Use number of available CPUs instead of total number #158

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

gmloose
Copy link
Collaborator

@gmloose gmloose commented Jul 24, 2024

Created a new function nproc() in operations_lib.py, which returns the number of CPU cores available to the current process, similar to what the Linux nproc command does. This can be less than the total number of CPU cores in the machine, which is returned by, e.g., multiprocessing.cpu_count(). Replaced calls to multiprocessing.cpu_count() with nproc().

Created a new function `nproc()` in `operations_lib.py`, which returns the number of CPU cores available for the current process, and replaced calls to `multiprocessing.cpu_count()` with a call to `nproc()`.
@gmloose gmloose self-assigned this Jul 24, 2024
@gmloose gmloose requested a review from darafferty July 24, 2024 12:46
Copy link
Collaborator

@darafferty darafferty left a comment

Choose a reason for hiding this comment

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

Looks good.

@gmloose gmloose merged commit f71d483 into master Jul 26, 2024
4 checks passed
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.

2 participants