Hi Ethan,
Hmmm this is odd, in general you shouldn't need to explicitly send
variables you read in a parallel for loop to other processors. For example:
julia> addprocs(4)
4-element Array{Any,1}:
2
3
4
5
julia> args1 = 1
1
julia> @parallel (+) for i=1:10 args1 end
10
Can you provide a runnable example of where this doesn't work for you?
—James
On Saturday, May 3, 2014 9:31:50 AM UTC-5, Ethan Anderes wrote:
>
> I have a very simple parallel problem but I'm having a hard time executing
> what I want. I'm basically just filling up a large array with @parallel as
> follows:
>
> addprocs(10)
> require("functions.jl")
> biglist = @parallel (vcat) for k=1:procs
> smalllist(args1, args2,...)
> end
>
> smalllist (defined in functions.jl) returns an Vector{Float64} and I'm
> just stacking them together to make biglist. My problem is that I can't
> seem to get args1 and args2 to the other processors. I would like something
> like put! but I don't have a RemoteRef to send it to. I've also thought
> about defining args1, args2 etc in functions.jl but (a) it's an unnatural
> place to put these definitions and (b) in the construction of args1, args2
> I make calls to rand() and I'm worried args1, args2 will be different for
> each processor. I've tried @everywhere but there is a lot of code going
> into the construction of args1, args2 and I don't want 100 lines of code
> with @everywhere sending all the unnecessary temporary variables to each
> proc. I guess I'm looking for something like
>
> @shareall args1, args2, ...
> or
> @sendall args1, args2, ...
>
> Any help would me much appreciated. BTW: it would be especially nice if I
> didn't have to send args1, args2 at all, just make them visible with
> shared memory.
>
>