try reverting PR2706

This commit is contained in:
Martin Kroeker 2021-04-12 18:15:54 +02:00 committed by GitHub
parent be93ffdf49
commit b0a7c63e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -139,18 +139,19 @@ extern int blas_server_avail;
static __inline int num_cpu_avail(int level) { static __inline int num_cpu_avail(int level) {
#ifdef USE_OPENMP #ifdef USE_OPENMP
int openmp_nthreads=omp_get_max_threads(); int openmp_nthreads=0; //omp_get_max_threads();
#endif #endif
#ifndef USE_OPENMP //#ifndef USE_OPENMP
if (blas_cpu_number == 1 if (blas_cpu_number == 1
#endif //#endif
#ifdef USE_OPENMP #ifdef USE_OPENMP
if (openmp_nthreads == 1 || omp_in_parallel() || omp_in_parallel()
#endif #endif
) return 1; ) return 1;
#ifdef USE_OPENMP #ifdef USE_OPENMP
openmp_nthreads = omp_get_max_threads();
if (blas_cpu_number != openmp_nthreads) { if (blas_cpu_number != openmp_nthreads) {
goto_set_num_threads(openmp_nthreads); goto_set_num_threads(openmp_nthreads);
} }