[llvm-commits] [llvm] r98969 - /llvm/trunk/utils/lit/lit/lit.py

Torok Edwin edwintorok at gmail.com
Fri Mar 19 10:54:21 PDT 2010


Author: edwin
Date: Fri Mar 19 12:54:21 2010
New Revision: 98969

URL: http://llvm.org/viewvc/llvm-project?rev=98969&view=rev
Log:
Set numThreads to 1 by default when Python is older than 2.5.2.

Python 2.4 always hits this bug: http://bugs.python.org/issue1731717
when running check-lit on multi-core systems.
Setting numThreads to 1 makes it slower, but at least the results reported are
correct.

Modified:
    llvm/trunk/utils/lit/lit/lit.py

Modified: llvm/trunk/utils/lit/lit/lit.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/lit.py?rev=98969&r1=98968&r2=98969&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/lit.py (original)
+++ llvm/trunk/utils/lit/lit/lit.py Fri Mar 19 12:54:21 2010
@@ -411,7 +411,14 @@
         gSiteConfigName = '%s.site.cfg' % opts.configPrefix
 
     if opts.numThreads is None:
-        opts.numThreads = Util.detectCPUs()
+# Python <2.5 has a race condition causing lit to always fail with numThreads>1
+# http://bugs.python.org/issue1731717
+# I haven't seen this bug occur with 2.5.2 and later, so only enable multiple
+# threads by default there.
+       if sys.hexversion >= 0x2050200:
+               opts.numThreads = Util.detectCPUs()
+       else:
+               opts.numThreads = 1
 
     inputs = args
 





More information about the llvm-commits mailing list