Skip to content

Commit 0b7f98d

Browse files
committed
Protection for cases where ncores=1
1 parent e5ebe63 commit 0b7f98d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

blosc2/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ class Tuner(Enum):
242242
The blosc2 version + date.
243243
"""
244244
# Internal Blosc threading
245-
nthreads = ncores = detect_number_of_cores() // 2
245+
nthreads = ncores = detect_number_of_cores()
246+
if ncores > 1:
247+
nthreads = ncores // 2
246248
"""Number of threads to be used in compression/decompression.
247249
"""
248250
# Protection against too many threads

0 commit comments

Comments
 (0)