6

我正在尝试Rmpi在 LAM MPI 集群机器上安装软件包。以前我一直在编译和测试一些东西(mpi4py和小型 C++ 程序),所以我确信 MPI 本身可以工作。但是,链接库时安装Rmpi包失败。

我的主要嫌疑人是调用gcc而不是mpicc在makefile中(我试图在配置中找到行来更改它,但到目前为止找不到它)。

有人有在 LAM 上安装 Rmpi​​ 的经验吗?你是如何做到的?

建筑学

  • LAM MPI(或者如果存在 PBS MPI,我该如何检查?)。可以肯定的一件事,我有 mpicpp 文件,我认为这对所有 mpi 实现都不通用
  • R-2.15.2
  • rmpi_0.6-1
  • CentOS 5.5 版(最终版),x86_64

从 R 调用的命令

install.packages("Rmpi")

日志

trying URL 'http://cran.at.r-project.org/src/contrib/Rmpi_0.6-1.tar.gz'
Content type 'application/x-gzip' length 92977 bytes (90 Kb)
opened URL
==================================================
downloaded 90 Kb

* installing *source* package âRmpiâ ...
** package âRmpiâ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
I am here /usr and it is OpenMPI
Trying to find mpi.h ...
Found in /usr/include
Trying to find libmpi.so or libmpich.a ...
Found libmpi in /usr/lib
checking for openpty in -lutil... yes
checking for main in -lpthread... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c RegQuery.c -o RegQuery.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c Rmpi.c -o Rmpi.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c conversion.c -o conversion.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c internal.c -o internal.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o conversion.o internal.o -L/usr/lib -lmpi -lutil -lpthread -L/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/lib -lR
/usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libutil.a when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
installing to /home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs/Rmpi.so':
  /usr/lib/libmpi.so.0: undefined symbol: _kio
Error: loading failed
Execution halted
ERROR: loading failed
* removing â/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpiâ

The downloaded source packages are in
        â/tmp/Rtmp5qzeqp/downloaded_packagesâ
Warning message:
In install.packages("Rmpi") :
  installation of package âRmpiâ had non-zero exit status
4

3 回答 3

9

我们有一个非常相似的设置。我最近还没有接触到足以说明您的特殊情况,但我可以传递一些让我们启动并运行的命令......

正如 Dirk 所说,我们的第一步是让 OpenMPI 运行。设置完成后,您需要确保LD_LIBRARY_PATH已正确设置:

export LD_LIBRARY_PATH=/opt/openmpiv2/lib/:$LD_LIBRARY_PATH

最终为我们安装 Rmpi​​ 的命令(在运行上述命令并启动 R 之后)是:

install.packages("Rmpi", configure.args = c("--with-Rmpi-include=/opt/openmpiv2/include/", "--with-Rmpi-libpath=/opt/openmpiv2/lib/", "--with-Rmpi-type=OPENMPI", "--with-mpi=/opt/openmpiv2/"))

它为我们成功安装了软件包。然后我们可以使用以下命令运行作业:

qsub -I -l nodes=2:ppn=12
/opt/openmpiv2/bin/mpirun --hostfile $PBS_NODEFILE -n 1 R --slave -f rmpitest.R

这些命令可能对我们的设置非常具体,以至于它们可能没有用,但希望这里的一些东西可以为您节省一些时间!

正如@Sergej 在下面提出的,更通用的解决方案可能是:

install.packages(
  "Rmpi", 
  configure.args = c(
   "--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
   "--with-Rmpi-libpath=/usr/lib/",     # This is where liblam.so is located (actually as I type it mine was located in /usr/lib64/liblam.so.0, so maybe this is not needed at all)
   "--with-Rmpi-type=LAM"               # This says that the type is LAM (there is also OPENMPI and MPICH)
))

我们的设置:RHEL 5、Rmpi 0.5-9、OpenMPI 1.4.3.、R 2.15.0

于 2012-11-26T18:35:53.747 回答
3

许多年前,我曾经使用 LAM,但后来改用 OpenMPI。Rmpi 的作者 Hao Yu 建议这样做。

r-sig-hpc 列表是解决此类问题的好地方。

于 2012-11-26T18:27:25.310 回答
2

按照 Jeff Allen 的建议,我去了 R 并运行

install.packages(
  "Rmpi", 
  configure.args = c(
   "--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
   "--with-Rmpi-libpath=/usr/lib64/",     # This is where liblam.so is located
   "--with-Rmpi-type=LAM"               # This says that the type is LAM (there is also OPENMPI and MPICH)
))

我也跑

# Because it was non-standard R location so it din't find shared libraries
export LD_LIBRARY_PATH=/g/software/linux/pack/r-2.15.0/lib64/R/lib

# Rmpi also could not find libutil so I had to add path to it as well
export LD_PRELOAD=/usr/lib64/libutil.so

编辑

即使我在多个节点上运行 Rmpi​​ 时设法编译它,它也会失败。所以我想我毕竟必须开始推动 OpenMPI 转换:/

于 2012-11-26T19:02:00.527 回答