- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下问题。
为什么在标准节点(最大核心 56)上提交作业时一切运行正常,但是当我将相同的作业/代码提交到 large_memory 节点(最大核心 128)时,我收到错误?
> no_cores <- detectCores() - 1
> cl <- makeCluster(no_cores, outfile=paste0('./info_parallel.log'))
<小时/>Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", :
cannot open the connection
Calls: <Anonymous> ... doTryCatch -> recvData -> makeSOCKmaster ->
socketConnection
In addition: Warning message:
In socketConnection(master, port = port, blocking = TRUE, open = "a+b", :
localhost:11232 cannot be opened
Execution halted
Error in unserialize(node$con) : error reading from connection
Calls: <Anonymous> ... doTryCatch -> recvData -> recvData.SOCKnode -> unserialize
Execution halted
Error in unserialize(node$con) : error reading from connection
Calls: <Anonymous> ... doTryCatch -> recvData -> recvData.SOCKnode -> unserialize
Execution halted
正如我所说,R 代码在标准节点上运行良好,因此我认为这是 large_memory 节点的问题。那会是什么?
最佳答案
终于解决了。
该错误是由R中的默认连接数限制引起的。连接数的默认值为128。这里,“连接数”是指代码中使用的每个节点的核心数。
而在代码中,错误发生在 cl <- makeCluster...
这行
no_cores <- detectCores() - 1
cl <- makeCluster(no_cores, outfile=paste0('./info_parallel.log'))
在这里,detectCores()
将获得节点上的最大核心数。
在集群的标准节点中,每个节点的核心数小于128,这就是R代码可以在标准节点上良好运行的原因;而在我的例子中,large_memory 分区中每个节点的核心数为 128。默认达到核心数限制。所以错误显示为:
cannot open the connection
我尝试将核心数设置为 120,以便在 large_memory 节点上运行作业(最大核心数 = 128)。没有错误。该代码运行良好。
cl <- makeCluster(120, outfile=paste0('./info_parallel.log'))
# ^^^
谢谢!
关于r - makeCluster(多核)中的错误 : cannot open the connection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43900629/
我正在使用 makeCluster R 包中的函数 snow从 Linux 机器上启动一个远程 Linux 机器上的 SOCK 集群。两台机器成功通信的一切似乎都已解决(我能够在两者之间建立 ssh
我有以下问题。 为什么在标准节点(最大核心 56)上提交作业时一切运行正常,但是当我将相同的作业/代码提交到 large_memory 节点(最大核心 128)时,我收到错误? R 中的并行化代码:
正如标题所说,snow 包中的 makeCluster 和 makeSOCKcluster 在 linux 机器上运行时挂起。 cl <- makeCluster(4, type="SOCK) cl
我是一名优秀的程序员,十分优秀!