Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-109649: Fix test_os.test_process_cpu_count_affinity()#111689

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromvstinner:process_cpu_count
Nov 3, 2023

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedNov 3, 2023
edited
Loading

When CPUs are isolated on Linux, os.process_cpu_count() is smaller than os.cpu_count(). Fix the test for this case.

Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linux command line to isolated two logical CPUs:

$ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())'10 / 12

When CPUs are isolated on Linux, os.process_cpu_count() is smallerthan os.cpu_count(). Fix the test for this case.Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linuxcommand line to isolated two logical CPUs:$ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())'10 / 12
@vstinner
Copy link
MemberAuthor

@corona10@gpshead: Do you think that it would be worth it to document this special case in os.process_cpu_count()?

"On Linux, if some CPUs are isolated, os.process_cpu_count() reports less usable CPUs than os.cpu_count()."

Or is it a known fact?

I'm asking if we should "advertize" more this function to users this way ;-)

@gpshead
Copy link
Member

: Do you think that it would be worth it to document this special case in os.process_cpu_count()?

"On Linux, if some CPUs are isolated, os.process_cpu_count() reports less usable CPUs than os.cpu_count()."

Or is it a known fact?

I think we can consider this "known" in the sense that the number of possible ways for this to be true on a system is more than we can accurately enumerate in our docs.

@vstinnervstinnerenabled auto-merge (squash)November 3, 2023 17:27
@vstinner
Copy link
MemberAuthor

Ok, thanks for the review@gpshead.

gpshead reacted with thumbs up emoji

@vstinnervstinner merged commit244e37b intopython:mainNov 3, 2023
@vstinnervstinner deleted the process_cpu_count branchNovember 3, 2023 23:53
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…n#111689)When CPUs are isolated on Linux, os.process_cpu_count() is smallerthan os.cpu_count(). Fix the test for this case.Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linuxcommand line to isolated two logical CPUs:$ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())'10 / 12
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
…n#111689)When CPUs are isolated on Linux, os.process_cpu_count() is smallerthan os.cpu_count(). Fix the test for this case.Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linuxcommand line to isolated two logical CPUs:$ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())'10 / 12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees
No one assigned
Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@vstinner@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp