JULIA_NUM_THREADS in VS Code (Windows 10 + WSL)

I recently came across this thread:

about setting the environment variable JULIA_NUM_THREADS in Windows, and was wondering if anyone know how this would work in VS Code (context: I am using a computer with Windows 10 and the Linux subsystem). The only way I have gotten Julia to start with multiple threads is to start a new bash session in the same directory as julia.exe, but this is inconvenient for when I am writing code (VS Code by default starts a session in the workspace directory).

Any assistance would be appreciated. Thanks.

1 Like

You can set additional env variables for the julia REPL via the julia.additionalArgs setting of the Julia extension in VS Code.

1 Like

I apologize if this is obvious, but could be more specific about what to add to the setting.json?

What argument should be added there? just julia.JULIA_NUM_ThREADS ?

I think we added an explicit setting for the number of threads now, but it might currently only be on the alpha build for the next version, which you can try here. That is also the only version that works with Julia 1.3 currently.