Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-110649: Update -Xcpu_count=<n> cmdline to support process mode#110639
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
Closed
+28 −4
Closed
Changes from1 commit
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
NextNext commit
gh-109595: Update -Xcpu_count=<n> cmdline to support process mode
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit920fb835f19f30d6b27484decf2c8aca44d7d770
There are no files selected for viewing
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
6 changes: 5 additions & 1 deletionDoc/using/cmdline.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -551,7 +551,9 @@ Miscellaneous options | ||
*n* must be greater than or equal to 1. | ||
This option may be useful for users who need to limit CPU resources of a | ||
container system. See also :envvar:`PYTHON_CPU_COUNT`. | ||
If *n* is ``default``, nothing is overridden, if *n* is ``process``, | ||
corona10 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
:func:`os.os.process_cpu_count` will be alias of :func:`os.cpu_count` | ||
and :func:`multiprocessing.cpu_count`. | ||
It also allows passing arbitrary values and retrieving them through the | ||
:data:`sys._xoptions` dictionary. | ||
@@ -1076,6 +1078,8 @@ conflict. | ||
If this variable is set to a positive integer, it overrides the return | ||
values of :func:`os.cpu_count` and :func:`os.process_cpu_count`. | ||
if this variable is set to ``process``, :func:`os.process_cpu_count` becomes | ||
alias of :func:`os.cpu_count` and :func:`multiprocessing.cpu_count`. | ||
See also the :option:`-X cpu_count <-X>` command-line option. | ||
3 changes: 3 additions & 0 deletionsLib/os.py
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
9 changes: 9 additions & 0 deletionsLib/test/test_cmd_line.py
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
4 changes: 4 additions & 0 deletionsMisc/NEWS.d/next/Core and Builtins/2023-10-10-23-37-42.gh-issue-109595.jPp6s9.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Update :option:`-X cpu_count <-X>` command line option to support | ||
``process`` mode that :func:`os.process_cpu_count` becomes an alias of | ||
:func:`os.cpu_count` and :func:`multiprocessing.cpu_count`. Patch by Donghee | ||
Na. |
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
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.