I sometimes generate arrays using array comprehension syntax like this:

array = [func(a,k) for a in 0.0:0.01:1.0, k in 0.0:0.01:1.0];

or alternately using `broadcast` like this:

array = broadcast(func, linspace(0,1,101)', linspace(0,1,101))

This is the Julia equivalent to the following Mathematica code:

array = Outer[func, Range[0,1,0.01], Range[0,1,0.01]];

To parallelize in Mathematica, you typically wrap the expression in 
`Parallelize`:

array = Parallelize[Outer[func, Range[0,1,0.01], Range[0,1,0.01]]];

Is there a simple way to "parallel broadcast" or "parallel array 
comprehension" in Julia yet? I know I could manually chop the workload into 
chunks, and then feed them to available worker processes using `@spawnat`, 
and then fuse the results together into one large array, but I was 
wondering if there was a non-kludgy way to automatically distribute array 
comprehension syntax.

Reply via email to