From c00ef002e3d5dd5fbb964fbf8f150dd2f61f5175 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 7 Jul 2020 15:33:02 +0200 Subject: [PATCH] Check if OMP_PLACES=threads is set in the environment --- driver/others/openblas_env.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/driver/others/openblas_env.c b/driver/others/openblas_env.c index 64ece9515..df0b57763 100644 --- a/driver/others/openblas_env.c +++ b/driver/others/openblas_env.c @@ -39,6 +39,7 @@ static int openblas_env_block_factor=0; static int openblas_env_openblas_num_threads=0; static int openblas_env_goto_num_threads=0; static int openblas_env_omp_num_threads=0; +static int openblas_env_omp_places_threads=0; int openblas_verbose() { return openblas_env_verbose;} unsigned int openblas_thread_timeout() { return openblas_env_thread_timeout;} @@ -46,6 +47,7 @@ int openblas_block_factor() { return openblas_env_block_factor;} int openblas_num_threads_env() { return openblas_env_openblas_num_threads;} int openblas_goto_num_threads_env() { return openblas_env_goto_num_threads;} int openblas_omp_num_threads_env() { return openblas_env_omp_num_threads;} +int openblas_omp_places_threads_env() { return openblas_env_omp_places_threads;} void openblas_read_env() { int ret=0; @@ -79,6 +81,11 @@ void openblas_read_env() { if(ret<0) ret=0; openblas_env_omp_num_threads=ret; + ret=0; + if (readenv(p,"OMP_PLACES")) ret = !strncasecmp(p,"threads",7); + if(ret<0) ret=0; + openblas_env_omp_places_threads=ret; + }