We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd77bd8 commit b1af9c3Copy full SHA for b1af9c3
1 file changed
src/mapply/mapply.py
@@ -29,10 +29,12 @@ def _choose_n_chunks(
29
"""Choose final amount of chunks to be sent to the ProcessPool."""
30
# no sense running parallel if data is too small
31
n_chunks = int(shape[axis] / chunk_size)
32
+ if n_workers < 1:
33
+ n_workers = N_CORES
34
35
if max_chunks_per_worker:
36
# no sense making too many chunks
- n_chunks = min(n_chunks, max_chunks_per_worker * N_CORES)
37
+ n_chunks = min(n_chunks, max_chunks_per_worker * n_workers)
38
if n_chunks < 1 or n_workers == 1 or N_CORES == 1:
39
# no sense running parallel
40
n_chunks = 1
0 commit comments