What about shared array?
On Wednesday, May 27, 2015 at 6:03:46 PM UTC-4, Stefan Karpinski wrote: > > Since Julia doesn't at this point have shared memory parallelism, you > can't do this. > > On Wed, May 27, 2015 at 4:28 PM, Diogo Gobira <[email protected] > <javascript:>> wrote: > >> >> What's the best (if it's possible) way to parallelize recursive calls on >> a recursive data structure, like a tree, allowing all the workers to update >> the nodes they received as parameter on the recursive function calls. My >> code is similar to this: >> >> function apply_simulation(node,data) >> #Do sometinhing with the root node >> do_something(node) >> for i=1:length(node.childs) >> # Call recursivelly on each child >> apply_simulation(node.child[i],data) >> end >> end >> >> I would like to use @parallel, as shown in the code bellow. Is it >> possible for my tree object be visible and writable for all workers? >> >> function apply_simulation(node,data) >> #Do something with the root node >> do_something(node, data) >> *@parallel* for i=1:length(node.childs) >> # Call recursivelly on each child >> apply_simulation(node.child[i],data) >> end >> end >> >> Thanks! >> >> >
