Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH worker connections #408

Merged
merged 1 commit into from
Feb 20, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions j/multi.j
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,9 @@ function start_worker(wrfd)
error("could not bind socket")
end
io = fdio(wrfd)
write(io, port[1]) # print port
write(io, getipaddr()) # print hostname
write(io, "julia_worker:") # print header
fprintf(io, "%d#", port[1]) # print port
write(io, getipaddr()) # print hostname
write(io, '\n')
flush(io)
# close stdin; workers will not use it
Expand Down Expand Up @@ -999,8 +1000,16 @@ function start_remote_workers(machines, cmds)
end
w = cell(n)
for i=1:n
port = read(outs[i],Int16)
hostname = readline(outs[i])[1:end-1]
local hostname::String, port::Int16
while true
conninfo = readline(outs[i])
m = match(r"^julia_worker:(\d+)#(.*)", conninfo)
if m != nothing
port = parse_int(Int16, m.captures[1])
hostname = m.captures[2]
break
end
end
w[i] = Worker(hostname, port)
end
w
Expand Down