Definition
omp_get_num_threads returns the number of threads in the current OpenMP region. If this function is called outside a parallel region, only the master thread is present hence the value returned is 1. Although spellings are close, do not confuse this function with omp_get_thread_num.
int omp_get_num_threads();