wholecell.tests.utils.test_blas

Test a Numpy dot product. Repeat with different values of the OPENBLAS_NUM_THREADS environment variable which should vary the parallelism if Numpy is installed to use OpenBLAS.

Check that the result using 1 thread is as expected to test if the wcEcoli simulation results might be consistent across platforms.

The number of BLAS threads can change the dot product computation, presumably by changing evaluation order and thus floating point rounding.

Any of these ways works to run this test. The first one is quiet if the test passes. The others always show stdout:

pytest wholecell/tests/utils/test_blas.py python -m wholecell.tests.utils.test_blas wholecell/tests/utils/test_blas.py

class wholecell.tests.utils.test_blas.Test_blas(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

_classSetupFailed = False
_class_cleanups = []
wholecell.tests.utils.test_blas.dot_product()[source]

Return (a dot product of 2 data arrays, the time in ns to compute it).

Return type:

tuple[float, float]