I understand that I can do set JULIA_NUM_THREADS=4 in cmd in the location of julia.exe.
This works as long as I use cmd (notably it does not work with Powershell, why?)
However, if I invoke a julia process in vs-code I seem stuck with 1 thread. Any ideas?
I would think that if you set that environmental var before you start VS Code, it should be inherited by the julia process that gets started by VS Code. But not sure...
I'm changing the title of this issue here to add a config feature to set this in VS Code directly, which would be a nice enhancement.
I have export JULIA_NUM_THREADS=8 in my .bashrc, and interestingly, running "Julia: start REPL" has ENV["JULIA_NUM_THREADS"] of 1, but if instead I Open New External Terminal (cmd-shift-c) and launch julia from there, it's 8.
FWIW, I'm running over ssh
We actually have a setting at this point for the extension called NumThreads, and that overrides anything you might have configured outside of VS Code. So you just need to set that setting.
Having said that, it would probably be nicer if the VS Code setting by default was empty, and in that case any externally set value for JULIA_NUM_THREADS would apply, and only if one actually configures a value in the extension would it override the env var.
His is now implemented.
Most helpful comment
We actually have a setting at this point for the extension called
NumThreads, and that overrides anything you might have configured outside of VS Code. So you just need to set that setting.Having said that, it would probably be nicer if the VS Code setting by default was empty, and in that case any externally set value for
JULIA_NUM_THREADSwould apply, and only if one actually configures a value in the extension would it override the env var.