I have found some resources on this online, but nothing which I actually is able to understand fully.
I want to enable multiple cores when I run JupyterLab (also notebooks).
This link (Setting JULIA_NUM_THREADS in an IJulia kernel) tells be that I am supposed to set
ENV["JULIA_NUM_THREADS"] = 4
However, where and how? This seems to be an environmental variable. I can read about these here https://docs.julialang.org/en/v1/manual/environment-variables/index.html#Parallelization-1. However, either that page is not supposed to tell me what I need to know, or it fails to do so. Finally it seems like the juliarc.jl file might be interesting.
However, I am still not sure where to find it and how to change it (and a confirmation whenever this is the one I am looking for). This link seems to contain something (https://github.com/JuliaLang/julia/issues/26215), however, my .julia folder does not contain a config folder.
(I tried simply creating one, but a juliarc.jl file in it with the single line
ENV["JULIA_NUM_THREADS"] = 4, did not work).
Finally, this link gives me more info (https://stackoverflow.com/questions/52175314/where-is-juliarc-the-julia-startup-file). I can find the startup.jl file in the install folder (for julia-1.0.0, will this change when I update to e.g. julia-1.0.3. If so, will I have to redo stuff?). The startup.jl file looks like this:
# This file should contain site-specific commands to be executed on Julia startup; # Users may store their own personal commands in `~/.julia/config/startup.jl`. import Pkg
Is it this I should make changes to, or the non-existing “local” file in .julia/config?
Am I right that
- There is some file, somewhere, to which I must make a change to enable multiple cores in Juyter (preferable without specifying something every time I start Jupyter). If so, where is this file?
- In that file I should add a line
ENV["JULIA_NUM_THREADS"] = 4(possibly replacing
4with another integer, depending on how many cores I want to use).