JuliaParallel / JuliaParallel/DistributedArrays.jl

`distribute` no longer works on ranges

Offen
#190 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
205
Forks
34
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I believe this used to work, but now gives
```
julia> distribute(1:100)
MethodError: no method matching UnitRange{Int64}(::Array{Int64,1})
Closest candidates are:
UnitRange{Int64}(::Any, !Matched::Any) where T<:Real at range.jl:255
UnitRange{Int64}(!Matched::UnitRange{T<:Real}) where T<:Real at range.jl:846
UnitRange{Int64}(!Matched::UnitRange) where T<:Real at range.jl:847
...

Stacktrace:
[1] empty_localpart(::Type, ::Int64, ::Type) at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:66
[2] macro expansion at ./task.jl:264 [inlined]
[3] macro expansion at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:84 [inlined]
[4] macro expansion at ./task.jl:244 [inlined]
[5] DArray(::Tuple{Int64,Int64}, ::Function, ::Tuple{Int64}, ::Array{Int64,1}, ::Array{Tuple{UnitRange{Int64}},1}, ::Array{Array{Int64,1},1}) at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:82
[6] DArray(::Function, ::Tuple{Int64}, ::Array{Int64,1}, ::Array{Int64,1}) at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:169
[7] #distribute#61(::Array{Int64,1}, ::Array{Int64,1}, ::Function, ::UnitRange{Int64}) at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:501
[8] distribute(::UnitRange{Int64}) at /home/jeff/.julia/packages/DistributedArrays/XV7NS/src/darray.jl:494
[9] top-level scope at In[18]:1
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduce the failure with `distribute(1:100)` and inspect `src/darray.jl`, especially `empty_localpart` around line 66 and the `distribute` methods around lines 494-501. Compare the failing range path with the stack trace and verify that distributing a `UnitRange` completes without the reported `MethodError`.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia
Bereich
distributed-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.