Setting JULIA_NUM_THREADS in an IJulia kernel

Is there a way to set the JULIA_NUM_THREADS environment variable for the IJulia session or kernel?

1 Like

Just set ENV["JULIA_NUM_THREADS"] = 4 and start the notebook server.

5 Likes

To my knowledge it is not possible without restarting jupyter

What i normally do is

sh> export JULIA_NUM_THREADS=4
sh> jupyter notebook

I guess if you start IJulia from the REPL you can set it in ENV, since it will start a new julia process for the kernal

4 Likes

@kristoffer.carlsson and @oxinabox: both of these work, and make so much sense, thank you! It’s a mystery to me how I didn’t even try any of them before asking I was almost sure I tried them all, but it was only in my head! Thanks a lot.