diff --git a/common_thread.h b/common_thread.h index a18df0d78..ce68da7c8 100644 --- a/common_thread.h +++ b/common_thread.h @@ -140,6 +140,7 @@ static __inline int num_cpu_avail(int level) { #ifdef USE_OPENMP int openmp_nthreads=omp_get_max_threads(); + if (openmp_nthreads > MAX_CPU_NUMBER) openmp_nthreads=MAX_CPU_NUMBER; #endif #ifndef USE_OPENMP