ddata doesn't work as intended when length(data) = length(pids)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- julia
调研方向
从 ddata 入口点开始,比较其文档所述行为与所提供的复现示例,针对长度等于 worker 数量的数据,包括不带数据的 ddata()。使用 Distributed 和 DistributedArrays 重新运行这些示例;完成的标准是两种情况都能正常工作,不再出现所示的 TypeError 或 MethodError,同时文档所述行为保持准确。
由索引模型根据 Issue 内容生成。
描述
The documentation says the following about ddata:
The function
ddata(;T::Type=Any, init::Function=I->nothing, pids=workers(), data::Vector=[])can be used to created a distributed vector whose localparts need not be Arrays.
...
Argumentdataif supplied is distributed over thepids.length(data)must be a multiple oflength(pids). If the multiple is 1, returns aDArray{T,1,T}where T iseltype(data). If the multiple is greater than 1, returns aDArray{T,1,Array{T,1}}, i.e., it is equivalent to callingdistribute(data).
The case when "the multiple is 1" is giving me trouble:
julia> using Distributed; addprocs(2)
julia> using DistributedArrays
julia> ddata(data=["foo", "bar"])
2-element DArray{String, 1, String}:
ERROR: TypeError: in typeassert, expected String, got a value of type Char
...
julia> ddata()
ERROR: On worker 2:
MethodError: no method matching getindex(::Nothing, ::Int64)
...
Note that ddata works as intended for multiples greater than 1:
julia> ddata(data=["foo", "bar", "foo", "bar"])
4-element DArray{String, 1, Vector{String}}:
"foo"
"bar"
"foo"
"bar"
julia> ddata(;T=Any, init=I->nothing, pids=workers(), data=[nothing, nothing, nothing, nothing])
4-element DArray{Nothing, 1, Vector{Nothing}}:
nothing
nothing
nothing
nothing
First time posting an issue, hope I'm doing things right!
- 主要语言
- Julia
- 星标
- 205
- 派生
- 34
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaParallel/DistributedArrays.jl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
JuliaParallel/DistributedArrays.jl#255 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
JuliaParallel/DistributedArrays.jl#238 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 35/100
查看 JuliaParallel/DistributedArrays.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`可能已有人在做 @devmotion 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
JuliaStats/Distributions.jl#2117 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
TomerAberbach/profiler-md#970 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
grame-cncm/faust#1409 ·
维护者通常 1 天内回复