在 Julia 中结合本地进程和远程进程 [英] Combining local processes with remote processes in Julia

查看:18
本文介绍了在 Julia 中结合本地进程和远程进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将远程进程与本地进程结合使用,但是当我这样做时会得到以下输出

I'm trying to use remote processes in conjuntion with local processes, but when I do I get the following output

julia> addprocs(["user@host"], tunnel=true, dir="~/julia-79599ada44/bin/", sshflags=`-p 6969`)
id: cannot find name for group ID 350
1-element Array{Any,1}:
 2

julia> addprocs(23)
fatal error on 2: ERROR: connect: host is unreachable (EHOSTUNREACH)
 in wait at ./task.jl:284
 in wait at ./task.jl:194
 in stream_wait at stream.jl:263
 in wait_connected at stream.jl:301
 in Worker at multi.jl:113
 in anonymous at task.jl:905
fatal error on fatal error on 5: 6: fatal error on fatal error on fatal error on 9: 14: 8: Worker 3 terminated.
...

我尝试先添加本地进程,但添加远程进程时出现相同的错误.

I have tried adding the local processes first but I get the same errors when I add the remote ones.

推荐答案

我知道这个问题很老,但今天有人问我是否知道这个未回答问题的答案.

I know the question is old, but I was asked today if I knew the answer of this unanswered question.

您可以将 -p--machinefile 选项一起使用:

You could use the -p along with the --machinefile options:

Julia 可以使用 -p--machine-file 选项以并行模式启动.-p n 将启动额外的 n 个工作进程,而 --machine-file file 将为文件文件中的每一行启动一个工作进程.文件中定义的机器必须可以通过 password-less ssh 登录访问,并且 Julia 安装在与当前主机相同的位置.每个机器定义都采用 [count*][user@]host[:port] [bind_addr[:port]] 的形式.用户默认为当前用户,端口为标准 ssh 端口.count 是要在节点上生成的工作人员的数量,默认为 1.可选的绑定到 bind_addr[:port] 指定其他工作人员的 IP 地址和端口应该用来连接到这个worker.

Julia can be started in parallel mode with either the -p or the --machine-file options. -p n will launch an additional n worker processes, while --machine-file file will launch a worker for each line in file file. The machines defined in file must be accessible via a password-less ssh login, with Julia installed at the same location as the current host. Each machine definition takes the form [count*][user@]host[:port] [bind_addr[:port]]. user defaults to current user, port to the standard ssh port. count is the number of workers to spawn on the node, and defaults to 1. The optional bind-to bind_addr[:port] specifies the IP address and port that other workers should use to connect to this worker.

我已经很久没有使用 --machinefile 选项了,在我的例子中 n 选项不起作用,我不知道它是否有效已修复,但您可以为您想要的每个工作进程添加一行,例如,如果这对您不起作用:

It has been a long time since I used the --machinefile option, in my case the n option didn't work and I don't know if it has been fixed, but you could add one line for each worker process you want instead, for example, if this doesn't work for you:

# machinefile.txt
23 user@host

你可以试试这个:

# machinfile.txt
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host
user@host

然后像这样调用 julia:

And then invoke julia like:

$ julia -p 2 --machinefile machinefile.txt

总共有 25 个进程(2 个本地进程和 23 个远程进程).

For a total of 25 processes (2 local and 23 remote).

但是 n 选项如果有文档应该可以工作,否则请检查是否有错误,如果没有,请打开一个新的.

But the n option should work if it is documented, else please check if there is a bug and if not, open a new one.

这篇关于在 Julia 中结合本地进程和远程进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆