im trying to use Multi-Threadding (or better Multi-Processor) in Julia-Lang. Just using Base.Threads just made my Application Slower so i wanted to try Distributed.
module Parallel
# ... includes ..
using Distributed
@Distributed.everywhere include("...jl")
#... Includes Needed in Proccesses
export loop_inner
@Distributed.everywhere function loop_inner(parentValue, value, i, depth)
...
end
function langfordSequence(parentValue, depth)
...
if depth < 4 && depth > 1
futures = [@spawnat :any loop_inner(parentValue, value, i, depth) for i = 0:possibilites]
return sum(fetch.(futures))
% 2) PROBLEMATIC LINE ^^
else
return sum([loop_inner(parentValue, value, i, depth) for i = 0:possibilites])
% 1) PROBLEMATIC LINE ^^
end
end
end
But i run into
$julia -L ...jl -L Parallel.jl main.jl -p 8
ERROR: LoadError: UndefVarError: loop_inner not defined (At Line [see Code Above at % 1) PROBLEMATIC LINE ^^ )
I hope someone can tell me what im doing wrong.
If im chaning if depth < 4 && depth > 1 to if depth < 4 im getting UndefVarError: Parallel not defined (At Line [see Code Above at % 2) PROBLEMATIC LINE ^^ )
Ty in advance