Skip to content

Commit

Permalink
Supply default value for worker_procs vatlab/sos-notebook#237
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Aug 8, 2019
1 parent 655ef11 commit 4b6fb6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sos/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ class WorkerManager(object):
def __init__(self, worker_procs, backend_socket):
if isinstance(worker_procs, (int, str)):
self._worker_procs = [str(worker_procs)]
elif worker_procs is None:
# from sos notebook with no value specified
self._worker_procs = [str(min(max(os.cpu_count() // 2, 2), 8))]
else:
# should be a sequence
self._worker_procs = worker_procs
Expand Down

0 comments on commit 4b6fb6e

Please sign in to comment.