Requires JuliaLang/Distributed.jl#9
On the worker:
using PersistentWorkers
start_worker_loop(port; cluster_cookie="<cookie>")
Then set up the head node:
using Distributed, PersistentWorkers
cluster_cookie("<cookie>")
Add the worker on the head node using:
addprocs(PersistentWorkerManager(port))
and then proceed as with any other worker.
Persistent workers can be removed again using rmprocs
as usual with the one difference that the worker process is not getting killed, so the same worker can simply be added again at a later point.