Thomas Leyshon
Thomas Leyshon

Reputation: 107

Number of available threads in Julia?

In Julia is it still the case that the number of threads that can be created is limited by the number of physically available cores? Or has Julia lang changed since March so that the number of threads is limited to the number of logical cores?

Upvotes: 6

Views: 4428

Answers (1)

giordano
giordano

Reputation: 8344

The restriction was lifted with PR #36778, so in Julia master (what in a few months will become v1.6) you can start Julia with as many threads as you want:

% julia-master --threads 20 -q
julia> using Base.Threads

julia> nthreads()
20

You can use --threads auto (or -t auto) to start Julia with the number of threads available on the system:

% julia-master --threads auto -q                
julia> using Base.Threads

julia> nthreads()
8

Upvotes: 8

Related Questions