Coverage for numpy\_distributor_init.py: 0%

# Coverage for numpy\_distributor_init.py : 0%

## 21 statements 0 run 21 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | """ Distributor init file Distributors: you can add custom code here to support particular distributions of numpy. For example, this is a good place to put any checks for hardware requirements. The numpy standard source distribution will not put code in this file, so you can safely replace this file with your own version. """ def init_numpy_mkl(): """Initialize numpy+MKL.""" try: import os # Disable Intel Fortran default console event handler. # Disable OpenBLAS affinity setting of the main thread that limits # Python threads or processes to one core. for env in ('FOR_DISABLE_CONSOLE_CTRL_HANDLER', 'OPENBLAS_MAIN_FREE', 'GOTOBLAS_MAIN_FREE'): if env not in os.environ: os.environ[env] = '1' # Add the path of the Intel runtime DLLs to the DLL search path path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'DLLs') try: os.add_dll_directory(path) except Exception: environ_path = os.environ.get('PATH', '') if path not in environ_path: os.environ['PATH'] = os.pathsep.join((path, environ_path)) # Load Intel C, Fortran, and OMP runtime DLLs into the process import ctypes ctypes.CDLL(os.path.join(path, 'libmmd.dll')) ctypes.CDLL(os.path.join(path, 'libifcoremd.dll')) ctypes.CDLL(os.path.join(path, 'libiomp5md.dll')) except Exception: pass init_numpy_mkl() NUMPY_MKL = True