Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
to a value slightly below than your number of cores.
Examples
--------
Set the number of threads to 2 and then to 1:
>>> oldn = blosc.set_nthreads(2)
>>> blosc.set_nthreads(1)
2
"""
if nthreads > blosc.MAX_THREADS:
raise ValueError("the number of threads cannot be larger than %d" %
blosc.MAX_THREADS)
return _ext.set_nthreads(nthreads)
to a value slightly below than your number of cores.
Examples
--------
Set the number of threads to 2 and then to 1:
>>> oldn = set_nthreads(2)
>>> set_nthreads(1)
2
"""
if nthreads > _ext.BLOSC_MAX_THREADS:
raise ValueError("the number of threads cannot be larger than %d" % \
_ext.BLOSC_MAX_THREADS)
return _ext.set_nthreads(nthreads)