lines 17-62 of file: include/cppad/utility/omp_alloc.hpp

{xrst_begin omp_max_num_threads app}
Set and Get Maximum Number of Threads for omp_alloc Allocator
#############################################################

Deprecated 2011-08-31
*********************
Use the functions :ref:`thread_alloc::parallel_setup<ta_parallel_setup-name>`
and :ref:`thread_alloc:num_threads<ta_num_threads-name>` 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 :ref:`parallel<omp_in_parallel-name>` ).

number
******
The argument and return value *number* has prototype

   ``size_t`` *number*

and must be greater than zero.

set_max_num_threads
*******************
Informs :ref:`omp_alloc-name` 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 :ref:`omp_alloc-name` ).

Restrictions
************
The function ``set_max_num_threads`` must be called before
the program enters :ref:`parallel<omp_in_parallel-name>` execution mode.
In addition, this function cannot be called while in parallel mode.

{xrst_end omp_max_num_threads}
