File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -823,6 +823,8 @@ void gotoblas_affinity_init(void) {
823
823
824
824
if (numprocs == 0 ) numprocs = readenv_atoi ("OMP_NUM_THREADS" );
825
825
826
+ if (numprocs == 0 ) numprocs = readenv_atoi ("OPENBLAS_DEFAULT_NUM_THREADS" );
827
+
826
828
numnodes = 1 ;
827
829
828
830
if (numprocs == 1 ) {
Original file line number Diff line number Diff line change @@ -67,10 +67,16 @@ void openblas_read_env() {
67
67
openblas_env_thread_timeout = (unsigned int )ret ;
68
68
69
69
ret = 0 ;
70
- if (readenv (p ,"OPENBLAS_NUM_THREADS " )) ret = atoi (p );
70
+ if (readenv (p ,"OPENBLAS_DEFAULT_NUM_THREADS " )) ret = atoi (p );
71
71
if (ret < 0 ) ret = 0 ;
72
72
openblas_env_openblas_num_threads = ret ;
73
73
74
+ ret = 0 ;
75
+ if (readenv (p ,"OPENBLAS_NUM_THREADS" )) ret = atoi (p );
76
+ if (ret < 0 ) ret = 0 ;
77
+ if (ret != 0 || openblas_env_openblas_num_threads == 0 )
78
+ openblas_env_openblas_num_threads = ret ;
79
+
74
80
ret = 0 ;
75
81
if (readenv (p ,"GOTO_NUM_THREADS" )) ret = atoi (p );
76
82
if (ret < 0 ) ret = 0 ;
You can’t perform that action at this time.
0 commit comments