[英]Combining local processes with remote processes in Julia
我正在嘗試將遠程進程與本地進程結合使用,但是當我這樣做時,我得到以下輸出
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.
...
我曾嘗試先添加本地進程,但在添加遠程進程時出現相同的錯誤。
我知道這個問題很老,但今天有人問我是否知道這個未回答問題的答案。
您可以將-p
與--machinefile
選項一起使用:
Julia 可以使用
-p
或--machine-file
選項以並行模式啟動。-p
n 將啟動額外的 n 個工作進程,而--machine-file
file 將為--machine-file
文件中的每一行啟動一個工作進程。 文件中定義的機器必須可以通過無密碼ssh 登錄訪問,並且 Julia 安裝在與當前主機相同的位置。 每個機器定義都采用[count*][user@]host[:port] [bind_addr[:port]]
。 user 默認為當前用戶,port 為標准 ssh 端口。count
是在節點上生成的 worker 數量,默認為 1。可選的 bind-tobind_addr[:port]
指定其他 worker 應該用來連接到這個 worker 的 IP 地址和端口。
自從我使用--machinefile
選項以來已經很長時間了,在我的情況下n
選項不起作用,我不知道它是否已修復,但是您可以為您想要的每個工作進程添加一行,例如,如果這對您不起作用:
# 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:
$ julia -p 2 --machinefile machinefile.txt
總共 25 個進程(2 個本地進程和 23 個遠程進程)。
但是如果有記錄, n
選項應該可以工作,否則請檢查是否有錯誤,如果沒有,請打開一個新的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.