mtalg.set_num_threads

set_num_threads(num_threads: int)[source]

Set number of threads for subsequent multithreaded RNGs and algebra functions.

Parameters:

num_threads – Number of threads

Examples

Check the available number of threads.

>>> from multiprocessing import cpu_count
>>> cpu_count()
12

Check the number of threads used by mtalg.

>>> mtalg.get_num_threads()
12

Change the number of threads used by mtalg.

>>> mtalg.set_num_threads(6)
>>> mtalg.get_num_threads()
6