# Multi-threaded inverse of a matrix

**URL:** https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543
**Category:** General Usage
**Tags:** blas, multithreading, linearalgebra
**Created:** [April 15, 2022, 5:18pm UTC](https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543 "2022-04-15T17:18:32Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [April 15, 2022, 7:05pm UTC](https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543/3 "2022-04-15T19:05:16Z")

</div>

> [@fipelle](#):
>
> Inverses seem to be excluded from it - I suppose because they are based on LAPACK.

Inverses aren’t excluded, _because_ they’re based on BLAS/LAPACK (just as matmuls).

> [@fipelle](#):
>
> I was also curious to know if there are caps in terms of the number of threads than `LinearAlgebra` can support. As highlighted in a [different post](https://discourse.julialang.org/t/ideal-number-of-blas-threads/79197/3), I have also noticed that running `BLAS.set_num_threads(64)` does not actually imply that 64 threads will be used or initialised (in my experiment the cluster set 32 threads and it used about 10% of the total CPU - comprising 64 cores).

Yes, IIRC the max number of BLAS threads is set to 32 by Julia. This has changed in 1.8 where you can get, I believe, up to 512 BLAS threads. See [BLAS performance testing for Julia 1.8](https://discourse.julialang.org/t/blas-performance-testing-for-julia-1-8/69520)

---

_[View the full topic](https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543)._
