JuliaParallel / JuliaParallel/DistributedArrays.jl

Expand documentation

未关闭
#115 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Julia
星标
205
派生
34
PR 合并指标
30 天内没有已合并 PR

描述

We are finding the documentation for DistributedArrays to be lacking in a few ways:

1. There is no description of the actual DistributedArray type. It would be helpful to know how DistributedArrays are stored across processes. A lot of people who are using DistributedArrays are experienced at distributed programming, and will find it helpful to know how things are implemented. For instance, it would be helpful to get an idea (without looking at the source code) of how the local parts are tied together in a single type.

2. When are values copied/not copied? For example:
```julia
da = dzeros(100,100)
sa = da[1:10, 35:50]
out = convert(DArray, sa)
```
Does the last line here copy the values of `sa`? More generally, information about performance would be really useful, as well as some performance tips.

3. Expound a bit more on DArray constructor. Perhaps an example somewhere between `dfill` and the Game of Life would help, like this:

```julia
procs = addprocs(5)

# Construct a DArray
da = DArray((2,5), procs, [1,5]) do I
# construct a local part
localpart = Array{Float64}(2,1)
for i in first(I) # first(I) = 1:2
localpart[i] = i
end
return localpart
end
```

It would help to describe this example as follows:

This DArray is distributed so that each of 5 processes holds one column. `I` is a tuple of indices describing the indices of the DArray that reside on a given process. On the first process, `I = (1:2,1:1)`. In the `init` function, we construct the local column as a regular `Array` and return it to the `DArray` constructor. Note that it is important to return `localpart`: if we don't do this, then Julia returns the last variable that was assigned, which is `localpart[2]` - but the `DArray` constructor is expecting an array.

cc @pearlzli

贡献指南

这个仓库没有索引到贡献指南

调研方向

未指定文档文件或测试。首先定位现有的 DistributedArrays 文档和 DArray 构造器相关材料,然后查看当前的 dzeros、切片、转换和构造器示例。完成的标准是记录 DistributedArray 的存储方式、复制行为和性能指导,并添加一个更清晰的中间构造器示例及其进程索引说明。

由索引模型根据 Issue 内容生成。

评估

技术栈
julia
领域
distributed-systems, documentation
Issue 类型
文档
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。