More detail:
Given file exper.jl being
require("ee.jl")
wsum = @parallel (+) for ii in 1:16384
sq(ii)
end
and ee.jl being
function sq(n)
n*n
end
terminal session gives
julia> include("exper.jl")
1466149724160
but:
nohup ../julia/julia -p 32 < exper.jl &
yields a cascade of these:
exception on 5: ERROR: sq not defined
in anonymous at no file:3
in anonymous at multi.jl:1279
in anonymous at multi.jl:848
in run_work_thunk at multi.jl:621
in run_work_thunk at multi.jl:630
in anonymous at task.jl:6
Note that the manual clearly states:
"To make your code available to all processes, the require function will
automatically load a source file on all currently available processes..."
so I'm at a loss to know why this didn't work.
Thanks, tcp
On Friday, August 29, 2014 10:15:54 AM UTC-7, Travis Porco wrote:
>
> Hello--I'd like to be able to run something like this:
> nohup ../julia/julia -p 32 < mscript.jl
> where inside mscript.jl, I would like each worker to read in and have
> access to a large script (something like require("analysis.jl") )
> and then call a function defined in my own file, nside which various
> pieces of a computation are done in parallel.
> Does anyone have a working example? Nothing I have tried has worked (I
> must have just misunderstood the manual).
> Thanks.
>