# Distributed § Dimensional Arrays

**URL:** <https://discourse.julialang.org/t/distributed-dimensional-arrays/49201>\
**Category:** General Usage\
**Tags:** distributed\
**Created:** [October 28, 2020, 6:55pm UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201 "2020-10-28T18:55:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyacykcharel](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@hyacykcharel](https://discourse.julialang.org/u/hyacykcharel)\
**Post date:** [October 28, 2020, 6:55pm UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201/1 "2020-10-28T18:55:33Z")

</div>

I’m trying to distribute this Array into 2 processes each should have 5 lines I mean from `zeros(10,10,10)` each should have `zeros(5,5,10)` can someone help? I need it to be distributed in Rows and not in Colon, please

```julia
y=zeros(10,10,10)
distribute(y; dist=(2,1,100))
 

Im getting this error ==>error BoundsError: attempt to access 2-element Array{Int64,1} at index [1:200]

```

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [October 29, 2020, 9:59am UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201/2 "2020-10-29T09:59:44Z")

</div>

This doesn’t seem like a valid distribution. You start with `zeros(10,10,10)` that has 1000 elements, and end up with 2 arrays `zeros(5,5,10)` that have 250 elements each? You have lost half your array.

Perhaps you want two arrays of size `(5,10,10)` on each processor? You can do it like this:

```julia
julia> y = zeros(10,10,10);

julia> yd = distribute(y; dist=(2,1,1));

julia> @fetchfrom 2 DistributedArrays.localindices(yd)
(1:5, 1:10, 1:10)

julia> @fetchfrom 3 DistributedArrays.localindices(yd)
(6:10, 1:10, 1:10)

```

---

<div class="post-metadata">

**Author:** ![hyacykcharel](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@hyacykcharel](https://discourse.julialang.org/u/hyacykcharel)\
**Post date:** [October 29, 2020, 5:14pm UTC](https://discourse.julialang.org/t/distributed-dimensional-arrays/49201/3 "2020-10-29T17:14:56Z")

</div>

wow Thanks
