Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Initialize the Intel TBB threadpool and global scheduler through the tbb::task_arena object.
In case an instance of the tbb::task_scheduler_object has been instantiated prior to calling this function, then any subsequent initialization is ignored by the Intel TBB.
The maximal number of threads is read from the environment variable STAN_NUM_THREADS using internal::get_num_threads. See conventions of get_num_threads. The TBB scheduler will be activated by calling this function.
The function returns a reference to the static tbb::global_control instance.
n_threads | The maximum number of threads available to the tbb. If not set will search for the environment variable STAN_NUM_THREADS . A value of -1 will assume all detectable threads are available for the process. |
std::runtime_error | if n_threads (defaults to zero) is not provided and the value of STAN_NUM_THREADS environment variable is invalid. |
Definition at line 100 of file init_threadpool_tbb.hpp.