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

help extracting only certain fields of non-array data #153

Closed
pawbz opened this issue Oct 18, 2017 · 2 comments
Closed

help extracting only certain fields of non-array data #153

pawbz opened this issue Oct 18, 2017 · 2 comments

Comments

@pawbz
Copy link

pawbz commented Oct 18, 2017

addprocs(4)
@everywhere type Temp
       a::Array{Float64}
       alarge::Array{Float64}
end

@everywhere using DistributedArrays
work=workers()
nwork=length(work)
pap=ddata(T=Temp, init=I->Temp([2.,3.,], randn(1000)), pids=work);

@everywhere function updatea!(temp::Temp)
       temp.a=[-1.,-1.,]
end

extracta=[[0.,0.] for iw in 1:nwork]

@everywhere function updatec!(ip,temp::Temp, extracta)
       extracta[ip]=copy(temp.a)
end


for (ip, p) in enumerate(procs(pap))
 @sync remotecall_wait(p) do
        println(localpart(pap).a)
        updatea!(localpart(pap))
        updatec!(ip,localpart(pap),extracta)
        println(localpart(pap).a)
 end
end
println(extracta)
  • I want extracta to have a's of all the localparts

  • Why doesn't this happen?

  • How can I extract only certain fields of a distributed array of non-array data?

  • Here, the field alarge has a huge dimension and I like to avoid transfer of this field between processors to minimize data transfer.

  • Note that the modifications I do to field a are dependent on alarge

@andreasnoack
Copy link
Member

Please ask usage questions at discourse.julialang.org

@pawbz
Copy link
Author

pawbz commented Oct 18, 2017

Sorry, I thought it would be a feature request. Will take it on discourse.

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