Skip to content

Commit

Permalink
cpu_count can be None, so fallback to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Nov 2, 2024
1 parent d810958 commit 9cda157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cwltool/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def __init__(self) -> None:
self.pending_jobs_lock = threading.Lock()

self.max_ram = int(psutil.virtual_memory().available / 2**20)
self.max_cores = float(psutil.cpu_count())
self.max_cores = float(psutil.cpu_count() or 1)
self.max_cuda = cuda_version_and_device_count()[1]
self.allocated_ram = float(0)
self.allocated_cores = float(0)
Expand Down Expand Up @@ -429,7 +429,7 @@ def run_jobs(
logger: logging.Logger,
runtime_context: RuntimeContext,
) -> None:
self.taskqueue: TaskQueue = TaskQueue(threading.Lock(), psutil.cpu_count())
self.taskqueue: TaskQueue = TaskQueue(threading.Lock(), psutil.cpu_count() or 1)
try:
jobiter = process.job(job_order_object, self.output_callback, runtime_context)

Expand Down

0 comments on commit 9cda157

Please sign in to comment.