-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Prevent excessive parallel jobs during compilation #4004
base: master
Are you sure you want to change the base?
Conversation
The number of job slots should be fewer than the number of available logical CPUs in the system. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Unit Test Results (with flaky tests)0 files - 1 117 0 suites - 1 117 0s ⏱️ - 13h 19m 59s Results for commit 9421a0a. ± Comparison against base commit 7e4d993. ♻️ This comment has been updated with latest results. |
setup.py
Outdated
@@ -115,7 +115,7 @@ def build_extensions(self): | |||
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir), | |||
'-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable] | |||
|
|||
make_args = ['-j8'] if not os.environ.get('MAKEFLAGS') else [] | |||
make_args = ['-j' + str(min(8, len(os.sched_getaffinity(0))))] if not os.environ.get('MAKEFLAGS') else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like sched_getaffinity
is only available on some UNIX platforms. What is the return value of it when not available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The method doesn't exist on other platforms, per python/cpython#81781. I'll fix that.
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Checklist before submitting
Description
The number of job slots should be fewer than the number of available logical CPUs in the system.
Review process to land