Installing Rmpi on LAM/MPI cluster

元气小坏坏 提交于 2019-12-04 06:13:15

We have a very similar setup. I haven't touched it recently enough to be able to speak to your particular situation, but I can pass along a few of the commands that got us up-and-running...

The first step for us, as Dirk mentioned, was to get OpenMPI running. Once that's setup, you'll need to be sure your LD_LIBRARY_PATH is properly set:

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

The command that finally got Rmpi installed for us (after running the above command and starting R) was:

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/"))

Which installed the package successfully for us. Then we can run jobs using commands such as:

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

These commands may be so specific to our setup that they may not be useful, but hopefully something in here can save you some time!

As @Sergej proposes below, a more general solution may be:

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)
))

Our setup: RHEL 5, Rmpi 0.5-9, OpenMPI 1.4.3., R 2.15.0

Many years ago, I used to use LAM but then switched to OpenMPI. Hao Yu, the author of Rmpi, suggests doing the same.

The r-sig-hpc list is a decent place for such questions.

As suggested by Jeff Allen I went to R and run

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)
))

I also run

# 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

EDIT

Even though I managed to compile it when I run Rmpi on more than one node it fails. So I guess I have to start pushing for OpenMPI transition after all :/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!