Skip to content

Commit

Permalink
Do not warn if OMP_NUM_THREAD set. Fixes #344.
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Feb 19, 2024
1 parent 60565ea commit 23466af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Usage
array([ 1.00000000e+00, 2.00000000e+00, 3.00000000e+00, ...,
9.99998000e+05, 9.99999000e+05, 1.00000000e+06])

>>> ne.evaluate('a*b-4.1*a > 2.5*b') # a more complex one
>>> ne.evaluate("a * b - 4.1 * a > 2.5 * b") # a more complex one
array([False, False, False, ..., True, True, True], dtype=bool)

>>> ne.evaluate("sin(a) + arcsinh(a/b)") # you can also use functions
Expand Down
4 changes: 2 additions & 2 deletions numexpr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import os
import subprocess
import platform

from numexpr.interpreter import _set_num_threads, _get_num_threads, MAX_THREADS
from numexpr import use_vml
Expand Down Expand Up @@ -134,7 +133,8 @@ def _init_num_threads():

env_configured = False
n_cores = detect_number_of_cores()
if 'NUMEXPR_MAX_THREADS' in os.environ and os.environ['NUMEXPR_MAX_THREADS'] != '':
if ('NUMEXPR_MAX_THREADS' in os.environ and os.environ['NUMEXPR_MAX_THREADS'] != '' or
'OMP_NUM_THREADS' in os.environ and os.environ['OMP_NUM_THREADS'] != ''):
# The user has configured NumExpr in the expected way, so suppress logs.
env_configured = True
n_cores = MAX_THREADS
Expand Down

0 comments on commit 23466af

Please sign in to comment.