Julia-vscode: Add config to set number of threads used by julia process

Created on 12 Jul 2018  路  4Comments  路  Source: julia-vscode/julia-vscode

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?

enhancement

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_THREADS would apply, and only if one actually configures a value in the extension would it override the env var.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PetrKryslUCSD picture PetrKryslUCSD  路  29Comments

barche picture barche  路  38Comments

davidanthoff picture davidanthoff  路  28Comments

scls19fr picture scls19fr  路  40Comments

davidanthoff picture davidanthoff  路  25Comments