File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1313The module also provides a thread local storage variable for thread-specific data.
1414"""
1515
16- import multiprocessing
1716import threading
1817from collections .abc import Callable
1918from typing import Any , Optional
2019
20+ DEFAULT_MAX_THREADS = 24
21+ """
22+ Default maximum number of threads for the thread pool. This is set to 24, to allow
23+ parallel execution of sub-runs in the pipeline (as these are typically not CPU-bound). A
24+ lower value more fit for the respective hardware is recommended when running many
25+ CPU-bound steps.
26+ """
27+
2128thread_local = threading .local ()
2229"""Thread-local storage.
2330
@@ -176,11 +183,11 @@ def __init__(self, max_threads: int = 0):
176183 ----------
177184 max_threads : int, optional
178185 Maximum number of threads to use, by default 0.
179- If <= 0, uses the number of CPU cores .
186+ If <= 0, DEFAULT_MAX_THREADS is used .
180187 """
181188
182189 if max_threads <= 0 :
183- max_threads = multiprocessing . cpu_count ()
190+ max_threads = DEFAULT_MAX_THREADS
184191 self .max_threads = max_threads
185192 self .counter = 0 # Used to assign unique IDs to threads
186193 self .waiting = {}
You can’t perform that action at this time.
0 commit comments