Use os.sched_getaffinity for cpu counts when available#2979
Merged
asottile merged 1 commit intopre-commit:mainfrom Aug 30, 2023
Merged
Use os.sched_getaffinity for cpu counts when available#2979asottile merged 1 commit intopre-commit:mainfrom
asottile merged 1 commit intopre-commit:mainfrom
Conversation
1b44cbd to
92f905a
Compare
asottile
reviewed
Aug 29, 2023
0ee30cd to
4165ed8
Compare
4165ed8 to
ea8244b
Compare
Member
|
pre-commit.ci run |
|
shimming in to tell you - in case you don't alreadu know it - that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Attempt at fixing/improving #2978 for systems that support the
os.sched_getaffinitymethod.When unavailable (i.e. on mac), we fall back to the old behaviour.
I didn't know how much to mess with the existing tests so went with a new fixture to simulate when this is unavailable - I don't have a windows machine to test on so let me know if there's a better way to avoid this change being annoying!
resolves #2978