arrlp.nb_threads module

arrlp.nb_threads(parallel=False)[source]

This context manager defines the number of logical cores on numba parallel threads.

Parameters:

threads (int or bool) – If bool set -1 by default for True and 1 for False If int sets the number of threads, -1 means maximum

Examples

>>> from arrlp import nb_threads
...
>>> with nb_threads(3) : # 3 threads
...     parallel_funct()