# Not distributed on ray cluster case

**URL:** <https://discuss.ray.io/t/not-distributed-on-ray-cluster-case/8197>\
**Category:** Ray Core\
**Created:** [November 9, 2022, 7:48am UTC](https://discuss.ray.io/t/not-distributed-on-ray-cluster-case/8197 "2022-11-09T07:48:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JungWoo\_Woo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jungwoo_woo/32/3406_2.png) [@JungWoo\_Woo](https://discuss.ray.io/u/JungWoo_Woo)\
**Post date:** [November 9, 2022, 7:48am UTC](https://discuss.ray.io/t/not-distributed-on-ray-cluster-case/8197/1 "2022-11-09T07:48:04Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

import numpy as np  
from collections import namedtuple  
import ray  
ray.init(address=‘auto’)

callback\_entry = namedtuple(“callback\_entry”, [‘index’, ‘value’])  
result\_list =   
def gathering\_results\_callback(entry):  
result\_list[entry.index] = entry.value

@ray.remote  
def f(N,temp\_index):

```
G = np.random.randint(2, size=(N,N))

temp = np.mean(G)
print(temp)
return callback_entry(index = temp_index , value = temp)

```

result\_list = np.zeros(500)

#A = np.random.randint(2, size=(4848,4848))  
#ray\_param1 = ray.put(A)  
object\_ids = [f.remote(4848 , temp\_index) for temp\_index in range(500)]

results\_from\_ray = ray.get(object\_ids)

for entry in results\_from\_ray:  
gathering\_results\_callback(entry)

ray.shutdown()

(f pid=1593763) 0.5000828401218834  
(f pid=1593849) 0.5001061987386858  
(f pid=1593765) 0.49998412975579737  
(f pid=1593762) 0.499826873931205  
(f pid=1593764) 0.49983317097180013  
(f pid=893711, ip=192.168.0.50) 0.49989716251946975  
(f pid=893749, ip=192.168.0.50) 0.499998553382566  
(f pid=893792, ip=192.168.0.50) 0.5001467891219815  
(f pid=893996, ip=192.168.0.50) 0.5000005531184306  
(f pid=893952, ip=192.168.0.50) 0.5000345486281301  
(f pid=893767, ip=192.168.0.50) 0.5001600214167456  
(f pid=894006, ip=192.168.0.50) 0.4998263633603459  
(f pid=894033, ip=192.168.0.50) 0.5000307618942588  
(f pid=893845, ip=192.168.0.50) 0.500012423890904  
(f pid=893788, ip=192.168.0.50) 0.5000119133200449  
(f pid=894127, ip=192.168.0.50) 0.49988690855471685  
(f pid=894087, ip=192.168.0.50) 0.49998034302192595  
(f pid=893743, ip=192.168.0.50) 0.49992073387413  
(f pid=893712, ip=192.168.0.50) 0.49983232002036837  
(f pid=893715, ip=192.168.0.50) 0.4999438797530743  
(f pid=893725, ip=192.168.0.50) 0.4998882700770077  
(f pid=893708, ip=192.168.0.50) 0.49990222568048887

import numpy as np  
from collections import namedtuple  
import ray  
ray.init(address=‘auto’)

callback\_entry = namedtuple(“callback\_entry”, [‘index’, ‘value’])  
result\_list =   
def gathering\_results\_callback(entry):  
result\_list[entry.index] = entry.value

@ray.remote  
def f(G,temp\_index):

```
#G = np.random.randint(2, size=(N,N))
temp = np.mean(G)
print(temp)
return callback_entry(index = temp_index , value = temp)

```

result\_list = np.zeros(500)

A = np.random.randint(2, size=(4848,4848))  
ray\_param1 = ray.put(A)

object\_ids = [f.remote(ray\_param1 , temp\_index) for temp\_index in range(500)]

results\_from\_ray = ray.get(object\_ids)

for entry in results\_from\_ray:  
gathering\_results\_callback(entry)

ray.shutdown()
