JuliaParallel / JuliaParallel/DistributedArrays.jl
Transfer of distributed structs when members are accessed
- 主要语言
- Julia
- 星标
- 205
- 派生
- 34
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hello,
Consider the following example:
```
@everywhere struct SS1
v::Vector{Float64}
m::Vector{Float64}
end
dSS=@DArray [SS1(rand(10),i*ones(10)) for i in 1:10]
dSS2=@DArray [SS1(rand(10^6),i*ones(10)) for i in 1:10];
@time dSS[2].m
@time dSS2[2].m;
0.004819 seconds (81 allocations: 4.094 KiB)
0.005085 seconds (210 allocations: 7.634 MiB)
```
As you see, the whole struct gets serialized (7 mb) and then `v` (small vector) can be accessed. Is there a way to implement this so that `dS[2].v` is sent without the whole `struct`.
Put in another way, is there a generic way to have `dS[i].m` mean something like `getm(dS,i)` where:
```
@everywhere function getm(dS,i)
indi=DistributedArrays.locate(dS,i)
pidi=procs(dS)[indi...]
lindi=i-dS.cuts[1][indi...]+1
@fetchfrom pidi dS[:L][lindi].m
end
```
Is this possible? Is it a reasonable feature to ask for :)?
Thanks!
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by reproducing the dSS[2].m and dSS2[2].m examples and tracing distributed indexing, serialization, and field access. Read DistributedArrays.locate, procs, dS.cuts, and the @fetchfrom example to assess whether member access can avoid transferring the full struct. Done means a documented, tested approach or a clear determination that generic field-level transfer is not feasible.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- julia
- 领域
- distributed-systems
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100