\pagebreak \section{\kcode{omp_get_num_threads} Routine} \label{sec:get_nthrs} \index{routines!omp_get_num_threads@\kcode{omp_get_num_threads}} \index{omp_get_num_threads routine@\kcode{omp_get_num_threads} routine} In the following example, the \kcode{omp_get_num_threads} call returns 1 in the sequential part of the code, so \ucode{np} will always be equal to 1. To determine the number of threads that will be deployed for the \kcode{parallel} region, the call should be inside the \kcode{parallel} region. \cexample{get_nthrs}{1} \fexample{get_nthrs}{1} \pagebreak The following example shows how to rewrite this program without including a query for the number of threads: \cexample{get_nthrs}{2} \fexample{get_nthrs}{2}