mmfutils.performance.threads

Thread Control

This module provides control of the number of threads used by the MKL and numexpr. It uses the global set SET_THREAD_HOOKS which should contain functions that take a single argument and set the number of threads for that particular part of the system.

Use set_num_threads(nthreads) to call all of these hooks.

mmfutils.performance.threads.set_num_threads(nthreads)[source]

Set the maximum number of threads to use.

Calls all the hooks in mmfutils.performance.threads.SET_THREAD_HOOKS