I use Julia1.7 under Windows 10 and to start multiple threads according to the
It does not have the $
sign.
CodePudding user response:
You can't set the number of threads in an already running Julia session. As the comments suggests, you should pass the --threads
flag to julia
when starting, i.e. the command is entered in your shell (if you're on Windows most likely PowerShell, or the new Windows Terminal, or cmd).
If you are using either of the VSCode Julia extension or Juno (the older, Atom based Julia IDE) there are settings which allow you to choose the number of threads.
When using Jupyter notebooks through IJulia
, you can register a kernel with multiple threads by doing
julia> using IJulia
julia> installkernel("Julia (4 threads)", env = Dict("JULIA_NUM_THREADS" => "4"))
When working in Pluto notebooks, you can set the number of threads when starting the notebook like so:
Pluto.run(threads=16)