# Distributed Array partition index

**URL:** <https://discourse.julialang.org/t/distributed-array-partition-index/53776>\
**Category:** General Usage\
**Tags:** distributed\
**Created:** [January 22, 2021, 10:56am UTC](https://discourse.julialang.org/t/distributed-array-partition-index/53776 "2021-01-22T10:56:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthiasbe](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Post date:** [January 22, 2021, 10:56am UTC](https://discourse.julialang.org/t/distributed-array-partition-index/53776/1 "2021-01-22T10:56:47Z")

</div>

Hi,

I’m using `DistributedArrays`.

Is there a way to obtain the local index of a partition in the partition grid ? It would be like the hypothetical `local_partition_index()` method below.

```julia
using DistributedArrays

A = drand((100,100), workers()[1:4], (2,2))

# index should contain (1,1)
index = @fetchfrom workers()[1] local_partition_index(A) 

# index should contain (1,2)
index = @fetchfrom workers()[2] local_partition_index(A) 

# index should contain (2,1)
index = @fetchfrom workers()[3] local_partition_index(A) 

# index should contain (2,2)
index = @fetchfrom workers()[4] local_partition_index(A) 

```

Have a nice day  
Matthias

---

<div class="post-metadata">

**Author:** ![matthiasbe](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Post date:** [February 11, 2021, 11:01pm UTC](https://discourse.julialang.org/t/distributed-array-partition-index/53776/2 "2021-02-11T23:01:17Z")

</div>

I was able to do this using

```julia
index = findall(x -> x == workers()[3], procs(A))

```
