Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on nthreads detection (closes: #479) #484

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions numexpr/tests/test_numexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

double = np.double
long = int
MAX_THREADS = 8


class test_numexpr(TestCase):
Expand Down Expand Up @@ -1164,14 +1165,14 @@ def test_omp_num_threads_empty_string(self):
if 'sparc' in platform.machine():
self.assertEqual(1, numexpr._init_num_threads())
else:
self.assertEqual(detect_number_of_cores(), numexpr._init_num_threads())
self.assertEqual(min(detect_number_of_cores(), MAX_THREADS), numexpr._init_num_threads())

def test_numexpr_max_threads_empty_string(self):
with _environment('NUMEXPR_MAX_THREADS', ''):
if 'sparc' in platform.machine():
self.assertEqual(1, numexpr._init_num_threads())
else:
self.assertEqual(detect_number_of_cores(), numexpr._init_num_threads())
self.assertEqual(min(detect_number_of_cores(), MAX_THREADS), numexpr._init_num_threads())

def test_vml_threads_round_trip(self):
n_threads = 3
Expand Down
Loading