在利用
parallel包,借助plink, openssh链接远程计算机进行并行运算,链接、运算正常,但是stopclutser时会导致服务端sshd服务终止,有人又遇到过这种状况吗?
多电脑并行运算,除了parallel with plink还有其他推荐的吗?
以下是我的代码,链接及计算都没有问题,就是每次结束运算之后,服务器sshd服务都会终止。
library(parallel)
library(magrittr)
# library(stringr)#stringr package need to be installed
#' @param host remote computer host name or ip
#' @param user remote computer login username
#' @param rscript remote computer R software bin path
#' @param rshcmd plink login command with password
localhost <- list(host = "localhost")
kong <- list(
host = "KONG-pc",
user = "KONG",
rscript = "C:/Program Files/R/R-3.3.2/bin/Rscript.exe",
rshcmd = "plink -pw password"
)
works <- list(kong, localhost) %>% set_names(sapply(., <code>[[</code>, "host"))
## test for KONG-pc
cl <- makePSOCKcluster(names = rep(works, c(5, 0)), outfile = "log.txt")
stopCluster(cl)