Title: [148429] trunk/Tools
Revision
148429
Author
commit-qu...@webkit.org
Date
2013-04-15 04:08:15 -0700 (Mon, 15 Apr 2013)

Log Message

[webkitpy] Use $NUMBER_OF_PROCESSORS in Executive.cpu_count()
https://bugs.webkit.org/show_bug.cgi?id=114506

Patch by Manuel Rego Casasnovas <r...@igalia.com> on 2013-04-15
Reviewed by Philippe Normand.

* Scripts/webkitpy/common/system/executive.py:
(Executive.cpu_count): Modify function in order to use the environment
variable $NUMBER_OF_PROCESSORS if it is defined and it is an integer
greater than 0.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (148428 => 148429)


--- trunk/Tools/ChangeLog	2013-04-15 10:54:59 UTC (rev 148428)
+++ trunk/Tools/ChangeLog	2013-04-15 11:08:15 UTC (rev 148429)
@@ -1,3 +1,15 @@
+2013-04-15  Manuel Rego Casasnovas  <r...@igalia.com>
+
+        [webkitpy] Use $NUMBER_OF_PROCESSORS in Executive.cpu_count()
+        https://bugs.webkit.org/show_bug.cgi?id=114506
+
+        Reviewed by Philippe Normand.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.cpu_count): Modify function in order to use the environment
+        variable $NUMBER_OF_PROCESSORS if it is defined and it is an integer
+        greater than 0.
+
 2013-04-15  Xan Lopez  <xlo...@igalia.com>
 
         [BlackBerry] ASSERT in StyleResolver::ensureScopeResolver()

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive.py (148428 => 148429)


--- trunk/Tools/Scripts/webkitpy/common/system/executive.py	2013-04-15 10:54:59 UTC (rev 148428)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive.py	2013-04-15 11:08:15 UTC (rev 148429)
@@ -142,6 +142,12 @@
         return child_output
 
     def cpu_count(self):
+        try:
+            cpus = int(os.environ.get('NUMBER_OF_PROCESSORS'))
+            if cpus > 0:
+                return cpus
+        except (ValueError, TypeError):
+            pass
         return multiprocessing.cpu_count()
 
     @staticmethod
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to