JuliaLang/julia

julia -p 2 option ignores the --startup-file=no option

Closed this issue · 2 comments

Example, using a .juliarc.jl that contains only error("Don't include me!"):

> ./julia -q --startup-file=no -e "println(nworkers())"
1

> ./julia -q -p 2 --startup-file=no -e "println(nworkers())"
ERROR: LoadError: Don't include me!
 in error(::String) at ./error.jl:21
 in include_from_node1(::String) at ./loading.jl:426
 in try_include at ./client.jl:200 [inlined]
 in load_juliarc() at ./client.jl:278
 in process_options(::Base.JLOptions) at ./client.jl:216
 in _start() at ./client.jl:318
while loading /Users/rrock/.juliarc.jl, in expression starting on line 1
ERROR: LoadError: Don't include me!
 in error(::String) at ./error.jl:21
 in include_from_node1(::String) at ./loading.jl:426
 in try_include at ./client.jl:200 [inlined]
 in load_juliarc() at ./client.jl:278
 in process_options(::Base.JLOptions) at ./client.jl:216
 in _start() at ./client.jl:318
while loading /Users/rrock/.juliarc.jl, in expression starting on line 1

[hangs here]

Ref #17708

To be a bit more specific - the launched workers ignore .juliarc.jl startup-file option and hence the issue.

Proposing a solution:

  • workers never load a startup file, i.e., workers have an implicit --startup-file=no
  • startup-file option is processed after -p and --machinefile options
  • The startup-file is only loaded on master. And since it is loaded after the cluster is setup, parallel code / cluster wide package loading can be part of the startup-file.