Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Unified Diff: tools/utils.py

Issue 1356643002: Give environment var DART_NUMBER_OF_CORES priority over /proc/cpuinfo when choosing the number of c… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/utils.py
diff --git a/tools/utils.py b/tools/utils.py
index 4b7fae5794ef8dd4dede98f5c1a09c68f90d7192..7379d6af8ec592f790f58521262bbec69d08720f 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -75,14 +75,18 @@ def GuessArchitecture():
# Try to guess the number of cpus on this machine.
def GuessCpus():
+ if os.getenv("DART_NUMBER_OF_CORES") is not None:
+ return int(os.getenv("DART_NUMBER_OF_CORES"))
if os.path.exists("/proc/cpuinfo"):
return int(commands.getoutput("grep -E '^processor' /proc/cpuinfo | wc -l"))
if os.path.exists("/usr/bin/hostinfo"):
- return int(commands.getoutput('/usr/bin/hostinfo | grep "processors are logically available." | awk "{ print \$1 }"'))
+ return int(commands.getoutput('/usr/bin/hostinfo |'
+ ' grep "processors are logically available." |'
+ ' awk "{ print \$1 }"'))
win_cpu_count = os.getenv("NUMBER_OF_PROCESSORS")
if win_cpu_count:
return int(win_cpu_count)
- return int(os.getenv("DART_NUMBER_OF_CORES", 2))
+ return 2
def GetWindowsRegistryKeyName(name):
import win32process
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698