aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--brutha/__main__.py5
-rw-r--r--brutha/util.py13
2 files changed, 3 insertions, 15 deletions
diff --git a/brutha/__main__.py b/brutha/__main__.py
index 4e31f33..6097218 100644
--- a/brutha/__main__.py
+++ b/brutha/__main__.py
@@ -5,14 +5,15 @@ from __future__ import absolute_import
import argparse
import sys
from StringIO import StringIO
+from multiprocessing import cpu_count
from .output import OUTPUTS
from .tree import Tree
-from .util import default_output, detect_cores
+from .util import default_output
def main():
- cores = detect_cores()
+ cores = cpu_count()
output = default_output(cores)
parser = argparse.ArgumentParser(
diff --git a/brutha/util.py b/brutha/util.py
index 9dde432..7838ca4 100644
--- a/brutha/util.py
+++ b/brutha/util.py
@@ -2,7 +2,6 @@
from __future__ import absolute_import
import os
-import re
def escape(x):
@@ -46,18 +45,6 @@ def require_executable(name, names=None):
raise Exception('Could not find executable: %s' % name)
-def detect_cores():
- try:
- import numpy.distutils.cpuinfo
- return numpy.distutils.cpuinfo.cpuinfo()._getNCPUs()
- except ImportError:
- try:
- with open('/proc/cpuinfo') as f:
- return len(re.findall('^processor\s+:\s+(\d+)$', f.read(), re.MULTILINE))
- except IOError:
- pass
-
-
def default_output(cores=None):
if cores and cores > 1:
if find_executable('make', ['gmake', 'make']):