Skip to content

Commit

Permalink
Added test for utilities.parallel.limit_inner_threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzwanenburg committed Apr 5, 2024
1 parent bfff685 commit b3edb8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel_feature_extraction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,17 @@ def test_parallel_dl_preprocessing():
for ii in range(len(sequential_images)):
assert np.array_equal(sequential_images[ii][0], parallel_images[ii][0])
assert np.array_equal(sequential_images[ii][1], parallel_images[ii][1])


def test_limit_threads():
from mirp.utilities.parallel import limit_inner_threads

limit_inner_threads()

assert os.environ["OMP_NUM_THREADS"] == "1"
assert os.environ["OPENBLAS_NUM_THREADS"] == "1"
assert os.environ["MKL_NUM_THREADS"] == "1"
assert os.environ["BLIS_NUM_THREADS"] == "1"
assert os.environ["VECLIB_MAXIMUM_THREADS"] == "1"
assert os.environ["NUMBA_NUM_THREADS"] == "1"
assert os.environ["NUMEXPR_NUM_THREADS"] == "1"

0 comments on commit b3edb8f

Please sign in to comment.