DistributedAdhoc.activate
— Methodactivate(remote_dir, pid; [instantiate=false])
Activate the Julia environment at remote_dir
at worker pid
. Optionally, instantiate
the environment afterwards.
DistributedAdhoc.host_to_pids_dict
— Methodhost_to_pids_dict()
Determine the host-worker mapping and return it as a Dict
of hostname => [pids...]
.
DistributedAdhoc.send_dir
— Methodsend_dir(local::String, pid::Int; include::Vector{String})
send_dir(local => remote, pid::Int; include::Vector{String})
Send the directory local
from the current machine to the pid
worker, saving as the remote
path.
If the remote
path isn't specified, creates a temporary directory at the target worker. Returns the full path to the created directory.
include
is a list of file patterns to send, as accepted by Glob.jl
.
DistributedAdhoc.send_env_activate
— Methodsend_env_activate([local_dir], pid; [instantiate=true], include)
Send the local Julia environment to the worker pid
, activate and optionally instantiate
it.
Uses the current active project environment dirname(Base.active_project())
if local_dir
is omitted.
include
is a list of file patterns to send, as accepted by Glob.jl
.
DistributedAdhoc.send_env_activate_everywhere
— Functionsend_env_activate_everywhere([local_dir]; include)
Send the local Julia environment to all available workers, activate and instantiate it there.
Instantiates the environment using a single worker at each host, other workers just activate the created env.
Uses the current active project environment dirname(Base.active_project())
if local_dir
is omitted.
include
is a list of file patterns to send, as accepted by Glob.jl
.
Example
Send the current Julia environment, including source code in src
, developed packages (in ./dev
), scripts (in ./scripts
), and CSV files (in ./data
):
DistributedAdhoc.send_env_activate_everywhere(include=[
"*.toml", "src/*.jl", "scripts/*.jl",
"dev/*/*.toml", "dev/*/src/*.jl", "dev/*/src/*/*.jl",
"data/*.csv",
])
DistributedAdhoc.send_file
— Methodsend_file(local::String, pid::Int)
send_file(local => remote, pid::Int)
Send the file local
from the current machine to the pid
worker, saving as the remote
path. The parent directory of remote
should already exist.
If the remote
path isn't specified, creates a temporary file at the target worker with the same basename
as local
. Returns the full path to the created file.