Skip to content

Conversation

@elenafuengar
Copy link
Collaborator

📝 Pull Request Summary

Added multithreading documentation to intallation guide

🔧 Changes Made

CPU Multithreading

To achieve multithreading for Wakis sparse matrix x vector operations, the Intel-MKL backend has been implemented as an alternative to single-threaded scipy.sparse.dot. To install it in your conda environment simply do:

conda create --name wakis-env python=3.12 numpy scipy mkl mkl-service
pip install sparse_dot_mkl
pip install wakis['notebook']

Wakis will detect that the package is installed and use it as default backend. To control the number of threads and memory pinning, one can add the following lines to your python script before the imports:

# [!] Set before importing numpy/scipy/mkl modules
import os
os.environ["OMP_NUM_THREADS"] = str(os.cpu_count())       # Number of OpenMP threads
os.environ["KMP_AFFINITY"] = "balanced,granularity=fine"  # Thread pinning

📌 Related Issues / PRs

Closes #39

@elenafuengar elenafuengar merged commit 86ab32d into main Nov 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MKL multithreading installation to documentation

2 participants