Your example works fine for me:
julia-av/base [jcb/arrayview●] » julia -p 10 exp.jl
wsum => 1466149724160

Does it still fail with a smaller processor count.

Does the interactive version work?

julia-av/base [jcb/arrayview●] » julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0 (2014-08-20 20:43 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-apple-darwin13.3.0

julia> addprocs(10)
10-element Array{Any,1}:
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11

julia> @everywhere function sq(n)
           n * n
       end

julia> wsum = @parallel (+) for ii in 1:16384
          sq(ii)
       end
1466149724160

On Friday, August 29, 2014 8:45:01 PM UTC-4, Travis Porco wrote:
>
> 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.
>>
>

Reply via email to