trixi-framework / trixi-framework/Trixi.jl
Avoid broadcasting (`.=`) in favor of `@threaded` ?
- Dominant language
- Julia
- Stars
- 731
- Forks
- 167
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 25
Description
I got reminded of this by https://github.com/trixi-framework/Trixi.jl/issues/2283
See for instance https://github.com/trixi-framework/Trixi.jl/pull/924
I also observe that
```julia
@threaded for i in eachindex(u)
u[i] = # Do stuff
end
```
is usually faster than
```julia
u .= # Do stuff
```
Unfortunately this broadcasting is used at many places:
https://github.com/search?q=repo%3Atrixi-framework%2FTrixi.jl+.%3D+path%3A%2F%5Esrc%5C%2F%2F&type=code
Contributor guide
Research direction
Review the linked Trixi.jl issue 2283 and pull request 924 first, then inspect the many `.=` uses under `src/` identified by the repository search. Determine which broadcasts are suitable for `@threaded` and how correctness and performance should be checked; done requires an agreed scope and validated replacements rather than a blanket change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100