`distribute` no longer works on ranges

未關閉
#190 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
julia

研究方向

使用 distribute(1:100) 重現失敗,並檢查 src/darray.jl,尤其是第 66 行附近的 empty_localpart 以及第 494-501 行附近的 distribute 方法。將失敗的 range 路徑與 stack trace 進行比較,並驗證分發 UnitRange 時可以完成,且不會出現回報的 MethodError。

由索引模型根據 Issue 內容生成。

描述

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
主要語言
Julia
星號
205
分支
34
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

JuliaParallel/DistributedArrays.jl 的其他 Issue

查看 JuliaParallel/DistributedArrays.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。