@@ -56,23 +56,32 @@ arguments (see below). In particular, the `exename` keyword can be used to speci
5656the path to the `julia` binary on the remote machine(s).
5757
5858`machines` is a vector of "machine specifications" which are given as strings of
59- the form `[user@]host[:port] [bind_addr[:port]]`. `user` defaults to current user and `port`
60- to the standard SSH port. If `[bind_addr[:port]]` is specified, other workers will connect
61- to this worker at the specified `bind_addr` and `port`.
59+ the form `[user@]host[:ssh_port] [bind_addr[:bind_port]]`. `user` defaults to
60+ current user and `ssh_port` to the standard SSH port. If
61+ `[bind_addr[:bind_port]]` is specified, other workers will connect to this
62+ worker at the specified `bind_addr` and `bind_port`. `bind_port` can be a
63+ specific port like in `addr:9000`, but it can also specify a port hint by
64+ enclosing it in brackets like `addr:[9000]`. Giving a port hint means that
65+ DistributedNext will try to bind to the specified port, but will fall back to
66+ another free port if it's unavailable.
6267
6368It is possible to launch multiple processes on a remote host by using a tuple in the
6469`machines` vector or the form `(machine_spec, count)`, where `count` is the number of
6570workers to be launched on the specified host. Passing `:auto` as the worker count will
66- launch as many workers as the number of CPU threads on the remote host.
71+ launch as many workers as the number of CPU threads on the remote host. If the
72+ `bind_port` is specified then the first worker will bind to `bind_port` and all
73+ other workers on the host will use `bind_port` as a port hint.
6774
6875**Examples**:
6976```julia
7077addprocs([
71- "remote1", # one worker on 'remote1' logging in with the current username
72- "user@remote2", # one worker on 'remote2' logging in with the 'user' username
73- "user@remote3:2222", # specifying SSH port to '2222' for 'remote3'
74- ("user@remote4", 4), # launch 4 workers on 'remote4'
75- ("user@remote5", :auto), # launch as many workers as CPU threads on 'remote5'
78+ "remote1", # one worker on 'remote1' logging in with the current username
79+ "user@remote2", # one worker on 'remote2' logging in with the 'user' username
80+ "user@remote3:2222", # specifying SSH port to '2222' for 'remote3'
81+ "user@remote4 10.1.1.1:8000" # specify the address for the worker to bind to on 'remote4'
82+ "user@remote5 10.1.1.1:[8000]" # same as above, but with a port hint instead of a specific port
83+ ("user@remote4", 4), # launch 4 workers on 'remote4'
84+ ("user@remote5", :auto), # launch as many workers as CPU threads on 'remote5'
7685])
7786```
7887
0 commit comments