Prev Next omp_max_num_threads

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@This is cppad-20221105 documentation. Here is a link to its current documentation .
Set and Get Maximum Number of Threads for omp_alloc Allocator

Deprecated 2011-08-31
Use the functions thread_alloc::parallel_setup and thread_alloc:num_threads instead.

Syntax
# include <cppad/utility/omp_alloc.hpp>
omp_alloc::set_max_num_threads(number)
number = omp_alloc::get_max_num_threads()

Purpose
By default there is only one thread and all execution is in sequential mode (not parallel ).

number
The argument and return value number has prototype
    size_t 
number
and must be greater than zero.

set_max_num_threads
Informs omp_alloc of the maximum number of OpenMP threads.

get_max_num_threads
Returns the valued used in the previous call to set_max_num_threads. If there was no such previous call, the value one is returned (and only thread number zero can use omp_alloc ).

Restrictions
The function set_max_num_threads must be called before the program enters parallel execution mode. In addition, this function cannot be called while in parallel mode.
Input File: include/cppad/utility/omp_alloc.hpp