Let's say I have 10 julia scripts, scripts = ["script1.jl", "script2.jl", ...., "script10.jl"] and I would like to run them in parallel in separate Julia sessions, but 4 at a time (since I only have 4 cores on my machine). Is there any way to do this programmatically?
I tried doing this:
addprocs(4)
pmap(include, scripts)
or
addprocs(4)
@parallel for s in scripts
include(s)
end
However, this seems to reuse the same session, so all the global consts in the script file are colliding. I would like to make sure that the namespaces are completely separate.
Thanks!