JuliaLang/julia — pull request #6030 by amitmurthy (2014-03-03 08:57:54+00:00)
Title: --bind-to check prioritized. Use iface address instead of loopback if available.

This PR does the following:

- preferably broadcasts the interface's ip-address instead of the loopback address even for `addprocs(n)`. Note that, as before, the workers do listen on all interfaces, but incoming connections are now made to the iface address. On my machine I could not detect any meaningful difference in time taken to transfer 800MB between two processes for this change. Both the iface address as well as loopback took around 1.2 seconds for a 800MB transfer executed via a `@time remotecall_fetch(3, ()->ones(10^8));`

- `--bind-to` command line option is used to solve the multi-homed node issue. It is is processed before other arguments and the global variable `bind_addr` is set the ip-address suggested on the command line (if present), else `bind_addr` is set to whatever is returned by `getipaddr()`.

- The machine line in `--machinefile` file format (as also `addprocs(machines::Vector)`), is now of the form `[user@]host[:port] [bind_addr]`. i.e., it supports an optional `bind_addr` field that is passed as a command line argument to the started workers.

Closes https://github.com/JuliaLang/julia/issues/5995

NOTE: With this change while everything works, an ssh addprocs causes a segfault on exit, which I am unable to debug. valgrind does not list any anomalies.

For example,
```
addprocs(["127.0.0.1", "127.0.0.1"])
exit(1)
```
causes a segfault.