ndarray-linalg icon indicating copy to clipboard operation
ndarray-linalg copied to clipboard

Feature flags for backend multithreading

Open termoshtt opened this issue 4 years ago • 0 comments

BLAS/LAPACK backends has multi-threading.

  • openblas-src has openmp flag to enable OpenMP
  • intel-mkl-src has mkl-static-lp64-iomp flag to link the multi-threaded static library

Problems

How to interact with Rust's multi-threading?

We often use multiple threads in Rust-hand to solve independent problems. In this case, LAPACK routines should run in sequential manner because multi-threading of a linear problem is less efficient than trivial parallel. Unfortunatelty, the LAPACK interface does not expose its threading option as argument, and we have to handle them using OpenMP interface e.g. omp_set_num_threads.

termoshtt avatar Feb 13 '21 07:02 termoshtt