0

My basic Python ray knowledge is slowly growing but now I could need some theroretical help.

To keep things simple, I converted my situation to this Example:

I want to count from 1 to 100 by distributed computing by ray.

10 tasks were started to count a segment to 10. So

Task[0] counts from 1-10, 
Task[1] counts from 11-19, 
Task[2] counts from 21-29, 
...

When I take the results from the finished_tasks by ray.get, the List is naturally in the wrong order.

[21,22,23...]
[71,72,73...]
[11,12,13...]
...

Without the possibility to simply sort the results afterwards (because my RL results are coordinates), my only Idea is to KNOW which task have which results, ask ray.get in the right sequence and push the result to the correct place.

But... I cannot search(index) by ObjectID in the list.

I need to have a string to search. But I always fail to convert/index the ObjectID to string.

Does anyone of you an idea how to do this? Or an alternative way?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Rene Munsch
  • 23
  • 1
  • 5
  • `ray.get` should keep the right order. To make sure I understood your question, does your script look like this? `ray.get([task.count.remote() for task in tasks])`? – Sang Jun 22 '20 at 06:02
  • No, I (try to) handle creating tasks and geting data seperately: ` #create the tasks for i in range(0, latsteps-openingN-openingS): vertices_result_ids.append(doVertices.remote(i,vertexes_object_id)) # get results from finished tasks while len(vertices_result_ids): vertices_done_id, vertices_result_ids = ray.wait(vertices_result_ids) vertices = np.concatenate((vertices,ray.get(vertices_done_id[0]))) ` – Rene Munsch Jun 22 '20 at 20:02

0 Answers0