The first one is easy to solve; function definitions aren't moved 
implicitly like data is, if you use:

@everywhere foo(a) = sin(a)

To make the definition happen on all worker processes then it works.

As to the second issue I'm not sure what's wrong. Based on the description 
of @parallel in the manual this is arguably a bug, I'd suggest filing an 
issue on github if no one else chimes in here.

On Saturday, May 3, 2014 9:37:00 PM UTC-5, Ethan Anderes wrote:
>
> There also seems to be a scope issue as well. The following throws an 
> error that `a` is not defined. I guess it's because of the local scope but 
> I would hope this wouldn't be a problem for @parallel:
>
> runparl = true
> if runparl
>         addprocs(3)
>         a = rand(5)
>         x = @parallel (vcat) for k=1:3
>                 sin(a)
>         end
> end
>
>

Reply via email to