TST Avoid side effects in test suite #124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
test_threadpool_controller_limit
had a side effect when using OpenBLAS with the OpenMP threading layer.There must have been a change in the numpy or openblas init, such that now openblas num_threads is 1 after numpy import and only switches to the number of cores after the openmp threadpool is initialized (doing a big matrix multiplication for instance). So what's going on is:
initially:
Openblas num_threads: 1
OpenMP num_threads: 4
with blas_controller.limit(limits=1)
Openblas num_threads: 1
OpenMP num_threads: 1 # set both limits to 1 even if it's only the openblas controller (see OpenMathLib/OpenBLAS#2985)
finally:
Openblas num_threads: 1
OpenMP num_threads: 1 # instead of 4 because the ctx only reset for OpenBLAS to its original value which also set's the OpenMP limit for the same reason as above.
This PR: skip the test when OpenBLAS with the OpenMP threading layer to avoid the side effect that impacts following tests. The assertion of the test was already not tested in this case anyway.