feos.set_num_threads¶
- feos.set_num_threads(n)¶
Set the number of threads used for any parallel calculations.
Must be called before any parallel computation is performed and before the FEOS_MAX_THREADS environment variable takes effect. If the thread pool has already been initialized — either because FEOS_MAX_THREADS was set at import time or because a parallel function has already run — this call has no effect and a warning is emitted.
- Parameters:
n (int) – Number of threads. Pass 0 to use the default (number of logical CPUs).
Example
>>> import feos >>> feos.set_num_threads(4)