Not distributed on ray cluster case

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()