# Help extracting only certain fields of non-array data

**URL:** <https://discourse.julialang.org/t/help-extracting-only-certain-fields-of-non-array-data/6540>\
**Category:** General Usage\
**Created:** [October 18, 2017, 10:45pm UTC](https://discourse.julialang.org/t/help-extracting-only-certain-fields-of-non-array-data/6540 "2017-10-18T22:45:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawbz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pawbz/32/2244_2.png) [@pawbz](https://discourse.julialang.org/u/pawbz)\
**Post date:** [October 18, 2017, 10:45pm UTC](https://discourse.julialang.org/t/help-extracting-only-certain-fields-of-non-array-data/6540/1 "2017-10-18T22:45:47Z")

</div>

```julia
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`
