Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple chunks on one process #183

Open
r-barnes opened this issue Oct 1, 2018 · 1 comment
Open

Multiple chunks on one process #183

r-barnes opened this issue Oct 1, 2018 · 1 comment

Comments

@r-barnes
Copy link
Contributor

r-barnes commented Oct 1, 2018

I build a DArray as follows:

@everywhere using DistributedArrays
r1  = @spawnat 2 zeros(4,4) 
r2  = @spawnat 2 zeros(4,4) 
r3  = @spawnat 2 rand(4,4)
r4  = @spawnat 3 rand(4,4)
ras = [r1 r2; r3 r4]
D   = DArray(ras)

My expectation is that the output should have two 4x4 blocks of zeros and two 4x4 blocks of random numbers. Instead, I get three blocks of zeros and one block of random numbers:

8×8 DArray{Float64,2,Array{Float64,2}}:
 0.0  0.0  0.0  0.0  0.0         0.0       0.0       0.0     
 0.0  0.0  0.0  0.0  0.0         0.0       0.0       0.0     
 0.0  0.0  0.0  0.0  0.0         0.0       0.0       0.0     
 0.0  0.0  0.0  0.0  0.0         0.0       0.0       0.0     
 0.0  0.0  0.0  0.0  0.525043    0.321681  0.489682  0.586815
 0.0  0.0  0.0  0.0  0.569794    0.780382  0.542156  0.215128
 0.0  0.0  0.0  0.0  0.00308504  0.912877  0.179453  0.568009
 0.0  0.0  0.0  0.0  0.410886    0.333188  0.743346  0.969894
@vchuravy
Copy link
Member

vchuravy commented Oct 1, 2018

Jup that is a bug in the constructor:

localpart = isa(init, Function) ? init(idxs[localpartindex(pids)]) : fetch(init)

localpartindex(pids) assumes that there is only one chunk on a process and will return the first one.

@vchuravy vchuravy changed the title Possible Construction Error Multiple chunks on one process Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants