Browse files

Change default number of threads for testsuite

Set default value to the number of CPUs in the system.
  • Loading branch information...
1 parent f5d2dda commit 0ffc2d80050fbd3d3040356205307ef0e167d148 @iliastsi iliastsi committed Mar 24, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 testsuite/runtests.py
View
9 testsuite/runtests.py
@@ -6,7 +6,7 @@
import glob
import subprocess
from ctypes import c_int
-from multiprocessing import Process, Lock, Value, BoundedSemaphore
+from multiprocessing import Process, Lock, Value, BoundedSemaphore, cpu_count
#---------------------------------------------------------------------
@@ -175,10 +175,13 @@ def ignoreLine(line):
else:
tests = glob.glob(dirname + "/suites/*/src/*")
-# How many threads we want (default 4)
+# How many threads we want (default, number of CPUs in the system)
threads = os.getenv("THREADS", "")
if threads == "":
- threads = "4"
+ try:
+ threads = str(cpu_count())
+ except:
+ threads = "4"
# Print header
print "Concuerror's Testsuite (%d threads)\n" % int(threads)

0 comments on commit 0ffc2d8

Please sign in to comment.