【发布时间】:2013-04-11 05:50:54
【问题描述】:
我刚刚使用本教程在 Mac OS-X Mountain Lion 上安装了Rmpi:http://www.stats.uwo.ca/faculty/yu/Rmpi/mac_os_x.htm。我只需要 Rmpi 来利用所有内核,而不是部署在硬件集群或类似设备上。
实际上,一切正常,但现在我体验到,只要我没有有效的互联网连接(比如坐在火车上或只是转无线),生成奴隶就会失败,我想知道这是否应该像这样工作这个?
> require( Rmpi )
> mpi.spawn.Rslaves( nslaves=2 )
--------------------------------------------------------------------------
At least one pair of MPI processes are unable to reach each other for
MPI communications. This means that no Open MPI device has indicated
that it can be used to communicate between these processes. This is
an error; Open MPI requires that all MPI processes be able to reach
each other. This error can sometimes be the result of forgetting to
specify the "self" BTL.
Process 1 ([[56132,1],0]) is on host: ABC-MB02
Process 2 ([[56132,2],0]) is on host: ABC-MB02
BTLs attempted: self sm
Your MPI job is now going to abort; sorry.
--------------------------------------------------------------------------
2 slaves are spawned successfully. 0 failed.
[ABC-MB02:53970] 2 more processes have sent help message help-mca-bml-r2.txt / unreachable proc
[ABC-MB02:53970] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
然后我的 CPU 的负载会跳到 100%,最终 R 会话将崩溃。
有什么办法可以避免这种行为吗?这是我的sessionInfo
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] graphics grDevices datasets stats utils methods base
other attached packages:
[1] Rmpi_0.6-3 ggplot2_0.9.3 stringr_0.6.2 reshape2_1.2.2 plyr_1.8
loaded via a namespace (and not attached):
[1] colorspace_1.2-1 dichromat_2.0-0 digest_0.6.3 grid_2.15.2 gtable_0.1.2 labeling_0.1
[7] MASS_7.3-23 munsell_0.4 proto_0.3-10 RColorBrewer_1.0-5 scales_0.2.3 tools_2.15.2
【问题讨论】:
-
对于单台机器,使用
mclapply和parallel包中的朋友系列函数通常更方便且内存效率更高;这些使用共享内存和分叉,而不是产生独立的进程。在您的问题中添加一个“mpi”标签也可能会有所帮助,因为它听起来并不特定于 R。 -
@MartinMorgan 感谢您的建议。问题是我无法真正控制我将使用哪个并行库,因为该功能是在我正在构建的其他包中实现的(来自 Bioconductor 的
xcms和CAMERA)。这些包只是测试是否安装了Rmpi(首选)或snow,并将计算部署到我指定的尽可能多的核心。但是,使用snow,我可以规避此处描述的问题,但要面对其他问题。 -
这些包来自同一组;也许发邮件给
packageDescription('CAMERA')$Maintainer和 xcms 会带来一个长期的解决方案? -
@MartinMorgan 我可以,但不想过多打扰维护者,因为我最近向他们发送了几个问题和更高优先级的功能请求:-)
标签: macos r parallel-processing mpi