JULIA_NUM_THREADS in VS Code (Windows 10 + WSL)

Just to answer this for anyone that finds this thread, I was using 1.7.2 Julia and the VSCode Julia extension v.1.6.6, and the nice box to change the number of threads wasn’t there. Instead there was a “Edit in settings.json” link.

I could change the threads in the terminal instance of Julia but it wouldn’t register in my Jupyter notebooks within VS Code. Eventually, I figured out the solution.

Here’s what I added to the settings.json file:

"julia.NumThreads": 12,
    "settingsSync.ignoredSettings": [
        "-julia.NumThreads"
    ],

Altogether, the settings.json file should look something like the following:

{
    # Probably has some settings for 
    # color schemes, zoomlevel, etc.

    # Then you should add these lines:
    "julia.NumThreads": 12,
    "settingsSync.ignoredSettings": [
        "-julia.NumThreads"
    ],
    
    
}
9 Likes