33Entry point for agent context in this repo.
44
55## What this repository is
6- ` mkl-service ` provides Python API for runtime control of Intel® OneMKL (Math Kernel Library). It exposes support functions for:
6+ ` mkl-service ` provides a Python API for runtime control of Intel® oneMKL (Math Kernel Library). It exposes support functions for:
77- Threading control (set/get number of threads, domain-specific threading)
88- Version information (MKL version, build info)
99- Memory management (peak memory usage, memory statistics)
1010- Conditional Numerical Reproducibility (CNR)
1111- Timing functions (get CPU/wall clock time)
1212- Miscellaneous utilities (MKL_VERBOSE control, etc.)
1313
14- Originally part of Intel® Distribution for Python* , now standalone package available via conda-forge and Intel channels.
14+ Originally part of Intel® Distribution for Python* , now a standalone package available via conda-forge and Intel channels.
1515
1616## Key components
1717- ** Python interface:** ` mkl/__init__.py ` — public API surface
1818- ** Cython wrapper:** ` mkl/_mkl_service.pyx ` — wraps MKL support functions
19- - ** C init module:** ` mkl/_mklinitmodule.c ` — MKL library initialization
20- - ** Helper:** ` mkl/_init_helper.py ` — loading and RTLD_GLOBAL handling
19+ - ** C init module:** ` mkl/_mklinitmodule.c ` — Linux-side MKL runtime preloading / initialization
20+ - ** Helper:** ` mkl/_init_helper.py ` — Windows venv DLL loading helper
2121- ** Build system:** setuptools + Cython
2222
2323## Build dependencies
2424** Required:**
25- - Intel® OneMKL
25+ - Intel® oneMKL
2626- Cython
2727- Python 3.10+
2828
@@ -33,11 +33,11 @@ python setup.py install
3333```
3434
3535## CI/CD
36- - ** Platforms:** Linux, Windows, macOS
36+ - ** Platforms in CI workflows :** Linux, Windows
3737- ** Python versions:** 3.10, 3.11, 3.12, 3.13, 3.14
3838- ** Workflows:** ` .github/workflows/ `
39- - ` conda-package.yml ` — main build/test pipeline
40- - ` build-with-clang.yml ` — Clang compatibility
39+ - ` conda-package.yml ` — main conda build/test pipeline
40+ - ` build-with-clang.yml ` — Linux Clang compatibility
4141 - ` pre-commit.yml ` — code quality checks
4242 - ` openssf-scorecard.yml ` — security scanning
4343
@@ -48,9 +48,9 @@ python setup.py install
4848## Usage
4949``` python
5050import mkl
51- mkl.set_num_threads(4 ) # Set global thread count
52- mkl.domain_set_num_threads(1 , " fft" ) # FFT functions run sequentially
53- mkl.get_version_string() # MKL version info
51+ mkl.set_num_threads(4 ) # Set global thread count
52+ mkl.domain_set_num_threads(1 , " fft" ) # FFT functions run sequentially
53+ mkl.get_version_string() # MKL version info
5454```
5555
5656## How to work in this repo
@@ -62,12 +62,13 @@ mkl.get_version_string() # MKL version info
6262
6363## Code structure
6464- ** Cython layer:** ` _mkl_service.pyx ` + ` _mkl_service.pxd ` (C declarations)
65- - ** C init:** ` _mklinitmodule.c ` handles MKL library loading (RTLD_GLOBAL)
65+ - ** C init:** ` _mklinitmodule.c ` handles Linux preloading (` dlopen(..., RTLD_GLOBAL) ` ) for MKL runtime
66+ - ** Windows loading helper:** ` _init_helper.py ` handles DLL path setup in Windows venv
6667- ** Python wrapper:** ` __init__.py ` imports ` _py_mkl_service ` (generated from ` .pyx ` )
6768- ** Version:** ` _version.py ` (dynamic via setuptools)
6869
6970## Notes
70- - RTLD_GLOBAL required for MKL on Linux (handled by ` RTLD_for_MKL ` context manager)
71+ - RTLD_GLOBAL preloading is required on Linux (handled by ` RTLD_for_MKL ` context manager)
7172- MKL must be available at runtime (conda: mkl, pip: relies on system MKL)
7273- Threading functions affect NumPy, SciPy, and other MKL-backed libraries
7374
0 commit comments