Prev Next omp_max_thread

@(@\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}} }@)@
OpenMP Parallel Setup

Deprecated 2011-06-23
Use thread_alloc::parallel_setup to set the number of threads.


By default, for each AD<Base> class there is only one tape that records AD of Base operations. This tape is a global variable and hence it cannot be used by multiple OpenMP threads at the same time. The omp_max_thread function is used to set the maximum number of OpenMP threads that can be active. In this case, there is a different tape corresponding to each AD<Base> class and thread pair.

The argument number has prototype
It must be greater than zero and specifies the maximum number of OpenMp threads that will be active at one time.

Each call to Independent(x) creates a new active tape. All of the operations with the corresponding variables must be preformed by the same OpenMP thread. This includes the corresponding call to f.Dependent(x,y) or the ADFun f(x, y) during which the tape stops recording and the variables become parameters.

No tapes can be active when this function is called.
Input File: cppad/core/omp_max_thread.hpp