Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change default number of threads for testsuite

Set default value to the number of CPUs in the system.
  • Loading branch information...
commit 0ffc2d80050fbd3d3040356205307ef0e167d148 1 parent f5d2dda
Ilias Tsitsimpis iliastsi authored

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. +6 3 testsuite/runtests.py
9 testsuite/runtests.py
@@ -6,7 +6,7 @@
6 6 import glob
7 7 import subprocess
8 8 from ctypes import c_int
9   -from multiprocessing import Process, Lock, Value, BoundedSemaphore
  9 +from multiprocessing import Process, Lock, Value, BoundedSemaphore, cpu_count
10 10
11 11
12 12 #---------------------------------------------------------------------
@@ -175,10 +175,13 @@ def ignoreLine(line):
175 175 else:
176 176 tests = glob.glob(dirname + "/suites/*/src/*")
177 177
178   -# How many threads we want (default 4)
  178 +# How many threads we want (default, number of CPUs in the system)
179 179 threads = os.getenv("THREADS", "")
180 180 if threads == "":
181   - threads = "4"
  181 + try:
  182 + threads = str(cpu_count())
  183 + except:
  184 + threads = "4"
182 185
183 186 # Print header
184 187 print "Concuerror's Testsuite (%d threads)\n" % int(threads)

0 comments on commit 0ffc2d8

Please sign in to comment.
Something went wrong with that request. Please try again.