aboutsummaryrefslogtreecommitdiffstats
path: root/vicn/core/task.py
diff options
context:
space:
mode:
authorMarcel Enguehard <mengueha+fdio@cisco.com>2017-04-12 10:44:55 +0200
committerMarcel Enguehard <mengueha+fdio@cisco.com>2017-04-12 10:44:55 +0200
commit8b0ac576c778b380ff341ce4022b4d1f83aa7021 (patch)
tree909c6fffd7b94bcbd6b6a03fa374db22f7ca3e1a /vicn/core/task.py
parentb5e8632b6bbe47cd84533857d1e35a77d4b8bbf8 (diff)
Updated LXD image in tutorials + new tutorial + Changed logs for LXD NotFound to warnings + Number of workers is now a function of the number of CPUs
Change-Id: I926ac0e86cd2c594c3f9fce7e20e80a385b4f56a Signed-off-by: Marcel Enguehard <mengueha+fdio@cisco.com>
Diffstat (limited to 'vicn/core/task.py')
-rw-r--r--vicn/core/task.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/vicn/core/task.py b/vicn/core/task.py
index 5aecb40b..9c92ef4d 100644
--- a/vicn/core/task.py
+++ b/vicn/core/task.py
@@ -22,6 +22,7 @@ import functools
import logging
import shlex
import subprocess
+import os
from vicn.core.scheduling_algebra import SchedulingAlgebra
from vicn.core.commands import ReturnValue
@@ -34,7 +35,8 @@ log = logging.getLogger(__name__)
EXECUTOR=concurrent.futures.ThreadPoolExecutor
#EXECUTOR=concurrent.futures.ProcessPoolExecutor
-MAX_WORKERS = 50 # None
+#Sets the number of task workers to the number of CPU threads+1
+MAX_WORKERS = os.cpu_count()+1
class BaseTask:
"""Base class for all tasks