Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix incorrect documentation of nthreads #53117

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

MasonProtter
Copy link
Contributor

Since #49094, the docstring of nthreads has been incorrect. It currently states that

The threads in default have id numbers 1:nthreads(:default).

whereas that is no longer true:

julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid())
3-element Vector{Int64}:
 1
 2
 3

julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid())
6-element Vector{Int64}:
 4
 5
 6
 7
 8
 9

@carstenbauer
Copy link
Member

Should be backported to 1.9 and 1.10 I think.

@MasonProtter MasonProtter added docs This change adds or pertains to documentation multithreading Base.Threads and related functionality backport 1.9 Change should be backported to release-1.9 backport 1.10 Change should be backported to the 1.10 release labels Jan 30, 2024
@vtjnash vtjnash merged commit 95ae27f into JuliaLang:master Jan 31, 2024
7 checks passed
@MasonProtter MasonProtter deleted the patch-16 branch January 31, 2024 18:24
KristofferC pushed a commit that referenced this pull request Feb 6, 2024
Since #49094, the docstring of
`nthreads` has been incorrect. It currently states that

> The threads in default have id numbers `1:nthreads(:default)`.

whereas that is no longer true:
```julia
julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid())
3-element Vector{Int64}:
 1
 2
 3

julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid())
6-element Vector{Int64}:
 4
 5
 6
 7
 8
 9
```

(cherry picked from commit 95ae27f)
@KristofferC KristofferC mentioned this pull request Feb 6, 2024
9 tasks
@KristofferC KristofferC removed the backport 1.10 Change should be backported to the 1.10 release label Feb 6, 2024
KristofferC added a commit that referenced this pull request Feb 6, 2024
A few stragglers.

Backported PRs:
- [x] #53091 <!-- Ensure elision of `require_one_based_indexing` with
high-dim array views -->
- [x] #53117 <!-- Try to fix incorrect documentation of `nthreads` -->
- [x] #52855 <!-- Fix variable name in scaling an `AbstractTriangular`
with zero alpha -->
- [x] #52952 <!-- [REPLCompletions] enable completions for `using
Module.Inner|` -->
- [x] #53101 <!-- Inplace transpose for unit Triangular may skip
diagonal -->

Need manual backport:
- [ ] #52505 <!-- fix alignment of emit_unbox_store copy -->

Non-merged PRs with backport label:
- [ ] #53125 <!-- coverage: count coverage where explicitly requested by
inference only -->
- [ ] #52694 <!-- Reinstate similar for AbstractQ for backward
compatibility -->
- [ ] #51479 <!-- prevent code loading from lookin in the versioned
environment when building Julia -->
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Jun 7, 2024
Since JuliaLang#49094, the docstring of
`nthreads` has been incorrect. It currently states that

> The threads in default have id numbers `1:nthreads(:default)`.

whereas that is no longer true:
```julia
julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid())
3-element Vector{Int64}:
 1
 2
 3

julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid())
6-element Vector{Int64}:
 4
 5
 6
 7
 8
 9
```

(cherry picked from commit 95ae27f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.9 Change should be backported to release-1.9 docs This change adds or pertains to documentation multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants