Sets a number of threads to be used in operations. Generally speaking one should use >= the number of physical cores. NumExpr does not benefit from Hyperthreading. During initialization time Numexpr sets the thread count by the ``_detect_number_of_threads()`` function.
(new_nthreads: int)
| 68 | return _nthreads |
| 69 | |
| 70 | def set_nthreads(new_nthreads: int) -> None: |
| 71 | """ |
| 72 | Sets a number of threads to be used in operations. Generally speaking one should |
| 73 | use >= the number of physical cores. NumExpr does not benefit from |
| 74 | Hyperthreading. |
| 75 | |
| 76 | During initialization time Numexpr sets the thread count by |
| 77 | the ``_detect_number_of_threads()`` function. |
| 78 | """ |
| 79 | global _nthreads |
| 80 | _nthreads = int(new_nthreads) |
| 81 | numexpr3.interpreter.set_num_threads(_nthreads) |
| 82 | |
| 83 | def get_ncores() -> int: |
| 84 | global _ncores |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…