LoginSignup
5
3

More than 3 years have passed since last update.

Juliaがどうしても並列化したがるときの対処

Posted at

JuliaはLinearAlgebraを使っていると、勝手に並列化計算で効率化してくれる。
基本的には嬉しいが、CPU資源が限られているときにちょっと制限したい時もある。

結論を書くと

LinearAlgebra.BLAS.set_num_threads(4)

みたいに書くとCPU使用率が制限される。

ちなみに普通に"Julia 並列化"とかで調べると

julia -p 4

とか

export JULIA_NUM_THREADS=4

とかするらしいがLinearAlgebraは並列化をやめてくれなかった。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3