JuliaParallel / JuliaParallel/DistributedArrays.jl

master_slave DArray copy

オープン
#132 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
205
フォーク
34
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

First, thank you for a great package!

I have had an issue with `copy` of `DArray` when connected in `master_slave` topology.

```julia
julia> addprocs(2,topology=:master_slave)
2-element Array{Int64,1}:
2
3

julia> nprocs()
3
julia> using DistributedArrays

julia> dd=drand((11,21,2,13),workers(),[1,1,1,2]);

julia> @eval @everywhere println(localindexes($dd))
(1:0,1:0,1:0,1:0)
From worker 2: (1:11,1:21,1:2,1:7)
From worker 3: (1:11,1:21,1:2,8:13)

julia> ddc=copy(dd);
ERROR: On worker 2:
peer 3 is not connected to 2. Topology : master_slave
...
```
I have shortened the error output, surely you can reproduce it.

Is there a reason why this is an error?

Especially that this works...
```julia

julia> dd=drand((11,21,2,13),workers(),[1,1,1,2]);

julia> @everywhere using DistributedArrays

julia> @eval ddc2=DArray(I->copy(localpart($dd)),$dd);

julia> sumabs2(ddc2-dd)
0.0

julia> @eval @everywhere println(localindexes($ddc2))
(1:0,1:0,1:0,1:0)
From worker 2: (1:11,1:21,1:2,1:7)
From worker 3: (1:11,1:21,1:2,8:13)

julia> @eval @everywhere println(localindexes($dd))
(1:0,1:0,1:0,1:0)
From worker 3: (1:11,1:21,1:2,8:13)
From worker 2: (1:11,1:21,1:2,1:7)
```
Finally, is there a reason why `similar` does not yield a `DArray` with the same distribution?

```julia
julia> dd=drand((11,21,2,13),workers(),[1,1,1,2]);

julia> @eval @everywhere println(localindexes($dd))
(1:0,1:0,1:0,1:0)
From worker 2: (1:11,1:21,1:2,1:7)
From worker 3: (1:11,1:21,1:2,8:13)

julia> ddc=similar(dd);

julia> @eval @everywhere println(localindexes($ddc))
(1:0,1:0,1:0,1:0)
From worker 2: (1:11,1:11,1:2,1:13)
From worker 3: (1:11,12:21,1:2,1:13)
```

I appreciate any help on this, and again thanks for the effort with this package!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reproducing the master_slave examples using DArray, copy, similar, and localpart as shown in the issue. Inspect the implementations and tests for DArray copy and similar, then verify behavior with the provided localindexes and sumabs2 checks. Done means copy and similar handle the reported distribution or clearly document the intended behavior.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia
領域
distributed-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。