Q: is Distributed not supported in Pluto?

Q: is Distributed not supported in Pluto?

I am liking Pluto so far but today I ran into this:

Only process 1 can add and remove workers

  1. cluster_mgmt_from_master_check @ cluster.jl:974 [inlined]
  2. #addprocs#37 (::Base.Iterators.Pairs{Symbol,Any,NTuple{6,Symbol},NamedTuple{(:tunnel, :multiplex, :sshflags, :max_parallel, :exename, :dir),Tuple{Bool,Bool,Cmd,Int64,Cmd,String}}}, ::typeof(addprocs), ::Distributed.SSHManager)@ cluster.jl:440
  3. #addprocs#241 @ managers.jl:120 [inlined]
  4. top-level scope @ Local: 4
begin
	using Distributed
	workers = ["gcr@haz00"]
	addprocs(workers; tunnel=true, exename=`julia`, dir="/home/gcr", sshflags=`-i "~/.ssh/id_rsa"`)
end

Pluto uses Distributed.jl to launch a worker process for each notebook’s computations, and workers cannot have workers of their own, so no, it isn’t supported by default. There’s some discussion in this issue, including a keyword-argument workaround: https://github.com/fonsp/Pluto.jl/issues/300

5 Likes

Alas, I was liking Pluto so very much. But these show stoppers do occur from time to time. It’s all part of the game.

Thanks for the response.

import Pluto; Pluto.run(workspace_use_distributed=false)

Is this not working for you?

It has some drawbacks, therefore it is not the default, but none of them should be showstopper.

I saw in the issue #300 (linked above) that…

But this makes the notebook server unresponsive while any notebook is running code, and the stop button is disabled.

Still, I suppose it’s worth a try. I’ll let you know.

1 Like

I tried the suggestion (above).

begin
	using Distributed
	workers = ["gcr@haz00"]
	addprocs(workers; tunnel=true, exename=`julia`, dir="/home/gcr", sshflags=`-i "~/.ssh/id_rsa"`)
end

I got a process number back. Then I ran something simple and nothing, no response. The same in Jupyter works. I get the hostname as expected.

@everywhere println(gethostname())