Prefix the function definition with @everywhere and it should work.

On Thu, Oct 15, 2015 at 5:06 PM, Matthew Pearce <[email protected]>
wrote:

> Hello
>
> I was wondering if there was a way to send dynamically generated code over
> the network?
>
> This is the kind of thing I am imagining to get bar() loaded on worker
> processes:
>
>
>
>
>
>
>
>
>
>
>
>
> *workrs = addprocs(4)function foo(x)   function bar(y)       x*y   end
> barendbar = foo(2)[@spawnat w bar for w in workrs]  #raises error bar() not
> available*
>
> If *bar* were a data object then I understand (perhaps wrongly) from the
> docs it would have been transferred.
>
> Much appreciated
>
> Matthew
>

Reply via email to